1 <?xml version="1.0" standalone="no"?>
2 <xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:exsl="http://exslt.org/common"
5 xmlns:dyn="http://exslt.org/dynamic"
6 xmlns:math="http://exslt.org/math"
7 xmlns:xlink="http://www.w3.org/1999/xlink"
8 extension-element-prefixes="math dyn exsl xlink">
10 <xsl:variable name="G_ROOT" select="/"/>
13 ===========================================================================
14 CALCULATE GLOBAL VARIABLES BASED ON BLKDIAGRAM DEF IN INPUT XML
15 ===========================================================================
18 <xsl:variable name="G_Total_StandAloneMpmc_H">
19 <xsl:if test="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/MPMCSHAPE">
20 <xsl:value-of select="($BLKD_MPMC_MOD_H + $BLKD_MPMC2PROC_GAP)"/>
22 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/MPMCSHAPE)">0</xsl:if>
25 <xsl:variable name="G_Max_Stack_BlwSbs_H">
26 <xsl:call-template name="F_Calc_Max_Stack_BlwSbs_Height"/>
29 <xsl:variable name="G_Max_Stack_AbvSbs_H">
30 <xsl:call-template name="F_Calc_Max_Stack_AbvSbs_Height"/>
33 <xsl:variable name="G_Total_Stacks_W">
34 <xsl:call-template name="F_Calc_Stack_X">
35 <xsl:with-param name="iStackIdx" select="($G_ROOT/EDKSYSTEM/BLKDIAGRAM/@STACK_HORIZ_WIDTH)"/>
39 <xsl:variable name="G_NumOfSharedBusses" select="count($G_ROOT/EDKSYSTEM/BLKDIAGRAM/SBSSHAPES/MODULE)"/>
40 <xsl:variable name="G_Total_SharedBus_H" select="($G_NumOfSharedBusses * $BLKD_SBS_LANE_H)"/>
42 <xsl:variable name="G_NumOfBridges" select="count($G_ROOT/EDKSYSTEM/BLKDIAGRAM/BRIDGESHAPES/MODULE)"/>
43 <xsl:variable name="G_Total_Bridges_W" select="(($G_NumOfBridges * ($BLKD_MOD_W + ($BLKD_BUS_LANE_W * 2))) + $BLKD_BRIDGE_GAP)"/>
45 <xsl:variable name="G_Total_DrawArea_CLC" select="($G_Total_Stacks_W + $G_Total_Bridges_W + ($BLKD_INNER_GAP * 2))"/>
47 <xsl:variable name="G_Total_DrawArea_W">
48 <xsl:if test="$G_Total_DrawArea_CLC > ($BLKD_KEY_W + $BLKD_SPECS_W + $BLKD_SPECS2KEY_GAP)">
49 <xsl:value-of select="$G_Total_DrawArea_CLC"/>
51 <xsl:if test="not($G_Total_DrawArea_CLC > ($BLKD_KEY_W + $BLKD_SPECS2KEY_GAP + $BLKD_SPECS_W))">
52 <xsl:value-of select="($BLKD_KEY_W + $BLKD_SPECS_W + $BLKD_SPECS2KEY_GAP)"/>
56 <xsl:variable name="G_IpBucketMods_H">
57 <xsl:if test="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/IPBUCKET/@MODS_H"><xsl:value-of select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/IPBUCKET/@MODS_H"/></xsl:if>
58 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/IPBUCKET/@MODS_H)">0</xsl:if>
60 <xsl:variable name="G_Total_IpBucket_H" select="($G_IpBucketMods_H * ($BLKD_MOD_H + $BLKD_BIF_H))"/>
62 <xsl:variable name="G_Total_UnkBucket_H">
63 <xsl:if test="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/UNKBUCKET">
65 <xsl:variable name="unkBucketMods_H_">
66 <xsl:if test="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/UNKBUCKET/@MODS_H"><xsl:value-of select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/UNKBUCKET/@MODS_H"/></xsl:if>
67 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/UNKBUCKET/@MODS_H)">0</xsl:if>
70 <xsl:variable name="total_UnkMod_H_" select="($unkBucketMods_H_ * ($BLKD_MOD_H + $BLKD_BIF_H))"/>
72 <xsl:variable name="unkBucketBifs_H_">
73 <xsl:if test="/EDKSYSTEM/BLKDIAGRAM/UNKBUCKET/@BIFS_H"><xsl:value-of select="/EDKSYSTEM/BLKDIAGRAM/UNKBUCKET/@BIFS_H"/></xsl:if>
74 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/UNKBUCKET/@BIFS_H)">0</xsl:if>
77 <xsl:variable name="total_UnkBif_H_" select="($unkBucketBifs_H_ * ($BLKD_MOD_H + $BLKD_BIF_H))"/>
79 <xsl:value-of select="($total_UnkBif_H_ + $total_UnkMod_H_)"/>
82 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/UNKBUCKET)">0</xsl:if>
85 <xsl:variable name="G_SharedBus_Y" select="($BLKD_INNER_Y + $G_Total_StandAloneMpmc_H + $G_Max_Stack_AbvSbs_H + $BLKD_PROC2SBS_GAP)"/>
87 <!-- ===========================================================================
88 Calculate the width of the Block Diagram based on the total number of
89 buslanes and modules in the design. If there are no buslanes or modules,
90 a default width, just wide enough to display the KEY and SPECS is used
91 =========================================================================== -->
92 <xsl:variable name="G_Total_Blkd_W" select="($G_Total_DrawArea_W + (($BLKD_PRTCHAN_W + $BLKD_IORCHAN_W)* 2))"/>
93 <xsl:variable name="G_Total_Diag_W" select="$G_Total_Blkd_W"/>
95 <!-- =========================================================================== -->
96 <!-- Calculate the height of the Block Diagram based on the total number of -->
97 <!-- buslanes and modules in the design. Take into account special shapes such -->
98 <!-- as MultiProc shapes. -->
99 <!-- =========================================================================== -->
102 <xsl:variable name="G_Total_DrawArea_H" select="($G_Total_StandAloneMpmc_H + $G_Max_Stack_AbvSbs_H + $BLKD_PROC2SBS_GAP + $G_Total_SharedBus_H + $G_Max_Stack_BlwSbs_H + $BLKD_SBS2IP_GAP + $G_Total_IpBucket_H + $BLKD_IP2UNK_GAP + $G_Total_UnkBucket_H + ($BLKD_INNER_GAP * 2))"/>
103 <xsl:variable name="G_Total_Blkd_H" select="($G_Total_DrawArea_H + (($BLKD_PRTCHAN_H + $BLKD_IORCHAN_H)* 2))"/>
105 <xsl:variable name="G_Total_Diag_H">
106 <xsl:if test="($IN_TESTMODE = 'TRUE')">
107 <xsl:message>Generating Blkdiagram in TestMode </xsl:message>
108 <xsl:value-of select="$G_Total_Blkd_H"/>
110 <xsl:if test="(not($IN_TESTMODE) or ($IN_TESTMODE = 'FALSE'))">
111 <xsl:value-of select="($G_Total_Blkd_H + $BLKD_DRAWAREA2KEY_GAP + $BLKD_KEY_H)"/>