1 <?xml version="1.0" standalone="no"?>
3 <xsl:stylesheet version="1.0"
4 xmlns:svg="http://www.w3.org/2000/svg"
5 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6 xmlns:math="http://exslt.org/math"
7 xmlns:exsl="http://exslt.org/common"
8 xmlns:xlink="http://www.w3.org/1999/xlink"
9 extension-element-prefixes="math">
11 <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"
12 doctype-public="-//W3C//DTD SVG 1.0//EN"
13 doctype-system="http://www.w3.org/TR/SVG/DTD/svg10.dtd"/>
16 <xsl:variable name="INF_H" select="$BIF_H + ceiling($BIF_H div 2)"/>
17 <xsl:variable name="INF_W" select="($BIF_W * 2) + $BIF_GAP"/>
21 <!-- ======================= DEF FUNCTIONS =================================== -->
23 <xsl:template name="Define_FreeCmplxModules">
25 <xsl:for-each select="BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@IS_PROMOTED and not(@IS_PENALIZED) and not(@STACK_INDEX))]">
27 <xsl:variable name="cmplxId_" select="position()"/>
29 <xsl:if test="@MODCLASS='MEMORY_UNIT'">
30 <xsl:call-template name="Define_PeripheralMemory">
31 <xsl:with-param name="periId" select="$cmplxId_"/>
35 <xsl:if test="((@MODCLASS='MASTER_SLAVE') or (@MODCLASS = 'MONITOR'))">
36 <xsl:variable name="modInst_" select="MODULE/@INSTANCE"/>
37 <xsl:variable name="modType_" select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$modInst_)]/@MODTYPE"/>
38 <xsl:call-template name="Define_Peripheral">
39 <xsl:with-param name="modInst" select="$modInst_"/>
40 <xsl:with-param name="modType" select="$modType_"/>
48 <xsl:template name="Define_PenalizedModules">
50 <xsl:for-each select="BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@IS_PROMOTED and @IS_PENALIZED)]">
52 <xsl:variable name="penalId_">unkmodule_<xsl:value-of select="@BKTROW"/>_<xsl:value-of select="@MODS_X"/></xsl:variable>
55 <xsl:message>Drawing penalized module <xsl:value-of select="$penalId_"/></xsl:message>
58 <xsl:if test="@MODCLASS='MEMORY_UNIT'">
59 <xsl:call-template name="Define_PeripheralMemory">
60 <xsl:with-param name="periId" select="$penalId_"/>
65 <xsl:if test="((@MODCLASS='MASTER_SLAVE') or (@MODCLASS = 'MONITOR'))">
67 <xsl:variable name="modInst_" select="MODULE/@INSTANCE"/>
68 <xsl:variable name="modType_" select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $modInst_)]/@MODTYPE"/>
69 <xsl:call-template name="Define_Peripheral">
70 <xsl:with-param name="modInst" select="$modInst_"/>
71 <xsl:with-param name="modType" select="$modType_"/>
72 <xsl:with-param name="unkInst" select="$penalId_"/>
82 <xsl:template name="Define_IPBucket">
84 <xsl:for-each select="BLKDSHAPES/IPBUCKET">
86 <xsl:for-each select="MODULE">
88 <xsl:call-template name="Define_IPBucketModule">
89 <xsl:with-param name="ip_type" select="@MODTYPE"/>
90 <xsl:with-param name="ip_name" select="@INSTANCE"/>
95 <symbol id="ipbucket">
96 <xsl:variable name="bucket_w_" select="(($MOD_BKTLANE_W * 2) + (($periMOD_W * @MODS_W) + ($MOD_BUCKET_G * (@MODS_W - 1))))"/>
97 <xsl:variable name="bucket_h_" select="(($MOD_BKTLANE_H * 2) + (($periMOD_H * @MODS_H) + ($MOD_BUCKET_G * (@MODS_H - 1))))"/>
103 width= "{$bucket_w_}"
104 height="{$bucket_h_}"
105 style="stroke-width:2; stroke:{$COL_BLACK}; fill:{$COL_IORING_LT}"/>
107 <xsl:variable name="bkt_mods_w_" select="@MODS_W"/>
109 <xsl:for-each select="MODULE">
111 <xsl:variable name="clm_" select="(( position() - 1) mod $bkt_mods_w_)"/>
112 <xsl:variable name="row_" select="floor((position() - 1) div $bkt_mods_w_)"/>
114 <xsl:variable name="bk_x_" select="$MOD_BKTLANE_W + ($clm_ * ($periMOD_W + $MOD_BUCKET_G))"/>
115 <xsl:variable name="bk_y_" select="$MOD_BKTLANE_H + ($row_ * ($periMOD_H + $MOD_BUCKET_G))"/>
120 xlink:href="#ipbktmodule_{@INSTANCE}"/>
131 <xsl:template name="Define_UNKBucket">
133 <xsl:for-each select="BLKDSHAPES/UNKBUCKET">
135 <symbol id="unkbucket">
136 <xsl:variable name="bucket_w_" select="(($MOD_BKTLANE_W * 2) + (($periMOD_W * @MODS_W) + ($MOD_BUCKET_G * (@MODS_W - 1))))"/>
137 <xsl:variable name="bucket_h_" select="(($MOD_BKTLANE_H * 2) + (($periMOD_H * @MODS_H) + ($MOD_BUCKET_G * (@MODS_H - 1))))"/>
143 width= "{$bucket_w_}"
144 height="{$bucket_h_}"
145 style="stroke-width:2; stroke:{$COL_BLACK}; fill:{$COL_UNK_BG}"/>
147 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@IS_PROMOTED and @IS_PENALIZED)]">
149 <xsl:variable name="bkt_mods_w_" select="@MODS_W"/>
151 <xsl:variable name="mod_row_" select="@BKTROW"/>
152 <xsl:variable name="row_mods_h_" select="/EDKSYSTEM/BLKDSHAPES/UNKBUCKET/BKTROW[(@INDEX = $mod_row_)]/@MODS_H"/>
155 <xsl:message>The row module is <xsl:value-of select="@BKTROW"/></xsl:message>
156 <xsl:message>The height of the module is <xsl:value-of select="$row_mods_h_"/></xsl:message>
160 <xsl:variable name="bk_x_" select="$MOD_BKTLANE_W + (@MODS_X * ($periMOD_W + $MOD_BUCKET_G))"/>
161 <xsl:variable name="bk_y_" select="$MOD_BKTLANE_H + ($row_mods_h_ * ($periMOD_H + $MOD_BUCKET_G))"/>
165 xlink:href="#symbol_unkmodule_{@BKTROW}_{@MODS_X}"/>
178 <xsl:template name="Define_SBSBuckets">
180 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/SBSBUCKETS/SBSBUCKET">
182 <xsl:variable name="bus_name_" select="@BUSNAME"/>
183 <xsl:variable name="bus_std_" select="@BUSSTD"/>
185 <xsl:variable name="bus_std_" select="BUSCONNS/BUSCONN/@BUSSTD"/>
187 <xsl:variable name="bus_conn_w_" select="BUSCONNS/@BUSLANE_W"/>
189 <xsl:variable name="bucket_bg_col_">
190 <xsl:call-template name="BusType2LightColor">
191 <xsl:with-param name="busType" select="$bus_std_"/>
195 <xsl:variable name="bucket_col_">
196 <xsl:call-template name="BusType2Color">
197 <xsl:with-param name="busType" select="$bus_std_"/>
202 <xsl:for-each select="MODULE">
204 <xsl:sort data-type="text" select="@INSTANCE" order="ascending"/>
206 <xsl:call-template name="Define_SBSBucketModule">
207 <xsl:with-param name="bif_type" select="$bus_std_"/>
208 <xsl:with-param name="ip_type" select="@MODTYPE"/>
209 <xsl:with-param name="ip_name" select="@INSTANCE"/>
214 <symbol id="sbsbucket_{$bus_name_}">
215 <xsl:variable name="bucket_w_" select="(($MOD_BKTLANE_W * 2) + (($periMOD_W * @MODS_W) + ($MOD_BUCKET_G * (@MODS_W - 1))))"/>
216 <xsl:variable name="bucket_h_" select="(($MOD_BKTLANE_H * 2) + ((($periMOD_H + $BIFC_H) * @MODS_H) + ($MOD_BUCKET_G * (@MODS_H - 1))))"/>
222 width= "{$bucket_w_}"
223 height="{$bucket_h_}"
224 style="stroke-width:2; stroke:{$bucket_col_}; fill:{$bucket_bg_col_}"/>
228 <xsl:variable name="bkt_mods_w_" select="@MODS_W"/>
230 <xsl:for-each select="MODULE">
232 <xsl:sort data-type="text" select="@INSTANCE" order="ascending"/>
234 <xsl:variable name="clm_" select="(( position() - 1) mod $bkt_mods_w_)"/>
235 <xsl:variable name="row_" select="floor((position() - 1) div $bkt_mods_w_)"/>
237 <xsl:variable name="bk_x_" select="$MOD_BKTLANE_W + ($clm_ * ($periMOD_W + $MOD_BUCKET_G))"/>
238 <xsl:variable name="bk_y_" select="$MOD_BKTLANE_H + ($row_ * ($periMOD_H + $BIFC_H + $MOD_BUCKET_G))"/>
240 <!-- Lay out the module in the bucket -->
241 <use x="{$bk_x_}" y="{$bk_y_}" xlink:href="#sbsbktmodule_{@INSTANCE}"/>
243 <!-- Add its connection to the piece shared bus -->
244 <xsl:variable name="h_bus_y_" select="$bk_y_ + ceiling($BIFC_H div 2) - ceiling($P2P_BUS_W div 2)"/>
247 <xsl:variable name="h_bus_x_" select="$bk_x_ - ($MOD_BUCKET_G + ceiling($periMOD_W div 2))"/>
249 <xsl:variable name="h_bus_x_">
251 <xsl:when test="($clm_ = '0')">0</xsl:when>
253 <xsl:when test="not($clm_ = '0')">
254 <xsl:value-of select="$bk_x_ - ($MOD_BUCKET_G + ceiling($periMOD_W div 2))"/>
260 <xsl:variable name="h_bus_y_" select="$bk_y_ + ceiling($BIFC_H div 2) - ceiling($P2P_BUS_W)"/>
261 <xsl:message>h bus x <xsl:value-of select="$h_bus_x_"/></xsl:message>
262 <xsl:message>h bus y <xsl:value-of select="$h_bus_y_"/></xsl:message>
264 <xsl:variable name="h_bus_height_" select="$P2P_BUS_W"/>
265 <xsl:variable name="h_bus_width_" select="($bk_x_ - $h_bus_x_ + ceiling($periMOD_W div 2))"/>
267 <rect x="{$h_bus_x_}"
269 width= "{$h_bus_width_}"
270 height="{$P2P_BUS_W}"
271 style="fill:{$bucket_col_}"/>
275 <xsl:variable name="num_sbsbktmods_" select="count(MODULE)"/>
276 <xsl:variable name="num_sbsbktrows_" select="ceiling($num_sbsbktmods_ div $BKT_MODS_PER_ROW)"/>
278 <!-- If there is more than one row, connect the rows with a vertical bar -->
279 <xsl:if test="($num_sbsbktrows_ > 1)">
281 <xsl:variable name="v_bus_x_" select="$MOD_BKTLANE_W + ($periMOD_W + $MOD_BUCKET_G)"/>
283 <xsl:variable name="bkt_top_" select="$MOD_BKTLANE_H + (0 * ($periMOD_H + $BIFC_H + $MOD_BUCKET_G))"/>
284 <xsl:variable name="bkt_bot_" select="$MOD_BKTLANE_H + (($num_sbsbktrows_ - 1) * ($periMOD_H + $BIFC_H + $MOD_BUCKET_G))"/>
286 <xsl:variable name="v_bus_y_top_" select="$bkt_top_ + ceiling($BIFC_H div 2) - ceiling($P2P_BUS_W div 2)"/>
287 <xsl:variable name="v_bus_y_bot_" select="$bkt_bot_ + ceiling($BIFC_H div 2) - ceiling($P2P_BUS_W div 2)"/>
289 <xsl:variable name="v_bus_width_" select="$P2P_BUS_W"/>
290 <xsl:variable name="v_bus_height_" select="($v_bus_y_bot_ - $v_bus_y_top_)"/>
293 width= "{$v_bus_width_}"
294 height="{$v_bus_height_}"
295 style="fill:{$bucket_col_}"/>
305 <!-- ======================= END DEF BLOCK ============================ -->
306 <xsl:template name="Define_SBSBucketModule">
308 <xsl:param name="bif_type" select="'OPB'"/>
309 <xsl:param name="ip_name" select="'ip_type'"/>
310 <xsl:param name="ip_type" select="'ip_name'"/>
312 <xsl:message>The bif type is <xsl:value-of select="$bif_type"/> </xsl:message>
316 <xsl:variable name="bif_y_">
317 <xsl:value-of select="$MOD_LANE_H + $BIFC_H"/>
320 <xsl:variable name="label_y_">
321 <xsl:value-of select="$MOD_LANE_H + $BIF_H + $BIFC_H + $MOD_BIF_GAP_V"/>
325 <symbol id="sbsbktmodule_{$ip_name}">
331 width = "{$periMOD_W}"
332 height= "{$periMOD_H}"
333 style="fill:{$COL_BG}; stroke:{$COL_WHITE}; stroke-width:2"/>
335 <rect x="{ceiling($periMOD_W div 2) - ceiling($MOD_LABEL_W div 2)}"
339 width= "{$MOD_LABEL_W}"
340 height="{$MOD_LABEL_H}"
341 style="fill:{$COL_WHITE}; stroke:none;"/>
345 <xsl:if test="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$ip_name)]/@GROUP">
347 <rect x="{ceiling($periMOD_W div 2) - ceiling($MOD_LABEL_W div 2)}"
348 y="{$label_y_ + $BIF_H + ceiling($BIF_H div 3) - 2}"
351 width= "{$MOD_LABEL_W}"
353 style="fill:{$COL_IORING_LT}; stroke:none;"/>
356 <text class="ioplblgrp"
357 x="{ceiling($periMOD_W div 2)}"
358 y="{$label_y_ + $BIF_H + ceiling($BIF_H div 3) + 12}">
359 <xsl:value-of select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$ip_name)]/@GROUP"/>
364 <text class="bciptype"
365 x="{ceiling($periMOD_W div 2)}"
367 <xsl:value-of select="$ip_type"/>
370 <text class="bciplabel"
371 x="{ceiling($periMOD_W div 2)}"
372 y="{$label_y_ + 16}">
373 <xsl:value-of select="$ip_name"/>
376 <xsl:for-each select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $ip_name)]/BUSINTERFACE[not(@BUSNAME = '__NOC__')]">
378 <xsl:variable name="bif_busstd_">
380 <xsl:when test="@BUSSTD">
381 <xsl:value-of select="@BUSSTD"/>
384 <xsl:value-of select="'TRS'"/>
389 <xsl:variable name="bif_name_">
391 <xsl:when test="string-length(@NAME) <= 5">
392 <xsl:value-of select="@NAME"/>
395 <xsl:value-of select="substring(@NAME,0,5)"/>
400 <xsl:variable name="bif_x_" select="ceiling($periMOD_W div 2) - ceiling($BIF_W div 2)"/>
402 <!-- Draw the BIF -->
403 <use x="{$bif_x_}" y="{$bif_y_}" xlink:href="#{$bif_busstd_}_Bif"/>
406 <symbol id="{$bus_type}_busconn_SLAVE">
409 <!-- Draw the BIF connection -->
410 <use x="{$bif_x_ + ceiling($BIF_W div 2) - ceiling($BIFC_W div 2)}" y="{$bif_y_ - $BIFC_H - $MOD_LANE_H}" xlink:href="#{$bif_busstd_}_busconn_{@BIFRANK}"/>
412 <text class="biflabel"
413 x="{$bif_x_ + ceiling($BIF_W div 2)}"
414 y="{$bif_y_ + ceiling($BIF_H div 2) + 3}">
415 <xsl:value-of select="$bif_name_"/>
420 <xsl:if test="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$ip_name)]/@INTCINDEX">
421 <xsl:variable name="intr_col_">
422 <xsl:call-template name="intcIdx2Color">
423 <xsl:with-param name="intcIdx" select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$ip_name)]/@INTCINDEX"/>
427 <xsl:call-template name="_draw_InterruptCntrl">
428 <xsl:with-param name="intr_col" select="$intr_col_"/>
429 <xsl:with-param name="intr_x" select="($periMOD_W - ceiling($INTR_W div 2))"/>
430 <xsl:with-param name="intr_y" select="3 + $BIFC_H"/>
431 <xsl:with-param name="intr_idx" select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$ip_name)]/@INTCINDEX"/>
436 <xsl:for-each select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$ip_name)]/INTCCNTLRTRGS/INTCTRG">
437 <xsl:variable name="intr_col_">
438 <xsl:call-template name="intcIdx2Color">
439 <xsl:with-param name="intcIdx" select="@INTCINDEX"/>
443 <xsl:call-template name="_draw_InterruptSource">
444 <xsl:with-param name="intr_col" select="$intr_col_"/>
445 <xsl:with-param name="intr_x" select="($periMOD_W - $INTR_W)"/>
446 <xsl:with-param name="intr_y" select="((position() - 1) * (ceiling($INTR_H div 2) + 3)) + $BIFC_H"/>
447 <xsl:with-param name="intr_pri" select="@PRIORITY"/>
448 <xsl:with-param name="intr_idx" select="@INTCINDEX"/>
457 <xsl:template name="Define_IPBucketModule">
459 <xsl:param name="ip_name" select="'ip_type'"/>
460 <xsl:param name="ip_type" select="'ip_name'"/>
462 <xsl:variable name="bif_y_">
463 <xsl:value-of select="$MOD_LANE_H"/>
466 <xsl:variable name="label_y_">
467 <xsl:value-of select="(ceiling($periMOD_H div 2) - ceiling($MOD_LABEL_H div 2))"/>
470 <symbol id="ipbktmodule_{$ip_name}">
476 width = "{$periMOD_W}"
477 height= "{$periMOD_H}"
478 style="fill:{$COL_BG}; stroke:{$COL_BLACK}; stroke-width:2"/>
480 <rect x="{ceiling($periMOD_W div 2) - ceiling($MOD_LABEL_W div 2)}"
484 width= "{$MOD_LABEL_W}"
485 height="{$MOD_LABEL_H}"
486 style="fill:{$COL_WHITE}; stroke:none;"/>
489 y="{$label_y_ + ceiling($MOD_LABEL_H div 2) - 4}"
490 y="{$label_y_ + ceiling($MOD_LABEL_H div 2) + 4}"
493 <text class="bciptype"
494 x="{ceiling($periMOD_W div 2)}"
496 <xsl:value-of select="$ip_type"/>
499 <text class="bciplabel"
500 x="{ceiling($periMOD_W div 2)}"
501 y="{$label_y_ + 16}">
502 <xsl:value-of select="$ip_name"/>
505 <xsl:if test="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $ip_name)]/@GROUP">
507 <rect x="{ceiling($periMOD_W div 2) - ceiling($MOD_LABEL_W div 2)}"
508 y="{$label_y_ + $BIF_H + ceiling($BIF_H div 3) - 2}"
511 width= "{$MOD_LABEL_W}"
513 style="fill:{$COL_IORING_LT}; stroke:none;"/>
516 <text class="ioplblgrp"
517 x="{ceiling($periMOD_W div 2)}"
518 y="{$label_y_ + $BIF_H + ceiling($BIF_H div 3) + 12}">
519 <xsl:value-of select="/EDKSYSTEM/MODULES/MODULE[@INSTANCE=$ip_name]/@GROUP"/>
524 <xsl:for-each select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$ip_name)]/INTCCNTLRTRGS/INTCTRG">
526 <xsl:variable name="intr_col_">
527 <xsl:call-template name="intcIdx2Color">
528 <xsl:with-param name="intcIdx" select="@INTCINDEX"/>
532 <xsl:call-template name="_draw_InterruptSource">
533 <xsl:with-param name="intr_col" select="$intr_col_"/>
534 <xsl:with-param name="intr_x" select="($periMOD_W - $INTR_W)"/>
535 <xsl:with-param name="intr_y" select="((position() - 1) * (ceiling($INTR_H div 2) + 3))"/>
536 <xsl:with-param name="intr_pri" select="@PRIORITY"/>
537 <xsl:with-param name="intr_idx" select="@INTCINDEX"/>
547 <xsl:template name="Define_Peripheral">
549 <!-- when the module is oriented normal its label goes above the bifs -->
550 <!-- when the module is oriented rot180, (part of a processor memory controller for example) its label goes below the bifs -->
552 <xsl:param name="modVori" select="'normal'"/>
553 <xsl:param name="modInst" select="'_instance_'"/>
554 <xsl:param name="modType" select="'_modtype_'"/>
555 <xsl:param name="unkInst" select="'_unknown_'"/>
556 <xsl:param name="horizIdx" select="'_unknown_'"/>
557 <xsl:param name="vertiIdx" select="'_unknown_'"/>
560 <xsl:message>Stack Index Y <xsl:value-of select="$cstkIndex"/></xsl:message>
561 <xsl:message>Stack Y <xsl:value-of select="$cstkMods_Y"/></xsl:message>
564 <xsl:variable name="modName_">
566 <xsl:when test="$unkInst = '_unknown_'">
567 <xsl:value-of select="$modInst"/>
570 <xsl:value-of select="$unkInst"/>
575 <xsl:variable name="modSymbolName_">
577 <xsl:when test="(not($horizIdx = '_unknown_') and not($vertiIdx = '_unknown_'))">
578 <xsl:call-template name="_gen_Stack_SymbolName">
579 <xsl:with-param name="horizIdx" select="$horizIdx"/>
580 <xsl:with-param name="vertiIdx" select="$vertiIdx"/>
583 <xsl:otherwise>symbol_<xsl:value-of select="$modName_"/></xsl:otherwise>
587 <xsl:variable name="modTypeName_" select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $modInst)]/@MODTYPE"/>
591 <xsl:message>The symbol type of the module is <xsl:value-of select="$modTypeName_"/></xsl:message>
592 <xsl:message>The symbol name of the module is <xsl:value-of select="$modSymbolName_"/></xsl:message>
595 <xsl:variable name="bifs_h_">
596 <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE/MODULE[(@INSTANCE = $modInst)]/@BIFS_H) and not(/EDKSYSTEM/BLKDSHAPES/BRIDGESHAPES/MODULE[(@INSTANCE = $modInst)]/@BIFS_H)">0</xsl:if>
598 <xsl:if test="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE/MODULE[(@INSTANCE = $modInst)]/@BIFS_H)">
599 <xsl:value-of select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE/MODULE[(@INSTANCE = $modInst)]/@BIFS_H"/>
602 <xsl:if test="(/EDKSYSTEM/BLKDSHAPES/BRIDGESHAPES/MODULE[(@INSTANCE = $modInst)]/@BIFS_H)">
603 <xsl:value-of select="/EDKSYSTEM/BLKDSHAPES/BRIDGESHAPES/MODULE[(@INSTANCE = $modInst)]/@BIFS_H"/>
607 <xsl:variable name="label_y_">
609 <xsl:when test="$modVori = 'rot180'">
610 <xsl:value-of select="($MOD_LANE_H + (($BIF_H + $MOD_BIF_GAP_V) * $bifs_h_))"/>
613 <xsl:value-of select="$MOD_LANE_H"/>
618 <xsl:variable name="bif_dy_">
620 <xsl:when test="$modVori = 'rot180'">
621 <xsl:value-of select="$MOD_LANE_H"/>
624 <xsl:value-of select="($MOD_LANE_H + $MOD_LABEL_H + $MOD_BIF_GAP_V)"/>
629 <xsl:variable name="peri_stroke_col_">
631 <xsl:when test="((@MODCLASS = 'MASTER_SLAVE') or (@MODCLASS = 'MONITOR')) and BUSCONNS/BUSCONN">
632 <xsl:call-template name="BusType2Color">
633 <xsl:with-param name="busType" select="BUSCONNS/BUSCONN/@BUSSTD"/>
638 <xsl:value-of select="$COL_WHITE"/>
643 <xsl:variable name="modHeight_">
644 <xsl:call-template name="_calc_PeriShape_Height">
645 <xsl:with-param name="shapeInst" select="$modName_"/>
649 <symbol id="{$modSymbolName_}">
651 <xsl:if test="$modTypeName_ = 'mpmc'">
656 width = "{$periMOD_W}"
657 height= "{$modHeight_}"
658 style="fill:#669900; stroke:{$peri_stroke_col_}; stroke-width:2"/>
661 <xsl:if test="not($modTypeName_ = 'mpmc')">
666 width = "{$periMOD_W}"
667 height= "{$modHeight_}"
668 style="fill:{$COL_BG}; stroke:{$peri_stroke_col_}; stroke-width:2"/>
672 <rect x="{ceiling($periMOD_W div 2) - ceiling($MOD_LABEL_W div 2)}"
676 width= "{$MOD_LABEL_W}"
677 height="{$MOD_LABEL_H}"
678 style="fill:{$COL_WHITE}; stroke:none;"/>
681 y="{$label_y_ + ceiling($MOD_LABEL_H div 2) - 4}">
682 y="{$label_y_ + ceiling($MOD_LABEL_H div 2) + 4}">
685 <text class="bciptype"
686 x="{ceiling($periMOD_W div 2)}"
688 <xsl:value-of select="$modType"/>
691 <text class="bciplabel"
692 x="{ceiling($periMOD_W div 2)}"
693 y="{$label_y_ + 16}">
694 <xsl:value-of select="$modInst"/>
697 <xsl:if test="/EDKSYSTEM/MODULES/MODULE[@INSTANCE=$modInst]/@GROUP">
699 <rect x="{ceiling($periMOD_W div 2) - ceiling($MOD_LABEL_W div 2)}"
700 y="{$label_y_ + $BIF_H + ceiling($BIF_H div 3) - 2}"
703 width= "{$MOD_LABEL_W}"
705 style="fill:{$COL_IORING_LT}; stroke:none;"/>
707 <text class="ioplblgrp"
708 x="{ceiling($periMOD_W div 2)}"
709 y="{$label_y_ + $BIF_H + ceiling($BIF_H div 3) + 12}">
710 <xsl:value-of select="/EDKSYSTEM/MODULES/MODULE[@INSTANCE=$modInst]/@GROUP"/>
715 <xsl:for-each select="/EDKSYSTEM/MODULES/MODULE[@INSTANCE=$modInst]/BUSINTERFACE[(@BIF_X and @BIF_Y and not(@BUSNAME = '__NOC__'))]">
717 <xsl:variable name="bif_busstd_">
719 <xsl:when test="@BUSSTD">
720 <xsl:value-of select="@BUSSTD"/>
723 <xsl:value-of select="'TRS'"/>
728 <xsl:variable name="bif_y_">
729 <xsl:value-of select="(($BIF_H + $MOD_BIF_GAP_V) * @BIF_Y)"/>
732 <xsl:variable name="bif_buscol_">
733 <xsl:call-template name="BusType2Color">
734 <xsl:with-param name="busType" select="$bif_busstd_"/>
739 <xsl:variable name="bif_name_">
741 <xsl:when test="not(@NAME)">'UNK'</xsl:when>
742 <xsl:when test="string-length(@NAME) <= 5">
743 <xsl:value-of select="@NAME"/>
746 <xsl:value-of select="substring(@NAME,0,5)"/>
751 <xsl:variable name="bif_x_" >
752 <xsl:if test="not(@ORIENTED='CENTER')">
753 <xsl:value-of select="(($BIF_W * @BIF_X) + ($MOD_BIF_GAP_H * @BIF_X) + ($MOD_LANE_W * 1))"/>
755 <xsl:if test="(@ORIENTED='CENTER')">
756 <xsl:value-of select="ceiling($periMOD_W div 2) - ceiling($BIF_W div 2)"/>
760 <xsl:if test="not(@IS_INTCONN)">
761 <xsl:variable name="horz_line_y_" select="($bif_y_ + $bif_dy_ + ceiling($BIFC_H div 2))"/>
763 <xsl:variable name="horz_line_x1_">
765 <xsl:when test="@BIF_X = '0'">0</xsl:when>
766 <xsl:otherwise><xsl:value-of select="($periMOD_W - $MOD_LANE_W)"/></xsl:otherwise>
770 <xsl:variable name="horz_line_x2_">
772 <xsl:when test="@BIF_X = '0'"><xsl:value-of select="$MOD_LANE_W"/></xsl:when>
773 <xsl:otherwise><xsl:value-of select="$periMOD_W + 1"/></xsl:otherwise>
778 <line x1="{$horz_line_x1_}"
779 y1="{$horz_line_y_ - 2}"
780 x2="{$horz_line_x2_}"
781 y2="{$horz_line_y_ - 2}"
782 style="stroke:{$bif_buscol_};stroke-width:1"/>
786 <use x="{$bif_x_}" y="{$bif_y_ + $bif_dy_}" xlink:href="#{$bif_busstd_}_Bif"/>
789 <text class="biflabel"
790 x="{$bif_x_ + ceiling($BIF_W div 2)}"
791 y="{$bif_y_ + $bif_dy_ + ceiling($BIF_H div 2) + 3}">
792 <xsl:value-of select="$bif_name_"/>
798 <xsl:if test="@INTCINDEX">
799 <xsl:variable name="intr_col_">
800 <xsl:call-template name="intcIdx2Color">
801 <xsl:with-param name="intcIdx" select="@INTCINDEX"/>
805 <xsl:call-template name="_draw_InterruptCntrl">
806 <xsl:with-param name="intr_col" select="$intr_col_"/>
807 <xsl:with-param name="intr_x" select="($periMOD_W - ceiling($INTR_W div 2))"/>
808 <xsl:with-param name="intr_y" select="3"/>
809 <xsl:with-param name="intr_idx" select="@INTCINDEX"/>
813 <xsl:if test="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $modInst)]/@INTCINDEX">
814 <xsl:variable name="intr_col_">
815 <xsl:call-template name="intcIdx2Color">
816 <xsl:with-param name="intcIdx" select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $modInst)]/@INTCINDEX"/>
820 <xsl:call-template name="_draw_InterruptCntrl">
821 <xsl:with-param name="intr_col" select="$intr_col_"/>
822 <xsl:with-param name="intr_x" select="($periMOD_W - ceiling($INTR_W div 2))"/>
823 <xsl:with-param name="intr_y" select="3"/>
824 <xsl:with-param name="intr_idx" select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $modInst)]/@INTCINDEX"/>
829 <xsl:for-each select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $modInst)]/INTCCNTLRTRGS/INTCTRG">
831 <xsl:variable name="intr_col_">
832 <xsl:call-template name="intcIdx2Color">
833 <xsl:with-param name="intcIdx" select="@INTCINDEX"/>
837 <xsl:call-template name="_draw_InterruptSource">
838 <xsl:with-param name="intr_col" select="$intr_col_"/>
839 <xsl:with-param name="intr_x" select="($periMOD_W - $INTR_W)"/>
840 <xsl:with-param name="intr_y" select="((position() - 1) * (ceiling($INTR_H div 2) + 3))"/>
841 <xsl:with-param name="intr_pri" select="@PRIORITY"/>
842 <xsl:with-param name="intr_idx" select="@INTCINDEX"/>
850 <xsl:template name="Define_MemoryUnit">
851 <xsl:param name="shapeId" select="1000"/>
853 <xsl:variable name="horiz_idx_" select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]/@STACK_HORIZ_INDEX"/>
854 <xsl:variable name="is_multistk_" select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]/@IS_MULTISTK"/>
858 <xsl:when test="(($is_multistk_ = 'TRUE') or (/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[(@STACK_HORIZ_INDEX = $horiz_idx_)]))">
859 <xsl:call-template name="Define_Processor_MemoryUnit">
860 <xsl:with-param name="shapeId" select="$shapeId"/>
865 <xsl:call-template name="Define_StandAlone_MemoryUnit">
866 <xsl:with-param name="shapeId" select="$shapeId"/>
875 <xsl:template name="Define_Processor_MemoryUnit">
876 <xsl:param name="shapeId" select="1000"/>
879 <xsl:param name="cstkIndex" select="'_processor_'"/>
881 <xsl:variable name="mods_h_" select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]/@MODS_H"/>
882 <xsl:variable name="mods_w_" select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]/@MODS_W"/>
883 <xsl:variable name="memW_" select="($periMOD_W * $mods_w_)"/>
884 <xsl:variable name="memH_" select="($periMOD_H * $mods_h_)"/>
886 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]">
889 <!-- first define its symbols as individual modules -->
890 <xsl:for-each select="MODULE[@MODCLASS='MEMORY']">
891 <xsl:variable name="modInst_" select="@INSTANCE"/>
892 <xsl:variable name="modType_" select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$modInst_)]/@MODTYPE"/>
894 <xsl:call-template name="Define_Peripheral">
895 <xsl:with-param name="modVori" select="'normal'"/>
896 <xsl:with-param name="modInst" select="$modInst_"/>
897 <xsl:with-param name="modType" select="$modType_"/>
901 <xsl:for-each select="MODULE[@MODCLASS='MEMORY_CNTLR']">
902 <xsl:variable name="modInst_" select="@INSTANCE"/>
903 <xsl:variable name="modType_" select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$modInst_)]/@MODTYPE"/>
905 <xsl:call-template name="Define_Peripheral">
906 <xsl:with-param name="modVori" select="'rot180'"/>
907 <xsl:with-param name="modInst" select="$modInst_"/>
908 <xsl:with-param name="modType" select="$modType_"/>
916 <xsl:variable name="symbol_name_">
917 <xsl:call-template name="_gen_Stack_SymbolName">
918 <xsl:with-param name="horizIdx" select="@STACK_HORIZ_INDEX"/>
919 <xsl:with-param name="vertiIdx" select="@SHAPE_VERTI_INDEX"/>
924 <xsl:message>The mp stack name is <xsl:value-of select="$mp_stack_name_"/></xsl:message>
927 <symbol id="{$symbol_name_}">
935 style="fill:{$COL_BG}; stroke:{$COL_WHITE}; stroke-width:2"/>
937 <!-- Draw the memory block-->
938 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]/MODULE[(@MODCLASS = 'MEMORY')]">
940 <xsl:variable name="modInst_" select="@INSTANCE"/>
942 <use x="{ceiling($memW_ div 2) - ($periMOD_W div 2)}"
944 xlink:href="#symbol_{$modInst_}"/>
947 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]/MODULE[((@MODCLASS='MEMORY_CNTLR') and (@ORIENTED = 'WEST'))]">
948 <xsl:variable name="modInst_" select="@INSTANCE"/>
952 xlink:href="#symbol_{$modInst_}"/>
955 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]/MODULE[((@MODCLASS='MEMORY_CNTLR') and (@ORIENTED = 'EAST'))]">
956 <xsl:variable name="modInst_" select="@INSTANCE"/>
958 <use x="{$periMOD_W}"
960 xlink:href="#symbol_{$modInst_}"/>
963 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]/MODULE[((@MODCLASS='MEMORY_CNTLR') and (@ORIENTED = 'CENTER'))]">
964 <xsl:variable name="modInst_" select="@INSTANCE"/>
966 <use x="{ceiling($memW_ div 2) - ($periMOD_W div 2)}"
968 xlink:href="#symbol_{$modInst_}"/>
976 <xsl:template name="Define_StandAlone_MemoryUnit">
978 <xsl:param name="shapeId" select="0"/>
980 <xsl:variable name="mods_h_" select="@MODS_H"/>
981 <xsl:variable name="mods_w_" select="@MODS_W"/>
983 <xsl:variable name="memc_name_" select="MODULE[not(@MODCLASS = 'MEMORY')]/@INSTANCE"/>
984 <xsl:variable name="memc_busstd_" select="/EDKSYSTEM/BLKDSHAPES/BCLANESPACES/BCLANESPACE/BUSCONNLANE[(BUSCONN[(@INSTANCE = $memc_name_)])]/@BUSSTD"/>
987 <xsl:variable name="memc_busstd_" select="/EDKSYSTEM/BLKDSHAPES/BCLANESPACES/BCLANESPACE/BUSCONNLANE/@BUSSTD"/>
988 <xsl:variable name="memc_busstd_" select="/EDKSYSTEM/BCLANESPACES/BCLANESPACE/BUSCONNLANE[(BUSCONN[(@INSTANCE)])]/@BUSSTD"/>
989 <xsl:message>Memory cntlr name <xsl:value-of select="$memc_name_"/></xsl:message>
990 <xsl:message>Memory cntlr name <xsl:value-of select="$memc_name_"/></xsl:message>
991 <xsl:message>Memory cntlr busstd <xsl:value-of select="$memc_busstd_"/></xsl:message>
994 <xsl:variable name="peri_col_">
997 <xsl:when test="$mods_w_ > 1">
998 <xsl:value-of select="$COL_BG"/>
1001 <xsl:when test="/EDKSYSTEM/BLKDSHAPES/BCLANESPACES/BCLANESPACE/BUSCONNLANE[(BUSCONN[(@INSTANCE = $memc_name_)])]/@BUSSTD">
1002 <xsl:call-template name="BusType2Color">
1003 <xsl:with-param name="busType" select="$memc_busstd_"/>
1004 </xsl:call-template>
1008 <xsl:value-of select="$COL_OPBBUS"/>
1014 <!-- first define its symbols as individual modules -->
1015 <xsl:for-each select="MODULE[(@MODCLASS = 'MEMORY')]">
1016 <xsl:variable name="modInst_" select="@INSTANCE"/>
1017 <xsl:variable name="modType_" select="/EDKSYSTEM/MODULES/MODULE[@INSTANCE=$modInst_]/@MODTYPE"/>
1019 <xsl:call-template name="Define_Peripheral">
1020 <xsl:with-param name="modVori" select="'rot180'"/>
1021 <xsl:with-param name="modInst" select="$modInst_"/>
1022 <xsl:with-param name="modType" select="$modType_"/>
1023 </xsl:call-template>
1026 <xsl:for-each select="MODULE[not(@MODCLASS='MEMORY')]">
1027 <xsl:variable name="modInst_" select="@INSTANCE"/>
1028 <xsl:variable name="modType_" select="/EDKSYSTEM/MODULES/MODULE[@INSTANCE=$modInst_]/@MODTYPE"/>
1031 <xsl:message>Memory cntlr inst <xsl:value-of select="$modInst_"/></xsl:message>
1033 <xsl:call-template name="Define_Peripheral">
1034 <xsl:with-param name="modVori" select="'normal'"/>
1035 <xsl:with-param name="modInst" select="$modInst_"/>
1036 <xsl:with-param name="modType" select="$modType_"/>
1037 </xsl:call-template>
1040 <xsl:variable name="memW_" select="($periMOD_W * $mods_w_)"/>
1041 <xsl:variable name="memH_" select="($periMOD_H * $mods_h_)"/>
1043 <xsl:variable name="symbol_name_">
1044 <xsl:call-template name="_gen_Stack_SymbolName">
1045 <xsl:with-param name="horizIdx" select="@STACK_HORIZ_INDEX"/>
1046 <xsl:with-param name="vertiIdx" select="@SHAPE_VERTI_INDEX"/>
1047 </xsl:call-template>
1051 <symbol id="{$symbol_name_}">
1057 width = "{$memW_ + 4}"
1058 height= "{$memH_ + 4}"
1059 style="fill:{$peri_col_}; stroke:{$peri_col_}; stroke-width:2"/>
1062 <!-- Draw the memory block-->
1065 <xsl:when test="$mods_w_ = 1">
1067 <xsl:for-each select="MODULE[(@MODCLASS='MEMORY')]">
1068 <xsl:variable name="modInst_" select="@INSTANCE"/>
1071 y="{$periMOD_H + 2}"
1072 xlink:href="#symbol_{$modInst_}"/>
1076 <!-- Draw the memory controllers-->
1077 <xsl:for-each select="MODULE[not(@MODCLASS='MEMORY')]">
1078 <xsl:variable name="modInst_" select="@INSTANCE"/>
1082 xlink:href="#symbol_{$modInst_}"/>
1086 <xsl:when test="$mods_w_ > 1">
1087 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]/MODULE[(@MODCLASS = 'MEMORY')]">
1089 <xsl:variable name="modInst_" select="@INSTANCE"/>
1091 <use x="{ceiling($memW_ div 2) - ($periMOD_W div 2)}"
1092 y="{$periMOD_H + 2}"
1093 xlink:href="#symbol_{$modInst_}"/>
1096 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]/MODULE[(not(@MODCLASS='MEMORY') and (@ORIENTED = 'WEST'))]">
1097 <xsl:variable name="modInst_" select="@INSTANCE"/>
1101 xlink:href="#symbol_{$modInst_}"/>
1104 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]/MODULE[(not(@MODCLASS='MEMORY') and (@ORIENTED = 'EAST'))]">
1105 <xsl:variable name="modInst_" select="@INSTANCE"/>
1107 <use x="{$periMOD_W}"
1109 xlink:href="#symbol_{$modInst_}"/>
1112 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]/MODULE[(not(@MODCLASS='MEMORY') and (@ORIENTED = 'CENTER'))]">
1113 <xsl:variable name="modInst_" select="@INSTANCE"/>
1115 <use x="{ceiling($memW_ div 2) - ($periMOD_W div 2)}"
1117 xlink:href="#symbol_{$modInst_}"/>
1127 <!-- ======================= END DEF FUNCTIONS ============================ -->
1129 <!-- ======================= UTILITY FUNCTIONS ============================ -->
1131 <xsl:template name="_draw_InterruptSource">
1133 <xsl:param name="intr_col" select="$COL_INTR_0"/>
1134 <xsl:param name="intr_x" select="0"/>
1135 <xsl:param name="intr_y" select="0"/>
1136 <xsl:param name="intr_pri" select="0"/>
1137 <xsl:param name="intr_idx" select="0"/>
1145 height="{ceiling($INTR_H div 2)}" style="fill:{$intr_col}; stroke:none; stroke-width:1"/>
1147 <line x1="{$intr_x + ceiling($INTR_W div 2)}"
1149 x2="{$intr_x + ceiling($INTR_W div 2)}"
1150 y2="{$intr_y + ceiling($INTR_H div 2)}"
1151 style="stroke:{$COL_BLACK};stroke-width:1"/>
1153 <xsl:variable name="txt_ofs_">
1154 <xsl:if test="($intr_pri > 9)">4.5</xsl:if>
1155 <xsl:if test="not($intr_pri > 9)">0</xsl:if>
1158 <text class="intrsymbol"
1159 x="{$intr_x + 2 - $txt_ofs_}"
1161 <xsl:value-of select="$intr_pri"/>
1164 <text class="intrsymbol"
1165 x="{$intr_x + 2 + ceiling($INTR_W div 2)}"
1167 <xsl:value-of select="$intr_idx"/>
1172 <xsl:template name="_draw_InterruptCntrl">
1174 <xsl:param name="intr_col" select="$COL_INTR_0"/>
1175 <xsl:param name="intr_x" select="0"/>
1176 <xsl:param name="intr_y" select="0"/>
1177 <xsl:param name="intr_idx" select="0"/>
1184 width= "{ceiling($INTR_W div 2)}"
1185 height="{$INTR_H}" style="fill:{$intr_col}; stroke:none; stroke-width:1"/>
1187 <line x1="{$intr_x}"
1188 y1="{$intr_y + ceiling($INTR_H div 4)}"
1189 x2="{$intr_x + ceiling($INTR_W div 2)}"
1190 y2="{$intr_y + ceiling($INTR_H div 4)}"
1191 style="stroke:{$COL_BLACK};stroke-width:2"/>
1193 <text class="intrsymbol"
1195 y="{$intr_y + 8 + ceiling($INTR_H div 2)}">
1196 <xsl:value-of select="$intr_idx"/>
1202 <xsl:template name="_draw_InterruptedProc">
1204 <xsl:param name="intr_col" select="$COL_INTR_0"/>
1205 <xsl:param name="intr_x" select="0"/>
1206 <xsl:param name="intr_y" select="0"/>
1207 <xsl:param name="intr_idx" select="0"/>
1214 width= "{ceiling($INTR_W div 2)}"
1215 height="{$INTR_H}" style="fill:{$intr_col}; stroke:none; stroke-width:1"/>
1217 <line x1="{$intr_x}"
1218 y1="{$intr_y + ceiling($INTR_H div 4) - 2}"
1219 x2="{$intr_x + ceiling($INTR_W div 2)}"
1220 y2="{$intr_y + ceiling($INTR_H div 4) - 2}"
1221 style="stroke:{$COL_BLACK};stroke-width:1"/>
1223 <line x1="{$intr_x}"
1224 y1="{$intr_y + ceiling($INTR_H div 4) + 2}"
1225 x2="{$intr_x + ceiling($INTR_W div 2)}"
1226 y2="{$intr_y + ceiling($INTR_H div 4) + 2}"
1227 style="stroke:{$COL_BLACK};stroke-width:1"/>
1229 <text class="intrsymbol"
1231 y="{$intr_y + 8 + ceiling($INTR_H div 2)}">
1232 <xsl:value-of select="$intr_idx"/>
1237 <xsl:template name="_calc_CStackShapesAbv_Height">
1238 <xsl:param name="cstkIndex" select="100"/>
1239 <xsl:param name="cstkMods_Y" select="1000"/>
1242 <xsl:message>Stack Index <xsl:value-of select="$cstackIndex"/></xsl:message>
1244 <xsl:message>Stack Y <xsl:value-of select="$cstackModY"/></xsl:message>
1246 <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@CSTACK_INDEX = $cstkIndex)])">0</xsl:if>
1248 <xsl:if test="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@CSTACK_INDEX = $cstkIndex)]">
1250 <xsl:variable name="shapesAbv_Heights_">
1251 <CSTACK_MOD HEIGHT="0"/>
1253 <!-- Store the heights of all the peripherals above this one heights in a variable -->
1254 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[((@CSTACK_INDEX = $cstkIndex) and (@CSTACK_MODS_Y < $cstkMods_Y))]">
1256 <xsl:variable name="shapeHeight_">
1260 <xsl:when test="@MODCLASS = 'PERIPHERAL'">
1261 <xsl:call-template name="_calc_PeriShape_Height">
1262 <xsl:with-param name="shapeInst" select="MODULE/@INSTANCE"/>
1263 </xsl:call-template>
1266 <xsl:when test="@MODCLASS = 'MEMORY_UNIT'">
1267 <xsl:call-template name="_calc_MemoryUnit_Height">
1268 <xsl:with-param name="shapeId" select="@SHAPE_ID"/>
1269 </xsl:call-template>
1272 <xsl:otherwise>0</xsl:otherwise>
1277 <xsl:message>Calculated height of cstack shape of type <xsl:value-of select="@MODCLASS"/> as <xsl:value-of select="$shapeHeight_"/></xsl:message>
1280 <CSTACK_MOD HEIGHT="{$shapeHeight_ + $BIF_H}"/>
1285 <xsl:message>Calculated height of cstack as <xsl:value-of select="sum(exsl:node-set($shapesAbv_Heights_)/CSTACK_MOD/@HEIGHT)"/></xsl:message>
1288 <xsl:value-of select="sum(exsl:node-set($shapesAbv_Heights_)/CSTACK_MOD/@HEIGHT)"/>
1294 <xsl:template name="_calc_PeriShape_Height">
1295 <xsl:param name="shapeInst" select="_shape_"/>
1298 <xsl:message>Calculating height of <xsl:value-of select="$shapeInst"/></xsl:message>
1301 <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE/MODULE[(@INSTANCE = $shapeInst)]/@BIFS_H) and not(/EDKSYSTEM/BLKDSHAPES/BRIDGESHAPES/MODULE[(@INSTANCE = $shapeInst)]/@BIFS_H)">0</xsl:if>
1303 <xsl:if test="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE/MODULE[(@INSTANCE = $shapeInst)]/@BIFS_H)">
1304 <xsl:variable name="bifs_h_" select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE/MODULE[(@INSTANCE = $shapeInst)]/@BIFS_H"/>
1306 <xsl:value-of select="($MOD_LABEL_H + ($BIF_H * $bifs_h_) + ($MOD_BIF_GAP_V * $bifs_h_) + ($MOD_LANE_H * 2))"/>
1309 <xsl:if test="(/EDKSYSTEM/BLKDSHAPES/BRIDGESHAPES/MODULE[(@INSTANCE = $shapeInst)]/@BIFS_H)">
1310 <xsl:variable name="bifs_h_" select="/EDKSYSTEM/BLKDSHAPES/BRIDGESHAPES/MODULE[(@INSTANCE = $shapeInst)]/@BIFS_H"/>
1312 <xsl:value-of select="($MOD_LABEL_H + ($BIF_H * $bifs_h_) + ($MOD_BIF_GAP_V * $bifs_h_) + ($MOD_LANE_H * 2))"/>
1315 <xsl:if test="(/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[(@INSTANCE = $shapeInst)]/@BIFS_H)">
1316 <xsl:variable name="bifs_h_" select="/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[(@INSTANCE = $shapeInst)]/@BIFS_H"/>
1318 <xsl:value-of select="($MOD_LABEL_H + ($BIF_H * $bifs_h_) + ($MOD_BIF_GAP_V * $bifs_h_) + ($MOD_LANE_H * 2))"/>
1323 <xsl:template name="_calc_Shape_Height">
1324 <xsl:param name="shapeId" select="_shape_"/>
1327 <xsl:message>Calculating height of <xsl:value-of select="$shapeId"/></xsl:message>
1330 <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)])">0</xsl:if>
1332 <xsl:if test="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]/MODULE/@BIFS_H)">
1333 <xsl:variable name="bifs_h_" select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]/MODULE/@BIFS_H"/>
1335 <xsl:value-of select="($MOD_LABEL_H + ($BIF_H * $bifs_h_) + ($MOD_BIF_GAP_V * $bifs_h_) + ($MOD_LANE_H * 2))"/>
1341 <xsl:template name="_calc_MemoryUnit_Height">
1342 <xsl:param name="shapeId" select="1000"/>
1344 <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)])">0</xsl:if>
1346 <xsl:if test="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]">
1348 <!-- Store the memory controller heights in a variable -->
1349 <xsl:variable name="memC_heights_">
1350 <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]/MODULE[(@MODCLASS = 'MEMORY_CNTLR')])">
1351 <MEM_CNTLR INSTANCE="{@INSTANCE}" HEIGHT="0"/>
1354 <xsl:if test="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]/MODULE[(@MODCLASS = 'MEMORY_CNTLR')])">
1355 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]/MODULE[(@MODCLASS = 'MEMORY_CNTLR')]">
1356 <xsl:variable name="memC_height_">
1357 <xsl:call-template name="_calc_PeriShape_Height">
1358 <xsl:with-param name="shapeInst" select="@INSTANCE"/>
1359 </xsl:call-template>
1361 <MEM_CNTLR INSTANCE="{@INSTANCE}" HEIGHT="{$memC_height_}"/>
1366 <!-- Store the bram heights in a variable -->
1367 <xsl:variable name="bram_heights_">
1368 <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]/MODULE[not(@MODCLASS = 'MEMORY_CNTLR')])">
1369 <BRAM INSTANCE="{@INSTANCE}" HEIGHT="0"/>
1371 <xsl:if test="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]/MODULE[not(@MODCLASS = 'MEMORY_CNTLR')]">
1372 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $shapeId)]/MODULE[not(@MODCLASS = 'MEMORY_CNTLR')]">
1373 <xsl:variable name="bram_height_">
1374 <xsl:call-template name="_calc_PeriShape_Height">
1375 <xsl:with-param name="shapeInst" select="@INSTANCE"/>
1376 </xsl:call-template>
1378 <BRAM INSTANCE="{@INSTANCE}" HEIGHT="{$bram_height_}"/>
1383 <!-- Select the maximum of them -->
1384 <xsl:variable name="max_bram_height_" select="math:max(exsl:node-set($bram_heights_)/BRAM/@HEIGHT)"/>
1385 <xsl:variable name="max_memC_height_" select="math:max(exsl:node-set($memC_heights_)/MEM_CNTLR/@HEIGHT)"/>
1387 <xsl:value-of select="$max_bram_height_ + $max_memC_height_"/>
1393 <xsl:template name="_calc_SbsBucket_Height">
1394 <xsl:param name="bucketId" select="100"/>
1397 <xsl:message>Looking of height of bucket <xsl:value-of select="$bucketId"/></xsl:message>
1399 <xsl:variable name="bkt_gap_" select="$BIF_H"/>
1401 <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/SBSBUCKETS/SBSBUCKET[(@BUSINDEX = $bucketId)])">0</xsl:if>
1403 <xsl:if test="/EDKSYSTEM/BLKDSHAPES/SBSBUCKETS/SBSBUCKET[(@BUSINDEX = $bucketId)]">
1404 <xsl:variable name="mods_h_" select="/EDKSYSTEM/BLKDSHAPES/SBSBUCKETS/SBSBUCKET[(@BUSINDEX = $bucketId)]/@MODS_H"/>
1406 <xsl:value-of select="((($MOD_BKTLANE_H * 2) + ((($periMOD_H + $BIFC_H) * $mods_h_) + ($MOD_BUCKET_G * ($mods_h_ - 1)))) + $bkt_gap_)"/>
1411 ===============================================
1413 Symbol Naming Functions
1415 ===============================================
1419 <xsl:template name="_gen_Proc_StackName">
1420 <xsl:param name="procInst" select="'_unknown_'"/>
1421 symbol_STACK_<xsl:value-of select="$procInst"/>
1424 <xsl:template name="_gen_Proc_GroupName">
1425 <xsl:param name="procInst" select="'_unknown_'"/>
1426 symbol_GROUP_<xsl:value-of select="$procInst"/>
1430 <xsl:template name="_gen_Space_Name"><xsl:param name="stackToEast" select="'NONE'"/><xsl:param name="stackToWest" select="'NONE'"/>symbol_SPACE_WEST_<xsl:value-of select="$stackToWest"/>_EAST_<xsl:value-of select="$stackToEast"/></xsl:template>
1431 <xsl:template name="_gen_Stack_Name"><xsl:param name="horizIdx" select="'_unknown_'"/>symbol_STACK_<xsl:value-of select="$horizIdx"/></xsl:template>
1432 <xsl:template name="_gen_Stack_SymbolName"><xsl:param name="horizIdx" select="'_unknown_'"/><xsl:param name="vertiIdx" select="'_unknown_'"/>symbol_STACK_<xsl:value-of select="$horizIdx"/>_SHAPE_<xsl:value-of select="$vertiIdx"/></xsl:template>
1437 <!-- ======================= END UTILITY FUNCTIONS ======================= -->