1 <?xml version="1.0" standalone="no"?>
3 <xsl:stylesheet version="1.0"
4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 xmlns:xlink="http://www.w3.org/1999/xlink"
6 xmlns:exsl="http://exslt.org/common"
7 xmlns:dyn="http://exslt.org/dynamic"
8 xmlns:math="http://exslt.org/math"
9 extension-element-prefixes="math dyn exsl xlink">
11 xmlns:svg="http://www.w3.org/2000/svg"
12 <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"
13 doctype-public="-//W3C//DTD SVG 1.0//EN"
14 doctype-system="http://www.w3.org/TR/SVG/DTD/svg10.dtd"/>
17 <xsl:template name="F_Calc_Proc_Height">
18 <xsl:param name="iProcInst" select="_processor_"/>
20 <xsl:variable name="tot_bifs_h_">
21 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE[(@INSTANCE = $iProcInst)]/@BIFS_H)">0</xsl:if>
23 <xsl:if test="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE[(@INSTANCE = $iProcInst)]/@BIFS_H">
24 <xsl:variable name="bifs_h_" select="($G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE[(@INSTANCE = $iProcInst)]/@BIFS_H)"/>
25 <xsl:value-of select="(($BLKD_BIF_H + $BLKD_MOD_BIF_GAP_H) * $bifs_h_)"/>
29 <xsl:value-of select="(($BLKD_MOD_LANE_H * 2) + $tot_bifs_h_ + ($BLKD_MOD_LABEL_H + $BLKD_MOD_BIF_GAP_H))"/>
32 <xsl:template name="F_Calc_Max_Proc_Height">
34 <!-- Store the heights in a variable -->
35 <xsl:variable name="proc_heights_">
37 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE)">
41 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE">
42 <xsl:variable name="procInst_" select="@INSTANCE"/>
43 <xsl:variable name="proc_height_">
44 <xsl:call-template name="F_Calc_Proc_Height">
45 <xsl:with-param name="iProcInst" select="$procInst_"/>
50 <xsl:message>Found Proc height as <xsl:value-of select="$proc_height_"/></xsl:message>
52 <PROC HEIGHT="{$proc_height_}"/>
56 <!-- Return the max of them -->
58 <xsl:message>Found Proc ax as <xsl:value-of select="math:max(exsl:node-set($proc_heights_)/PROC/@HEIGHT)"/></xsl:message>
61 <xsl:value-of select="math:max(exsl:node-set($proc_heights_)/PROC/@HEIGHT)"/>
65 <xsl:template name="F_Calc_Proc_MemoryUnits_Height">
66 <xsl:param name="iProcInst" select="_processor_"/>
68 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@PROCESSOR = $iProcInst) and (@MODCLASS = 'MEMORY_UNIT'))])">0</xsl:if>
70 <xsl:if test="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@PROCESSOR = $iProcInst) and (@MODCLASS='MEMORY_UNIT'))]">
72 <xsl:variable name="peri_gap_">
74 <xsl:when test="not(@CSTACK_INDEX)">
75 <xsl:value-of select="$BLKD_BIF_H"/>
77 <xsl:otherwise>0</xsl:otherwise>
82 <!-- Store the all memory unit heights in a variable -->
83 <xsl:variable name="memU_heights_">
84 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@PROCESSOR = $iProcInst) and (@MODCLASS='MEMORY_UNIT'))]">
86 <xsl:variable name="unitId_" select="@PSTACK_MODS_Y"/>
88 <xsl:variable name="unitHeight_">
89 <xsl:call-template name="F_Calc_MemoryUnit_Height">
90 <xsl:with-param name="iShapeId" select="@SHAPE_ID"/>
94 <MEM_UNIT HEIGHT="{$unitHeight_ + $peri_gap_}"/>
98 <xsl:value-of select="sum(exsl:node-set($memU_heights_)/MEM_UNIT/@HEIGHT)"/>
103 <xsl:template name="F_Calc_Proc_Peripherals_Height">
104 <xsl:param name="iProcInst" select="_processor_"/>
106 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@PROCESSOR = $iProcInst) and not(@MODCLASS = 'MEMORY_UNIT'))])">0</xsl:if>
108 <xsl:if test="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@PROCESSOR = $iProcInst) and not(@MODCLASS='MEMORY_UNIT'))]">
110 <xsl:variable name="peri_gap_">
111 <xsl:if test="@CSTACK_INDEX">
112 <xsl:value-of select="$BLKD_BIF_H"/>
114 <xsl:if test="not(@IS_CSTACK)">0</xsl:if>
117 <!-- Store the all peripheral heights in a variable -->
118 <xsl:variable name="peri_heights_">
120 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@PROCESSOR = $iProcInst) and not(@MODCLASS='MEMORY_UNIT'))]">
121 <xsl:for-each select="MODULE">
123 <xsl:message><xsl:value-of select="@INSTANCE"/></xsl:message>
125 <xsl:variable name="peri_height_">
126 <xsl:call-template name="F_Calc_PeriShape_Height">
127 <xsl:with-param name="iShapeInst" select="@INSTANCE"/>
130 <PERI HEIGHT="{$peri_height_ + $peri_gap_}"/>
135 <xsl:value-of select="sum(exsl:node-set($peri_heights_)/PERI/@HEIGHT)"/>
140 <xsl:template name="F_Calc_Space_AbvSbs_Height">
141 <xsl:param name="iStackToEast" select="'NONE'"/>
142 <xsl:param name="iStackToWest" select="'NONE'"/>
145 <xsl:variable name = "stackAbvSbs_West_H_">
147 <xsl:when test="(($iStackToEast = '0') and ($iStackToWest = 'NONE'))">0</xsl:when>
148 <xsl:when test="(($iStackToEast = 'NONE') and not($iStackToWest = 'NONE'))">
149 <xsl:call-template name="F_Calc_Stack_AbvSbs_Height">
150 <xsl:with-param name="iStackIdx" select="$iStackToWest"/>
153 <xsl:when test="(not($iStackToEast = '0') and ($iStackToWest = 'NONE'))">
154 <xsl:call-template name="F_Calc_Stack_AbvSbs_Height">
155 <xsl:with-param name="iStackIdx" select="($iStackToEast - 1)"/>
158 <xsl:otherwise>0</xsl:otherwise>
162 <xsl:variable name = "stackAbvSbs_East_H_">
163 <xsl:call-template name="F_Calc_Stack_AbvSbs_Height">
164 <xsl:with-param name="iStackIdx" select="$iStackToEast"/>
168 <xsl:variable name="stackAbvSbs_heights_">
169 <STACK HEIGHT="{$stackAbvSbs_East_H_}"/>
170 <STACK HEIGHT="{$stackAbvSbs_West_H_}"/>
173 <xsl:value-of select="math:max(exsl:node-set($stackAbvSbs_heights_)/STACK/@HEIGHT)"/>
177 <xsl:template name="F_Calc_Space_BlwSbs_Height">
178 <xsl:param name="iStackToEast" select="'NONE'"/>
179 <xsl:param name="iStackToWest" select="'NONE'"/>
181 <xsl:variable name = "stackBlwSbs_West_H_">
183 <xsl:when test="(($iStackToEast = '0') and ($iStackToWest = 'NONE'))">0</xsl:when>
184 <xsl:when test="(($iStackToEast = 'NONE') and not($iStackToWest = 'NONE'))">
185 <xsl:call-template name="F_Calc_Stack_BlwSbs_Height">
186 <xsl:with-param name="iStackIdx" select="$iStackToWest"/>
189 <xsl:when test="(not($iStackToEast = '0') and ($iStackToWest = 'NONE'))">
190 <xsl:call-template name="F_Calc_Stack_BlwSbs_Height">
191 <xsl:with-param name="iStackIdx" select="($iStackToEast - 1)"/>
198 <xsl:variable name = "stackBlwSbs_East_H_">
199 <xsl:call-template name="F_Calc_Stack_BlwSbs_Height">
200 <xsl:with-param name="iStackIdx" select="$iStackToEast"/>
204 <xsl:variable name="stackBlwSbs_heights_">
205 <STACK HEIGHT="{$stackBlwSbs_East_H_}"/>
206 <STACK HEIGHT="{$stackBlwSbs_West_H_}"/>
209 <xsl:value-of select="math:max(exsl:node-set($stackBlwSbs_heights_)/STACK/@HEIGHT)"/>
214 <xsl:template name="F_Calc_Stack_AbvSbs_Height">
215 <xsl:param name="iStackIdx" select="100"/>
217 <xsl:message>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</xsl:message>
220 <xsl:if test="(not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@STACK_HORIZ_INDEX = $iStackIdx) and (@IS_ABVSBS))]) and
221 not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE[(@STACK_HORIZ_INDEX = $iStackIdx)]))"><xsl:value-of select="$BLKD_PROC2SBS_GAP"/></xsl:if>
223 <xsl:if test="(($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@STACK_HORIZ_INDEX = $iStackIdx) and (@IS_ABVSBS))]) or
224 ($G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE[ (@STACK_HORIZ_INDEX = $iStackIdx)]))">
227 <xsl:variable name="peri_gap_">
228 <xsl:value-of select="$BLKD_BIF_H"/>
230 <xsl:when test="(@SHAPE_VERTI_INDEX)">
232 <xsl:otherwise>0</xsl:otherwise>
238 <xsl:message>The gap is <xsl:value-of select="$peri_gap_"/></xsl:message>
239 <xsl:message>The gap is <xsl:value-of select="$peri_gap_"/></xsl:message>
240 <xsl:message>================================</xsl:message>
241 <xsl:message>================================</xsl:message>
242 <xsl:message>This is above <xsl:value-of select="@INSTANCE"/></xsl:message>
243 <xsl:message><xsl:value-of select="@INSTANCE"/> : <xsl:value-of select="$peri_height_"/></xsl:message>
247 <!-- Store the all peripheral heights in a variable -->
248 <xsl:variable name="peri_heights_">
250 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@STACK_HORIZ_INDEX = $iStackIdx) and not(@MODCLASS = 'MEMORY_UNIT') and (@IS_ABVSBS))]">
251 <xsl:for-each select="MODULE">
253 <xsl:message>This is above <xsl:value-of select="@INSTANCE"/></xsl:message>
256 <xsl:variable name="peri_height_">
258 <xsl:call-template name="F_Calc_Shape_Height">
259 <xsl:with-param name="shapeId" select="@SHAPE_ID"/>
263 <xsl:call-template name="F_Calc_PeriShape_Height">
264 <xsl:with-param name="iShapeInst" select="@INSTANCE"/>
268 <PERI HEIGHT="{$peri_height_ + $BLKD_BIF_H}"/>
272 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@STACK_HORIZ_INDEX = $iStackIdx) and (@MODCLASS = 'MEMORY_UNIT') and (@IS_ABVSBS))]">
274 <xsl:variable name="memu_height_">
275 <xsl:call-template name="F_Calc_MemoryUnit_Height">
276 <xsl:with-param name="iShapeId" select="@SHAPE_ID"/>
281 <xsl:message>Mem_Unit : <xsl:value-of select="@SHAPE_ID"/> : <xsl:value-of select="$memu_height_ + $peri_gap_"/></xsl:message>
283 <PERI HEIGHT="{$memu_height_ + $BLKD_BIF_H}"/>
287 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE[((@STACK_HORIZ_INDEX = $iStackIdx) and (@IS_ABVSBS))]">
289 <xsl:variable name="proc_height_">
290 <xsl:call-template name="F_Calc_PeriShape_Height">
291 <xsl:with-param name="iShapeInst" select="@INSTANCE"/>
296 <xsl:message>===================================</xsl:message>
297 <xsl:message>Processor : <xsl:value-of select="@INSTANCE"/> : <xsl:value-of select="$peri_height_ + $peri_gap_"/></xsl:message>
298 <PERI HEIGHT="{$proc_height_ + $BLKD_PROC2SBS_GAP }"/>
300 <PERI HEIGHT="{$proc_height_ + $BLKD_BIF_H}"/>
307 <xsl:message><xsl:value-of select="@INSTANCE"/> : <xsl:value-of select="$peri_height_ + $peri_gap_"/></xsl:message>
308 <xsl:message>================================</xsl:message>
312 <xsl:message>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</xsl:message>
314 <xsl:value-of select="sum(exsl:node-set($peri_heights_)/PERI/@HEIGHT)"/>
319 <xsl:template name="F_Calc_Stack_BlwSbs_Height">
320 <xsl:param name="iStackIdx" select="100"/>
322 <!-- Store the all peripheral heights in a variable -->
323 <xsl:variable name="stack_heights_">
325 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@STACK_HORIZ_INDEX = $iStackIdx) and (@IS_BLWSBS))])">
326 <STACKSHAPE HEIGHT="0"/>
329 <xsl:if test="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@STACK_HORIZ_INDEX = $iStackIdx) and (@IS_BLWSBS))]">
331 <xsl:variable name="peri_gap_">
333 <xsl:when test="(@SHAPE_VERTI_INDEX)">
334 <xsl:value-of select="$BLKD_BIF_H"/>
336 <xsl:otherwise>0</xsl:otherwise>
340 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@STACK_HORIZ_INDEX = $iStackIdx) and not(@MODCLASS = 'MEMORY_UNIT') and (@IS_BLWSBS))]">
341 <xsl:for-each select="MODULE">
343 <xsl:message>This is below <xsl:value-of select="@INSTANCE"/></xsl:message>
345 <xsl:variable name="peri_height_">
346 <xsl:call-template name="F_Calc_PeriShape_Height">
347 <xsl:with-param name="iShapeInst" select="@INSTANCE"/>
351 <STACKSHAPE HEIGHT="{$peri_height_ + $peri_gap_}"/>
355 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@STACK_HORIZ_INDEX = $iStackIdx) and (@MODCLASS = 'MEMORY_UNIT') and (@IS_BLWSBS))]">
357 <xsl:variable name="memu_height_">
358 <xsl:call-template name="F_Calc_MemoryUnit_Height">
359 <xsl:with-param name="iShapeId" select="@SHAPE_ID"/>
363 <STACKSHAPE HEIGHT="{$memu_height_ + $peri_gap_}"/>
366 <xsl:message>Mem_Unit : <xsl:value-of select="@SHAPE_ID"/> : <xsl:value-of select="$memu_height_ + $peri_gap_"/></xsl:message>
372 <xsl:variable name="sbsBuckets_H_">
373 <xsl:call-template name="F_Calc_Stack_SbsBuckets_Height">
374 <xsl:with-param name="iStackIdx" select="$iStackIdx"/>
378 <STACKSHAPE HEIGHT="{$sbsBuckets_H_}"/>
380 <xsl:message>Sbs Bucket H : <xsl:value-of select="$sbsBuckets_H_"/></xsl:message>
385 <xsl:message>vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv</xsl:message>
387 <xsl:value-of select="sum(exsl:node-set($stack_heights_)/STACKSHAPE/@HEIGHT)"/>
392 <xsl:template name="F_Calc_Stack_SbsBuckets_Height">
393 <xsl:param name="iStackIdx" select="1000"/>
395 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/SBSBUCKETS/SBSBUCKET[(@STACK_HORIZ_INDEX = $iStackIdx)])">0</xsl:if>
397 <xsl:if test="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/SBSBUCKETS/SBSBUCKET[(@STACK_HORIZ_INDEX = $iStackIdx)]">
399 <!-- Store the all buckets heights in a variable -->
400 <xsl:variable name="bkt_heights_">
401 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/SBSBUCKETS/SBSBUCKET[(@STACK_HORIZ_INDEX = $iStackIdx)]">
403 <xsl:variable name="bkt_height_">
404 <xsl:call-template name="F_Calc_SbsBucket_Height">
405 <xsl:with-param name="iBucketId" select="@BUS_INDEX"/>
409 <xsl:message>Found shared buckets height as <xsl:value-of select="$bkt_height_"/></xsl:message>
411 <BKT HEIGHT="{$bkt_height_ + $BLKD_BIF_H}"/>
415 <xsl:value-of select="sum(exsl:node-set($bkt_heights_)/BKT/@HEIGHT)"/>
420 <xsl:template name="F_Calc_Max_Stack_BlwSbs_Height">
422 <!-- Store the heights in a variable -->
423 <xsl:variable name="blwSbs_heights_">
425 <!-- Default, in case there are no modules or ports -->
428 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/BCLANESPACES/BCLANESPACE[(@EAST < $G_ROOT/EDKSYSTEM/BLKDIAGRAM/@STACK_HORIZ_WIDTH)]">
431 <xsl:message>Found a space of index <xsl:value-of select="@EAST"/></xsl:message>
434 <xsl:variable name="stack_height_">
435 <xsl:call-template name="F_Calc_Stack_BlwSbs_Height">
436 <xsl:with-param name="iStackIdx" select="@EAST"/>
441 <BLW HEIGHT="{$stack_height_}"/>
445 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/BCLANESPACES/BCLANESPACE[(@WEST = ($G_ROOT/EDKSYSTEM/BLKDIAGRAM/@STACK_HORIZ_WIDTH -1))]">
448 <xsl:message>Last stack of index <xsl:value-of select="@WEST"/></xsl:message>
451 <xsl:variable name="stack_height_">
452 <xsl:call-template name="F_Calc_Stack_BlwSbs_Height">
453 <xsl:with-param name="iStackIdx" select="@WEST"/>
458 <BLW HEIGHT="{$stack_height_}"/>
466 <xsl:message>Found Blw Sbs max as <xsl:value-of select="math:max(exsl:node-set($blwSbs_heights_)/BLW/@HEIGHT)"/></xsl:message>
468 <!-- Return the max of them -->
469 <xsl:value-of select="math:max(exsl:node-set($blwSbs_heights_)/BLW/@HEIGHT)"/>
473 <xsl:template name="F_Calc_Max_Stack_AbvSbs_Height">
475 <!-- Store the heights in a variable -->
476 <xsl:variable name="abvSbs_heights_">
478 <!-- Default, in case there are no modules or ports -->
481 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/BCLANESPACES/BCLANESPACE[(@EAST < $G_ROOT/EDKSYSTEM/BLKDIAGRAM/@STACK_HORIZ_WIDTH)]">
484 <xsl:message>Found a space of index <xsl:value-of select="@EAST"/></xsl:message>
487 <xsl:variable name="stack_height_">
488 <xsl:call-template name="F_Calc_Stack_AbvSbs_Height">
489 <xsl:with-param name="iStackIdx" select="@EAST"/>
494 <xsl:message>Found stack of width <xsl:value-of select="$stack_width_"/></xsl:message>
495 <xsl:message>==============================</xsl:message>
498 <ABV HEIGHT="{$stack_height_}"/>
506 <xsl:message>Found Blw Sbs max as <xsl:value-of select="math:max(exsl:node-set($blwSbs_heights_)/BLW/@HEIGHT)"/></xsl:message>
508 <!-- Return the max of them -->
509 <xsl:value-of select="math:max(exsl:node-set($abvSbs_heights_)/ABV/@HEIGHT)"/>
513 <xsl:template name="F_Calc_MultiProc_Stack_Height">
514 <xsl:param name="iMPStack_Blkd_X" select="100"/>
516 <xsl:variable name="mpStk_ShpHeights_">
517 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@HAS_MULTIPROCCONNS) and (@PSTACK_BLKD_X = $iMPStack_Blkd_X))])">
518 <MPSHAPE HEIGHT="0"/>
521 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@HAS_MULTIPROCCONNS) and (@PSTACK_BLKD_X = $iMPStack_Blkd_X))]">
522 <xsl:variable name="shpClass_" select="@MODCLASS"/>
523 <xsl:variable name="shpHeight_">
525 <xsl:when test="$shpClass_ = 'PERIPHERAL'">
527 <xsl:message>Found Multi Proc Peripheral</xsl:message>
529 <xsl:call-template name="F_Calc_PeriShape_Height">
530 <xsl:with-param name="iShapeInst" select="MODULE/@INSTANCE"/>
533 <xsl:when test="$shpClass_ = 'MEMORY_UNIT'">
535 <xsl:message>Found Multi Proc Memory Unit</xsl:message>
537 <xsl:call-template name="F_Calc_MemoryUnit_Height">
538 <xsl:with-param name="iShapeIndex" select="@CSHAPE_INDEX"/>
541 <xsl:otherwise>0</xsl:otherwise>
546 <xsl:message>Found <xsl:value-of select="$shpHeight_"/></xsl:message>
549 <MPSHAPE HEIGHT="{$shpHeight_}"/>
554 <xsl:message>Found stack of height <xsl:value-of select="sum(exsl:node-set($mpStk_ShpHeights_)/MPSHAPE/@HEIGHT)"/></xsl:message>
557 <xsl:value-of select="sum(exsl:node-set($mpStk_ShpHeights_)/MPSHAPE/@HEIGHT)"/>
560 <xsl:template name="F_Calc_Max_MultiProc_Stack_Height">
562 <!-- Store the heights in a variable -->
564 <xsl:variable name="mpStks_Heights_">
565 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE)">
568 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE[(@PSTACK_BLKD_X)]">
569 <xsl:variable name="mpstack_height_">
570 <xsl:call-template name="F_Calc_MultiProc_Stack_Height">
571 <xsl:with-param name="iMPStack_Blkd_X" select="(@PSTACK_BLKD_X + 1)"/>
576 <xsl:message>Found <xsl:value-of select="$mpstack_height_"/></xsl:message>
578 <MPSTK HEIGHT="{$mpstack_height_}"/>
583 <!-- Return the max of them -->
584 <xsl:value-of select="math:max(exsl:node-set($mpStks_Heights_)/MPSTK/@HEIGHT)"/>
590 <xsl:template name="F_Calc_Stack_Shape_Y">
592 <xsl:param name="iHorizIdx" select="100"/>
593 <xsl:param name="iVertiIdx" select="100"/>
597 <xsl:param name="sbsGap" select="0"/>
598 <xsl:variable name="numSBSs_" select="count($G_ROOT/EDKSYSTEM/BLKDIAGRAM/SBSSHAPES/MODULE)"/>
599 <xsl:variable name="sbs_LANE_H_" select="($numSBSs_ * $BLKD_SBS_LANE_H)"/>
600 <xsl:variable name="sbsGap_" select="($BLKD_PROC2SBS_GAP + $sbs_LANE_H_)"/>
603 <xsl:variable name="sbsGap_" select="((count($G_ROOT/EDKSYSTEM/BLKDIAGRAM/SBSSHAPES/MODULE) * $BLKD_SBS_LANE_H) + $BLKD_PROC2SBS_GAP)"/>
605 <xsl:if test="(not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@STACK_HORIZ_INDEX = $iHorizIdx) and ((@SHAPE_VERTI_INDEX = $iVertiIdx) or ($iVertiIdx = 100)))]) and
606 not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/SBSBUCKETS/SBSBUCKET[( (@STACK_HORIZ_INDEX = $iHorizIdx) and ((@SHAPE_VERTI_INDEX = $iVertiIdx) or ($iVertiIdx = 100)))]) and
607 not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE[( (@STACK_HORIZ_INDEX = $iHorizIdx) and ((@SHAPE_VERTI_INDEX = $iVertiIdx) or ($iVertiIdx = 100)))]))">0</xsl:if>
611 <xsl:if test="(not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@STACK_HORIZ_INDEX = $iHorizIdx) and ((@SHAPE_VERTI_INDEX = $iVertiIdx) or ($iVertiIdx = 100)))]) and
612 not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/SBSBUCKETS/SBSBUCKET[( (@STACK_HORIZ_INDEX = $iHorizIdx) and ((@SHAPE_VERTI_INDEX = $iVertiIdx) or ($iVertiIdx = 100)))]) and
613 not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE[( (@STACK_HORIZ_INDEX = $iHorizIdx) and ((@SHAPE_VERTI_INDEX = $iVertiIdx) or ($iVertiIdx = 100)))]))">
614 <xsl:message>Something is missing </xsl:message>
618 <xsl:if test="(($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@STACK_HORIZ_INDEX = $iHorizIdx) and ((@SHAPE_VERTI_INDEX = $iVertiIdx) or ($iVertiIdx = 100)))]) or
619 ($G_ROOT/EDKSYSTEM/BLKDIAGRAM/SBSBUCKETS/SBSBUCKET[( (@STACK_HORIZ_INDEX = $iHorizIdx) and ((@SHAPE_VERTI_INDEX = $iVertiIdx) or ($iVertiIdx = 100)))]) or
620 ($G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE[( (@STACK_HORIZ_INDEX = $iHorizIdx) and ((@SHAPE_VERTI_INDEX = $iVertiIdx) or ($iVertiIdx = 100)))]))">
621 <!-- Store the spaces above this one in a variable -->
622 <xsl:variable name="spaces_above_">
624 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@STACK_HORIZ_INDEX = $iHorizIdx) and (@SHAPE_VERTI_INDEX < $iVertiIdx))])">
628 <!-- Store the height of all peripherals and memory units above this one-->
629 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@STACK_HORIZ_INDEX = $iHorizIdx) and (@SHAPE_VERTI_INDEX < $iVertiIdx))]">
631 <xsl:if test="not(@MODCLASS='MEMORY_UNIT')">
632 <xsl:variable name="peri_height_">
633 <xsl:call-template name="F_Calc_Shape_Height">
634 <xsl:with-param name="iShapeId" select="@SHAPE_ID"/>
638 <xsl:message>Found peri height <xsl:value-of select="$peri_height_"/></xsl:message>
640 <SPACE HEIGHT="{$peri_height_ + $BLKD_BIF_H}"/>
643 <xsl:if test="(@MODCLASS='MEMORY_UNIT')">
644 <xsl:variable name="memu_height_">
645 <xsl:call-template name="F_Calc_MemoryUnit_Height">
646 <xsl:with-param name="iShapeId" select="@SHAPE_ID"/>
650 <xsl:message>Found unit height <xsl:value-of select="$memu_height_"/></xsl:message>
652 <SPACE HEIGHT="{$memu_height_ + $BLKD_BIF_H}"/>
657 <!-- Store the height of all the processors above this one-->
658 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE[((@STACK_HORIZ_INDEX = $iHorizIdx) and (@SHAPE_VERTI_INDEX < $iVertiIdx))]">
659 <xsl:variable name="proc_height_">
660 <xsl:call-template name="F_Calc_PeriShape_Height">
661 <xsl:with-param name="iShapeInst" select="@INSTANCE"/>
666 <xsl:message>Found Proc height <xsl:value-of select="$proc_height_ + $BLKD_BIF_H"/></xsl:message>
668 <SPACE HEIGHT="{$proc_height_ + $BLKD_BIF_H}"/>
671 <!-- If its a peripheral that is below the shared busses, or its a shared bus bucket -->
672 <!-- add the height of the shared busses and the processor. -->
673 <xsl:if test="($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@STACK_HORIZ_INDEX = $iHorizIdx) and (@SHAPE_VERTI_INDEX = $iVertiIdx))]/@IS_BLWSBS)">
674 <SPACE HEIGHT="{$sbsGap_}"/>
676 <xsl:if test="($G_ROOT/EDKSYSTEM/BLKDIAGRAM/SBSBUCKETS/SBSBUCKET[((@STACK_HORIZ_INDEX = $iHorizIdx) and (@SHAPE_VERTI_INDEX = $iVertiIdx))])">
677 <SPACE HEIGHT="{$sbsGap_}"/>
680 <!-- Store the height of all shared bus buckets above this one-->
681 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/SBSBUCKETS/SBSBUCKET[((@STACK_HORIZ_INDEX = $iHorizIdx) and (@SHAPE_VERTI_INDEX < $iVertiIdx))]">
682 <xsl:variable name="bkt_height_">
683 <xsl:call-template name="F_Calc_SbsBucket_Height">
684 <xsl:with-param name="iBucketId" select="@BUS_INDEX"/>
689 <xsl:message>Found bucket height <xsl:value-of select="$bkt_height_ + $BLKD_BIF_H"/></xsl:message>
692 <SPACE HEIGHT="{$bkt_height_ + $BLKD_BIF_H}"/>
697 <xsl:value-of select="sum(exsl:node-set($spaces_above_)/SPACE/@HEIGHT)"/>
703 <xsl:template name="F_Calc_Max_BusConnLane_BifY">
705 <xsl:param name="iBusName" select="'_busname_'"/>
707 <!-- Store the heights in a variable -->
708 <xsl:variable name="busConnYs_">
710 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE/BUSCONNS/BUSCONNLANE/BUSCONN)">
711 <BUSCONNY HEIGHT="0"/>
714 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE/BUSCONNS/BUSCONNLANE[(@BUSNAME = $iBusName)]/BUSCONN">
716 <xsl:variable name="peri_cstk_y_">
717 <xsl:call-template name="F_Calc_CStackShapesAbv_Height">
718 <xsl:with-param name="iCStackIndex" select="../@CSTACK_INDEX"/>
719 <xsl:with-param name="ICStackModY" select="@CSTACK_MODS_Y"/>
723 <xsl:variable name="peri_bif_dy_">
724 <xsl:value-of select="(($BLKD_BIF_H + $BLKD_MOD_BIF_GAP_H) * @BIF_Y)"/>
727 <xsl:variable name="peri_bc_y_">
728 <xsl:value-of select="($BLKD_MOD_LANE_H + $BLKD_MOD_LABEL_H + $BLKD_MOD_BIF_GAP_H + $peri_bif_dy_ + ceiling($BLKD_BIF_H div 2)) - ceiling($BLKD_BIFC_H div 2)"/>
732 <xsl:message>Found a busconn lane</xsl:message>
734 <BUSCONNY HEIGHT="{$peri_cstk_y_ + $peri_bif_dy_ + $peri_bc_y_}"/>
739 <!-- Return the max of them -->
740 <xsl:value-of select="math:max(exsl:node-set($busConnYs_)/BUSCONNY/@HEIGHT)"/>
745 <xsl:template name="F_Calc_Min_BusConnLane_BifY">
747 <xsl:param name="iBusName" select="'_busname_'"/>
749 <!-- Store the heights in a variable -->
750 <xsl:variable name="busConnYs_">
752 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE/BUSCONNS/BUSCONNLANE/BUSCONN)">
753 <BUSCONNY HEIGHT="0"/>
756 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE/BUSCONNS/BUSCONNLANE[(@BUSNAME = $iBusName)]/BUSCONN">
758 <xsl:variable name="peri_cstk_y_">
759 <xsl:call-template name="F_Calc_CStackShapesAbv_Height">
760 <xsl:with-param name="iCStackIndex" select="../@CSTACK_INDEX"/>
761 <xsl:with-param name="iCStackModY" select="@CSTACK_MODS_Y"/>
765 <xsl:variable name="peri_bif_dy_">
766 <xsl:value-of select="(($BLKD_BIF_H + $BLKD_MOD_BIF_GAP_H) * @BIF_Y)"/>
769 <xsl:variable name="peri_bc_y_">
770 <xsl:value-of select="($BLKD_MOD_LANE_H + $BLKD_MOD_LABEL_H + $BLKD_MOD_BIF_GAP_H + $peri_bif_dy_ + ceiling($BLKD_BIF_H div 2)) - ceiling($BLKD_BIFC_H div 2)"/>
774 <xsl:message>Found a busconn lane</xsl:message>
776 <BUSCONNY HEIGHT="{$peri_cstk_y_ + $peri_bc_y_}"/>
781 <!-- Return the min of them -->
782 <xsl:value-of select="math:min(exsl:node-set($busConnYs_)/BUSCONNY/@HEIGHT)"/>
786 <xsl:template name="F_Calc_Stack_Height">
787 <xsl:param name="iStackIdx" select="100"/>
790 <xsl:message>Calculating height for Stack Index <xsl:value-of select="$iStackIdx"/></xsl:message>
794 <xsl:variable name="stack_height_">
795 <!-- if this is called with no vert index of a shape
796 it defaults to the total height of the stack -->
797 <xsl:call-template name="F_Calc_Stack_Shape_Y">
798 <xsl:with-param name="iHorizIdx" select="$iStackIdx"/>
803 <xsl:message>Calculated height for Stack as <xsl:value-of select="$stack_height_"/></xsl:message>
805 <xsl:value-of select="$stack_height_"/>
812 <xsl:template name="F_Calc_Stack_Width">
813 <xsl:param name="iStackIdx" select="100"/>
816 <xsl:message>=============Stack Idx <xsl:value-of select="$iStackIdx"/>====</xsl:message>
818 <xsl:variable name="shape_widths_">
820 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[@STACK_HORIZ_INDEX = $iStackIdx])">
824 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE[@STACK_HORIZ_INDEX = $iStackIdx])">
828 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE[(@STACK_HORIZ_INDEX = $iStackIdx)]">
830 <xsl:variable name="proc_w_">
831 <xsl:value-of select="$BLKD_MOD_W"/>
833 <xsl:message>Found processor of width <xsl:value-of select="$proc_w_"/></xsl:message>
835 <SHAPE WIDTH="{$BLKD_MOD_W}"/>
838 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@STACK_HORIZ_INDEX = $iStackIdx)]">
840 <xsl:variable name="shpClass_" select="@MODCLASS"/>
841 <xsl:variable name="shape_w_">
844 <xsl:when test="$shpClass_ = 'PERIPHERAL'">
845 <xsl:value-of select="$BLKD_MOD_W"/>
848 <xsl:when test="$shpClass_ = 'MEMORY_UNIT'">
849 <xsl:value-of select="($BLKD_MOD_W * @MODS_W)"/>
852 <xsl:otherwise>0</xsl:otherwise>
858 <xsl:message>Found shape width <xsl:value-of select="$shape_w_"/></xsl:message>
861 <SHAPE WIDTH="{$shape_w_}"/>
864 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/SBSBUCKETS/SBSBUCKET[(@STACK_HORIZ_INDEX = $iStackIdx)]">
865 <xsl:variable name="bucket_w_">
866 <xsl:value-of select="(($BLKD_MOD_BKTLANE_W * 2) + (($BLKD_MOD_W * @MODS_W) + ($BLKD_MOD_BUCKET_G * (@MODS_W - 1))))"/>
870 <xsl:message>Found bucket of width <xsl:value-of select="$bucket_w_"/></xsl:message>
872 <SHAPE WIDTH="{$bucket_w_}"/>
877 <xsl:value-of select="math:max(exsl:node-set($shape_widths_)/SHAPE/@WIDTH)"/>
881 <xsl:template name="F_Calc_Stack_X">
882 <xsl:param name="iStackIdx" select="0"/>
884 <xsl:message>Looking for stack indexes less than <xsl:value-of select="$iStackIdx"/></xsl:message>
887 <!-- Store the stack widths in a variable -->
888 <xsl:variable name="stackspace_widths_">
890 <xsl:if test="($G_ROOT/EDKSYSTEM/BLKDIAGRAM/@STACK_HORIZ_WIDTH = $iStackIdx)">
891 <STACKSPACE WIDTH="{$BLKD_BUS_LANE_W}"/>
894 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES[(@STACK_HORIZ_INDEX < $iStackIdx)])">
895 <STACKSPACE WIDTH="0"/>
898 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES[(@STACK_HORIZ_INDEX < $iStackIdx)])">
899 <STACKSPACE WIDTH="0"/>
902 <xsl:if test="not($G_ROOT/EDKSYSTEM/SBSBUCKETS/SBSBUCKET[(@STACK_HORIZ_INDEX < $iStackIdx)])">
903 <STACKSPACE WIDTH="0"/>
906 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/BCLANESPACES/BCLANESPACE[(@EAST <= $iStackIdx)]">
909 <xsl:message>==============================</xsl:message>
910 <xsl:message>Found a space of index <xsl:value-of select="@EAST"/></xsl:message>
911 <xsl:message>Bus lane space width <xsl:value-of select="@BUSLANES_W"/></xsl:message>
912 <xsl:message>Bus lane space is <xsl:value-of select="$space_width_"/></xsl:message>
913 <xsl:variable name="space_width_" select="($BLKD_BUS_LANE_W * @BUSLANES_W)"/>
916 <xsl:variable name="East_">
918 <xsl:when test="@EAST"><xsl:value-of select="@EAST"/></xsl:when>
919 <xsl:otherwise>'NONE'</xsl:otherwise>
923 <xsl:variable name="West_">
925 <xsl:when test="@WEST"><xsl:value-of select="@WEST"/></xsl:when>
926 <xsl:otherwise>NONE</xsl:otherwise>
931 <xsl:message>1 - West_ <xsl:value-of select="$West_"/></xsl:message>
932 <xsl:message>1 - East_ <xsl:value-of select="$East_"/></xsl:message>
934 <xsl:variable name="space_width_">
935 <xsl:call-template name="F_Calc_Space_Width">
936 <xsl:with-param name="iStackToWest" select="$West_"/>
937 <xsl:with-param name="iStackToEast" select="$East_"/>
941 <xsl:variable name="stack_width_">
942 <xsl:if test="not(@EAST = $iStackIdx)">
943 <xsl:call-template name="F_Calc_Stack_Width">
944 <xsl:with-param name="iStackIdx" select="@EAST"/>
947 <xsl:if test="(@EAST = $iStackIdx)">0</xsl:if>
950 <xsl:message>Found stack of width <xsl:value-of select="$stack_width_"/></xsl:message>
951 <xsl:message>==============================</xsl:message>
953 <STACKSPACE WIDTH="{$stack_width_ + $space_width_}"/>
957 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/BCLANESPACES/BCLANESPACE[(not(@EAST) and (@WEST = ($iStackIdx -1)))]">
958 <xsl:variable name="space_width_" select="($BLKD_BUS_LANE_W * @BUSLANES_W)"/>
960 <xsl:message>Found end space of <xsl:value-of select="$space_width_"/></xsl:message>
962 <STACKSPACE WIDTH="{$space_width_}"/>
968 <xsl:value-of select="sum(exsl:node-set($stackspace_widths_)/STACKSPACE/@WIDTH)"/>
972 <xsl:template name="F_Calc_Space_Width">
974 <xsl:param name="iStackToWest" select="'NONE'"/>
975 <xsl:param name="iStackToEast" select="'NONE'"/>
978 <xsl:message>Stack to West <xsl:value-of select="$stackToWest"/></xsl:message>
979 <xsl:message>Stack to East <xsl:value-of select="$stackToEast"/></xsl:message>
982 <xsl:variable name="spaceWidth_">
984 <xsl:when test="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/BCLANESPACES/BCLANESPACE[((@EAST = $iStackToEast) or (not($iStackToWest = 'NONE') and (@WEST = $iStackToWest)))]">
985 <xsl:value-of select="((($G_ROOT/EDKSYSTEM/BLKDIAGRAM/BCLANESPACES/BCLANESPACE[((@EAST = $iStackToEast) or (not($iStackToWest = 'NONE') and (@WEST = $iStackToWest)))]/@BUSLANES_W) + 1) * $BLKD_BUS_LANE_W)"/>
987 <xsl:otherwise>0</xsl:otherwise>
992 <xsl:message>Space width <xsl:value-of select="$spaceWidth_"/></xsl:message>
995 <xsl:value-of select="$spaceWidth_"/>
999 <xsl:template name="F_Calc_Space_X">
1001 <xsl:param name="iStackToWest" select="'NONE'"/>
1002 <xsl:param name="iStackToEast" select="'NONE'"/>
1005 <xsl:message>Stack East <xsl:value-of select="$stackToEast"/></xsl:message>
1006 <xsl:message>Stack West <xsl:value-of select="$stackToWest"/></xsl:message>
1009 <!-- Store the stack widths in a variable -->
1012 <xsl:message>Looking for stack indexes less than <xsl:value-of select="$stackIdx"/></xsl:message>
1015 <xsl:variable name="stackspace_widths_">
1017 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES[(@STACK_HORIZ_INDEX < $iStackToEast)])">
1018 <STACKSPACE WIDTH="0"/>
1021 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES[(@STACK_HORIZ_INDEX < $iStackToEast)])">
1022 <STACKSPACE WIDTH="0"/>
1025 <xsl:if test="not($G_ROOT/EDKSYSTEM/SBSBUCKETS/SBSBUCKET[(@STACK_HORIZ_INDEX < $iStackToEast)])">
1026 <STACKSPACE WIDTH="0"/>
1029 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/BCLANESPACES/BCLANESPACE[((@EAST < $iStackToEast) or (not($iStackToWest = 'NONE') and (@EAST <= $iStackToWest)))]">
1032 <xsl:message>==============================</xsl:message>
1033 <xsl:message>Found a space of index <xsl:value-of select="@EAST"/></xsl:message>
1036 <xsl:variable name="East_">
1038 <xsl:when test="@EAST"><xsl:value-of select="@EAST"/></xsl:when>
1039 <xsl:otherwise>'NONE'</xsl:otherwise>
1043 <xsl:variable name="West_">
1045 <xsl:when test="@WEST"><xsl:value-of select="@WEST"/></xsl:when>
1046 <xsl:otherwise>NONE</xsl:otherwise>
1050 <xsl:message>2 - West_ <xsl:value-of select="$West_"/></xsl:message>
1051 <xsl:message>2 - East_ <xsl:value-of select="$East_"/></xsl:message>
1053 <xsl:variable name="space_width_">
1054 <xsl:call-template name="F_Calc_Space_Width">
1055 <xsl:with-param name="iStackToWest" select="$West_"/>
1056 <xsl:with-param name="iStackToEast" select="$East_"/>
1057 </xsl:call-template>
1061 <xsl:variable name="space_width_" select="($BLKD_BUS_LANE_W * @BUSLANES_W)"/>
1062 <xsl:message>Bus lane space width <xsl:value-of select="@BUSLANES_W"/></xsl:message>
1063 <xsl:message>Bus lane space is <xsl:value-of select="$space_width_"/></xsl:message>
1066 <xsl:variable name="stack_width_">
1067 <xsl:call-template name="F_Calc_Stack_Width">
1068 <xsl:with-param name="iStackIdx" select="@EAST"/>
1069 </xsl:call-template>
1073 <xsl:message>Found stack of width <xsl:value-of select="$stack_width_"/></xsl:message>
1074 <xsl:message>==============================</xsl:message>
1077 <STACKSPACE WIDTH="{$stack_width_ + $space_width_}"/>
1081 <xsl:variable name = "stackToWest_W_">
1083 <xsl:when test="(($iStackToEast = '0') and ($iStackToWest = 'NONE'))">0</xsl:when>
1084 <xsl:when test="(($iStackToEast = 'NONE') and not($iStackToWest = 'NONE'))">
1085 <xsl:call-template name="F_Calc_Stack_Width">
1086 <xsl:with-param name="iStackIdx" select="$iStackToWest"/>
1087 </xsl:call-template>
1089 <xsl:when test="(not($iStackToEast = '0') and ($iStackToWest = 'NONE'))">
1090 <xsl:call-template name="F_Calc_Stack_Width">
1091 <xsl:with-param name="iStackIdx" select="($iStackToEast - 1)"/>
1092 </xsl:call-template>
1094 <xsl:otherwise>0</xsl:otherwise>
1099 <xsl:variable name = "stackToEast_W_">
1100 <xsl:call-template name="F_Calc_Stack_Width">
1101 <xsl:with-param name="stackIdx" select="$stackToEast"/>
1102 </xsl:call-template>
1104 <xsl:variable name ="extSpaceEast_W_" select="ceiling($stackToEast_W_ div 2)"/>
1107 <xsl:variable name ="extSpaceWest_W_" select="ceiling($stackToWest_W_ div 2)"/>
1109 <xsl:value-of select="sum(exsl:node-set($stackspace_widths_)/STACKSPACE/@WIDTH) - $extSpaceWest_W_"/>