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="iPeriId" 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="iModInst" select="$modInst_"/>
40 <xsl:with-param name="iModType" 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="iPeriId" 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="iModInst" select="$modInst_"/>
71 <xsl:with-param name="iModType" select="$modType_"/>
72 <xsl:with-param name="iUnkInst" 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="iIPType" select="@MODTYPE"/>
90 <xsl:with-param name="iIPName" select="@INSTANCE"/>
95 <symbol id="ipbucket">
96 <xsl:variable name="bucket_w_" select="(($BLKD_MOD_BKTLANE_W * 2) + (($BLKD_MOD_W * @MODS_W) + ($BLKD_MOD_BUCKET_G * (@MODS_W - 1))))"/>
97 <xsl:variable name="bucket_h_" select="(($BLKD_MOD_BKTLANE_H * 2) + (($BLKD_MOD_H * @MODS_H) + ($BLKD_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="$BLKD_MOD_BKTLANE_W + ($clm_ * ($BLKD_MOD_W + $BLKD_MOD_BUCKET_G))"/>
115 <xsl:variable name="bk_y_" select="$BLKD_MOD_BKTLANE_H + ($row_ * ($BLKD_MOD_H + $BLKD_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="(($BLKD_MOD_BKTLANE_W * 2) + (($BLKD_MOD_W * @MODS_W) + ($BLKD_MOD_BUCKET_G * (@MODS_W - 1))))"/>
137 <xsl:variable name="bucket_h_" select="(($BLKD_MOD_BKTLANE_H * 2) + (($BLKD_MOD_H * @MODS_H) + ($BLKD_MOD_BUCKET_G * (@MODS_H - 1))))"/>
143 width= "{$bucket_w_}"
144 height="{$bucket_h_}"
145 style="stroke-width:2; stroke:{$COL_BLACK}; fill:{$COL_BG_UNK}"/>
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="$BLKD_MOD_BKTLANE_W + (@MODS_X * ($BLKD_MOD_W + $BLKD_MOD_BUCKET_G))"/>
161 <xsl:variable name="bk_y_" select="$BLKD_MOD_BKTLANE_H + ($row_mods_h_ * ($BLKD_MOD_H + $BLKD_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="iBusType" select="$bus_std_"/>
195 <xsl:variable name="bucket_col_">
196 <xsl:call-template name="BusType2Color">
197 <xsl:with-param name="iBusType" 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="iBifType" select="$bus_std_"/>
208 <xsl:with-param name="iIPType" select="@MODTYPE"/>
209 <xsl:with-param name="iIPName" select="@INSTANCE"/>
214 <symbol id="sbsbucket_{$bus_name_}">
215 <xsl:variable name="bucket_w_" select="(($BLKD_MOD_BKTLANE_W * 2) + (($BLKD_MOD_W * @MODS_W) + ($BLKD_MOD_BUCKET_G * (@MODS_W - 1))))"/>
216 <xsl:variable name="bucket_h_" select="(($BLKD_MOD_BKTLANE_H * 2) + ((($BLKD_MOD_H + $BLKD_BIFC_H) * @MODS_H) + ($BLKD_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_}"/>
226 <xsl:variable name="bkt_mods_w_" select="@MODS_W"/>
228 <xsl:for-each select="MODULE">
230 <xsl:sort data-type="text" select="@INSTANCE" order="ascending"/>
232 <xsl:variable name="clm_" select="(( position() - 1) mod $bkt_mods_w_)"/>
233 <xsl:variable name="row_" select="floor((position() - 1) div $bkt_mods_w_)"/>
235 <xsl:variable name="bk_x_" select="$BLKD_MOD_BKTLANE_W + ($clm_ * ($BLKD_MOD_W + $BLKD_MOD_BUCKET_G))"/>
236 <xsl:variable name="bk_y_" select="$BLKD_MOD_BKTLANE_H + ($row_ * ($BLKD_MOD_H + $BLKD_BIFC_H + $BLKD_MOD_BUCKET_G))"/>
238 <!-- Lay out the module in the bucket -->
239 <use x="{$bk_x_}" y="{$bk_y_}" xlink:href="#sbsbktmodule_{@INSTANCE}"/>
241 <!-- Add its connection to the piece shared bus -->
242 <xsl:variable name="h_bus_y_" select="$bk_y_ + ceiling($BLKD_BIFC_H div 2) - ceiling($BLKD_P2P_BUS_W div 2)"/>
245 <xsl:variable name="h_bus_x_" select="$bk_x_ - ($BLKD_MOD_BUCKET_G + ceiling($BLKD_MOD_W div 2))"/>
247 <xsl:variable name="h_bus_x_">
249 <xsl:when test="($clm_ = '0')">0</xsl:when>
251 <xsl:when test="not($clm_ = '0')">
252 <xsl:value-of select="$bk_x_ - ($BLKD_MOD_BUCKET_G + ceiling($BLKD_MOD_W div 2))"/>
258 <xsl:variable name="h_bus_y_" select="$bk_y_ + ceiling($BLKD_BIFC_H div 2) - ceiling($BLKD_P2P_BUS_W)"/>
259 <xsl:message>h bus x <xsl:value-of select="$h_bus_x_"/></xsl:message>
260 <xsl:message>h bus y <xsl:value-of select="$h_bus_y_"/></xsl:message>
262 <xsl:variable name="h_bus_height_" select="$BLKD_P2P_BUS_W"/>
263 <xsl:variable name="h_bus_width_" select="($bk_x_ - $h_bus_x_ + ceiling($BLKD_MOD_W div 2))"/>
265 <rect x="{$h_bus_x_}"
267 width= "{$h_bus_width_}"
268 height="{$BLKD_P2P_BUS_W}"
269 style="fill:{$bucket_col_}"/>
273 <xsl:variable name="num_sbsbktmods_" select="count(MODULE)"/>
274 <xsl:variable name="num_sbsbktrows_" select="ceiling($num_sbsbktmods_ div $BLKD_BKT_MODS_PER_ROW)"/>
276 <!-- If there is more than one row, connect the rows with a vertical bar -->
277 <xsl:if test="($num_sbsbktrows_ > 1)">
279 <xsl:variable name="v_bus_x_" select="$BLKD_MOD_BKTLANE_W + ($BLKD_MOD_W + $BLKD_MOD_BUCKET_G)"/>
281 <xsl:variable name="bkt_top_" select="$BLKD_MOD_BKTLANE_H + (0 * ($BLKD_MOD_H + $BLKD_BIFC_H + $BLKD_MOD_BUCKET_G))"/>
282 <xsl:variable name="bkt_bot_" select="$BLKD_MOD_BKTLANE_H + (($num_sbsbktrows_ - 1) * ($BLKD_MOD_H + $BLKD_BIFC_H + $BLKD_MOD_BUCKET_G))"/>
284 <xsl:variable name="v_bus_y_top_" select="$bkt_top_ + ceiling($BLKD_BIFC_H div 2) - ceiling($BLKD_P2P_BUS_W div 2)"/>
285 <xsl:variable name="v_bus_y_bot_" select="$bkt_bot_ + ceiling($BLKD_BIFC_H div 2) - ceiling($BLKD_P2P_BUS_W div 2)"/>
287 <xsl:variable name="v_bus_width_" select="$BLKD_P2P_BUS_W"/>
288 <xsl:variable name="v_bus_height_" select="($v_bus_y_bot_ - $v_bus_y_top_)"/>
291 width= "{$v_bus_width_}"
292 height="{$v_bus_height_}"
293 style="fill:{$bucket_col_}"/>
304 <xsl:template name="Define_SBSBucketModule">
306 <xsl:param name="iBifType" select="'OPB'"/>
307 <xsl:param name="iIPName" select="'_ipType_'"/>
308 <xsl:param name="iIPType" select="'_ipName_'"/>
311 <xsl:message>The IPType is <xsl:value-of select="$iIPType"/> </xsl:message>
313 <xsl:variable name="bif_y_">
314 <xsl:value-of select="$BLKD_MOD_LANE_H + $BLKD_BIFC_H"/>
317 <xsl:variable name="label_y_">
318 <xsl:value-of select="$BLKD_MOD_LANE_H + $BLKD_BIF_H + $BLKD_BIFC_H + $BLKD_MOD_BIF_GAP_V"/>
321 <xsl:variable name="modBg_Col_">
323 <xsl:when test="$iIPType = 'mpmc'"><xsl:value-of select="$COL_MPMC_BG"/></xsl:when>
324 <xsl:otherwise><xsl:value-of select="$COL_BG"/></xsl:otherwise>
328 <symbol id="sbsbktmodule_{$iIPName}">
334 width = "{$BLKD_MOD_W}"
335 height= "{$BLKD_MOD_H}"
336 style="fill:{$modBg_Col_}; stroke:{$COL_WHITE}; stroke-width:2"/>
338 <rect x="{ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_MOD_LABEL_W div 2)}"
342 width= "{$BLKD_MOD_LABEL_W}"
343 height="{$BLKD_MOD_LABEL_H}"
344 style="fill:{$COL_WHITE}; stroke:none;"/>
346 <xsl:if test="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$iIPName)]/@GROUP">
348 <rect x="{ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_MOD_LABEL_W div 2)}"
349 y="{$label_y_ + $BLKD_BIF_H + ceiling($BLKD_BIF_H div 3) - 2}"
352 width= "{$BLKD_MOD_LABEL_W}"
353 height="{$BLKD_BIF_H}"
354 style="fill:{$COL_IORING_LT}; stroke:none;"/>
357 <text class="ioplblgrp"
358 x="{ceiling($BLKD_MOD_W div 2)}"
359 y="{$label_y_ + $BLKD_BIF_H + ceiling($BLKD_BIF_H div 3) + 12}">
360 <xsl:value-of select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$iIPName)]/@GROUP"/>
365 <text class="bciptype"
366 x="{ceiling($BLKD_MOD_W div 2)}"
368 <xsl:value-of select="$iIPType"/>
371 <text class="bciplabel"
372 x="{ceiling($BLKD_MOD_W div 2)}"
373 y="{$label_y_ + 16}">
374 <xsl:value-of select="$iIPName"/>
377 <xsl:for-each select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iIPName)]/BUSINTERFACE[not(@BUSNAME = '__NOC__')]">
379 <xsl:variable name="bif_busstd_">
381 <xsl:when test="@BUSSTD">
382 <xsl:value-of select="@BUSSTD"/>
385 <xsl:value-of select="'TRS'"/>
390 <xsl:variable name="bif_name_">
392 <xsl:when test="string-length(@NAME) <= 5">
393 <xsl:value-of select="@NAME"/>
396 <xsl:value-of select="substring(@NAME,0,5)"/>
401 <xsl:variable name="bif_x_" select="ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_BIF_W div 2)"/>
403 <!-- Draw the BIF -->
404 <use x="{$bif_x_}" y="{$bif_y_}" xlink:href="#{$bif_busstd_}_Bif"/>
407 <symbol id="{$bus_type}_busconn_SLAVE">
410 <!-- Draw the BIF connection -->
411 <use x="{$bif_x_ + ceiling($BLKD_BIF_W div 2) - ceiling($BLKD_BIFC_W div 2)}" y="{$bif_y_ - $BLKD_BIFC_H - $BLKD_MOD_LANE_H}" xlink:href="#{$bif_busstd_}_busconn_{@BIFRANK}"/>
413 <text class="biflabel"
414 x="{$bif_x_ + ceiling($BLKD_BIF_W div 2)}"
415 y="{$bif_y_ + ceiling($BLKD_BIF_H div 2) + 3}">
416 <xsl:value-of select="$bif_name_"/>
421 <xsl:if test="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$iIPName)]/@INTCINDEX">
422 <xsl:variable name="intr_col_">
423 <xsl:call-template name="intcIdx2Color">
424 <xsl:with-param name="iIntcIdx" select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$iIPName)]/@INTCINDEX"/>
428 <xsl:call-template name="_draw_InterruptCntrl">
429 <xsl:with-param name="iIntr_X" select="($BLKD_MOD_W - ceiling($BLKD_INTR_W div 2))"/>
430 <xsl:with-param name="iIntr_Y" select="3 + $BLKD_BIFC_H"/>
431 <xsl:with-param name="iIntr_COL" select="$intr_col_"/>
432 <xsl:with-param name="iIntr_IDX" select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$iIPName)]/@INTCINDEX"/>
437 <xsl:for-each select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$iIPName)]/INTCCNTLRTRGS/INTCTRG">
438 <xsl:variable name="intr_col_">
439 <xsl:call-template name="intcIdx2Color">
440 <xsl:with-param name="intcIdx" select="@INTCINDEX"/>
444 <xsl:call-template name="_draw_InterruptSource">
445 <xsl:with-param name="iIntr_X" select="($BLKD_MOD_W - $BLKD_INTR_W)"/>
446 <xsl:with-param name="iIntr_Y" select="((position() - 1) * (ceiling($BLKD_INTR_H div 2) + 3)) + $BLKD_BIFC_H"/>
447 <xsl:with-param name="iIntr_COL" select="$intr_col_"/>
448 <xsl:with-param name="iIntr_PRI" select="@PRIORITY"/>
449 <xsl:with-param name="iIntr_IDX" select="@INTCINDEX"/>
458 <xsl:template name="Define_IPBucketModule">
460 <xsl:param name="iIPType" select="'_ip_type_'"/>
461 <xsl:param name="iIPName" select="'_ip_name_'"/>
463 <xsl:variable name="bif_y_">
464 <xsl:value-of select="$BLKD_MOD_LANE_H"/>
467 <xsl:variable name="label_y_">
468 <xsl:value-of select="(ceiling($BLKD_MOD_H div 2) - ceiling($BLKD_MOD_LABEL_H div 2))"/>
471 <symbol id="ipbktmodule_{$iIPName}">
477 width = "{$BLKD_MOD_W}"
478 height= "{$BLKD_MOD_H}"
479 style="fill:{$COL_BG}; stroke:{$COL_BLACK}; stroke-width:2"/>
481 <rect x="{ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_MOD_LABEL_W div 2)}"
485 width= "{$BLKD_MOD_LABEL_W}"
486 height="{$BLKD_MOD_LABEL_H}"
487 style="fill:{$COL_WHITE}; stroke:none;"/>
490 y="{$label_y_ + ceiling($BLKD_MOD_LABEL_H div 2) - 4}"
491 y="{$label_y_ + ceiling($BLKD_MOD_LABEL_H div 2) + 4}"
494 <text class="bciptype"
495 x="{ceiling($BLKD_MOD_W div 2)}"
497 <xsl:value-of select="$iIPType"/>
500 <text class="bciplabel"
501 x="{ceiling($BLKD_MOD_W div 2)}"
502 y="{$label_y_ + 16}">
503 <xsl:value-of select="$iIPName"/>
506 <xsl:if test="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iIPName)]/@GROUP">
508 <rect x="{ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_MOD_LABEL_W div 2)}"
509 y="{$label_y_ + $BLKD_BIF_H + ceiling($BLKD_BIF_H div 3) - 2}"
512 width= "{$BLKD_MOD_LABEL_W}"
513 height="{$BLKD_BIF_H}"
514 style="fill:{$COL_IORING_LT}; stroke:none;"/>
517 <text class="ioplblgrp"
518 x="{ceiling($BLKD_MOD_W div 2)}"
519 y="{$label_y_ + $BLKD_BIF_H + ceiling($BLKD_BIF_H div 3) + 12}">
520 <xsl:value-of select="/EDKSYSTEM/MODULES/MODULE[@INSTANCE=$iIPName]/@GROUP"/>
525 <xsl:for-each select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$iIPName)]/INTCCNTLRTRGS/INTCTRG">
527 <xsl:variable name="intr_col_">
528 <xsl:call-template name="intcIdx2Color">
529 <xsl:with-param name="iIntcIdx" select="@INTCINDEX"/>
533 <xsl:call-template name="_draw_InterruptSource">
534 <xsl:with-param name="iIntr_X" select="($BLKD_MOD_W - $BLKD_INTR_W)"/>
535 <xsl:with-param name="iIntr_Y" select="((position() - 1) * (ceiling($BLKD_INTR_H div 2) + 3))"/>
536 <xsl:with-param name="iIntr_COL" select="$intr_col_"/>
537 <xsl:with-param name="iIntr_PRI" select="@PRIORITY"/>
538 <xsl:with-param name="iIntr_IDX" select="@INTCINDEX"/>
548 <xsl:template name="Define_Peripheral">
550 when the module is oriented normal its label goes above the bifs
551 when the module is oriented rot180, (part of a processor memory
552 controller for example) its label goes below the bifs
555 <xsl:param name="iModVori" select="'normal'"/>
556 <xsl:param name="iModInst" select="'_instance_'"/>
557 <xsl:param name="iModType" select="'_modtype_'"/>
558 <xsl:param name="iUnkInst" select="'_unknown_'"/>
559 <xsl:param name="iHorizIdx" select="'_unknown_'"/>
560 <xsl:param name="iVertiIdx" select="'_unknown_'"/>
563 <xsl:message>Stack Y <xsl:value-of select="$cstkMods_Y"/></xsl:message>
564 <xsl:message>Stack Index Y <xsl:value-of select="$cstkIndex"/></xsl:message>
567 <xsl:variable name="modName_">
569 <xsl:when test="$iUnkInst = '_unknown_'">
570 <xsl:value-of select="$iModInst"/>
573 <xsl:value-of select="$iUnkInst"/>
578 <xsl:variable name="modSymbolName_">
580 <xsl:when test="(not($iHorizIdx = '_unknown_') and not($iVertiIdx = '_unknown_'))">
581 <xsl:call-template name="_gen_Stack_SymbolName">
582 <xsl:with-param name="iHorizIdx" select="$iHorizIdx"/>
583 <xsl:with-param name="iVertiIdx" select="$iVertiIdx"/>
586 <xsl:otherwise>symbol_<xsl:value-of select="$modName_"/></xsl:otherwise>
590 <xsl:variable name="modTypeName_" select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iModInst)]/@MODTYPE"/>
594 <xsl:message>The symbol type of the module is <xsl:value-of select="$modTypeName_"/></xsl:message>
595 <xsl:message>The symbol name of the module is <xsl:value-of select="$modSymbolName_"/></xsl:message>
598 <xsl:variable name="bifs_h_">
599 <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE/MODULE[(@INSTANCE = $iModInst)]/@BIFS_H) and not(/EDKSYSTEM/BLKDSHAPES/BRIDGESHAPES/MODULE[(@INSTANCE = $iModInst)]/@BIFS_H)">0</xsl:if>
601 <xsl:if test="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE/MODULE[(@INSTANCE = $iModInst)]/@BIFS_H)">
602 <xsl:value-of select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE/MODULE[(@INSTANCE = $iModInst)]/@BIFS_H"/>
605 <xsl:if test="(/EDKSYSTEM/BLKDSHAPES/BRIDGESHAPES/MODULE[(@INSTANCE = $iModInst)]/@BIFS_H)">
606 <xsl:value-of select="/EDKSYSTEM/BLKDSHAPES/BRIDGESHAPES/MODULE[(@INSTANCE = $iModInst)]/@BIFS_H"/>
610 <xsl:variable name="label_y_">
612 <xsl:when test="$iModVori = 'rot180'">
613 <xsl:value-of select="($BLKD_MOD_LANE_H + (($BLKD_BIF_H + $BLKD_MOD_BIF_GAP_V) * $bifs_h_))"/>
616 <xsl:value-of select="$BLKD_MOD_LANE_H"/>
621 <xsl:variable name="bif_dy_">
623 <xsl:when test="$iModVori = 'rot180'">
624 <xsl:value-of select="$BLKD_MOD_LANE_H"/>
627 <xsl:value-of select="($BLKD_MOD_LANE_H + $BLKD_MOD_LABEL_H + $BLKD_MOD_BIF_GAP_V)"/>
632 <xsl:variable name="peri_stroke_col_">
634 <xsl:when test="((@MODCLASS = 'MASTER_SLAVE') or (@MODCLASS = 'MONITOR')) and BUSCONNS/BUSCONN">
635 <xsl:call-template name="BusType2Color">
636 <xsl:with-param name="iBusType" select="BUSCONNS/BUSCONN/@BUSSTD"/>
641 <xsl:value-of select="$COL_WHITE"/>
646 <xsl:variable name="modHeight_">
647 <xsl:call-template name="_calc_PeriShape_Height">
648 <xsl:with-param name="iShapeInst" select="$modName_"/>
652 <symbol id="{$modSymbolName_}">
654 <xsl:if test="$modTypeName_ = 'mpmc'">
659 width = "{$BLKD_MOD_W}"
660 height= "{$modHeight_}"
661 style="fill:{$COL_MPMC_BG}; stroke:{$peri_stroke_col_}; stroke-width:2"/>
664 <xsl:if test="not($modTypeName_ = 'mpmc')">
669 width = "{$BLKD_MOD_W}"
670 height= "{$modHeight_}"
671 style="fill:{$COL_BG}; stroke:{$peri_stroke_col_}; stroke-width:2"/>
675 <rect x="{ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_MOD_LABEL_W div 2)}"
679 width= "{$BLKD_MOD_LABEL_W}"
680 height="{$BLKD_MOD_LABEL_H}"
681 style="fill:{$COL_WHITE}; stroke:none;"/>
684 y="{$label_y_ + ceiling($BLKD_MOD_LABEL_H div 2) - 4}">
685 y="{$label_y_ + ceiling($BLKD_MOD_LABEL_H div 2) + 4}">
688 <text class="bciptype"
689 x="{ceiling($BLKD_MOD_W div 2)}"
691 <xsl:value-of select="$iModType"/>
694 <text class="bciplabel"
695 x="{ceiling($BLKD_MOD_W div 2)}"
696 y="{$label_y_ + 16}">
697 <xsl:value-of select="$iModInst"/>
700 <xsl:if test="/EDKSYSTEM/MODULES/MODULE[@INSTANCE=$iModInst]/@GROUP">
702 <rect x="{ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_MOD_LABEL_W div 2)}"
703 y="{$label_y_ + $BLKD_BIF_H + ceiling($BLKD_BIF_H div 3) - 2}"
706 width= "{$BLKD_MOD_LABEL_W}"
707 height="{$BLKD_BIF_H}"
708 style="fill:{$COL_IORING_LT}; stroke:none;"/>
710 <text class="ioplblgrp"
711 x="{ceiling($BLKD_MOD_W div 2)}"
712 y="{$label_y_ + $BLKD_BIF_H + ceiling($BLKD_BIF_H div 3) + 12}">
713 <xsl:value-of select="/EDKSYSTEM/MODULES/MODULE[@INSTANCE=$iModInst]/@GROUP"/>
718 <xsl:for-each select="/EDKSYSTEM/MODULES/MODULE[@INSTANCE=$iModInst]/BUSINTERFACE[(@BIF_X and @BIF_Y and not(@BUSNAME = '__NOC__'))]">
720 <xsl:variable name="bif_busstd_">
722 <xsl:when test="@BUSSTD">
723 <xsl:value-of select="@BUSSTD"/>
726 <xsl:value-of select="'TRS'"/>
731 <xsl:variable name="bif_y_">
732 <xsl:value-of select="(($BLKD_BIF_H + $BLKD_MOD_BIF_GAP_V) * @BIF_Y)"/>
735 <xsl:variable name="bif_buscol_">
736 <xsl:call-template name="BusType2Color">
737 <xsl:with-param name="iBusType" select="$bif_busstd_"/>
742 <xsl:variable name="bif_name_">
744 <xsl:when test="not(@NAME)">'UNK'</xsl:when>
745 <xsl:when test="string-length(@NAME) <= 5">
746 <xsl:value-of select="@NAME"/>
749 <xsl:value-of select="substring(@NAME,0,5)"/>
754 <xsl:variable name="bif_x_" >
755 <xsl:if test="not(@ORIENTED='CENTER')">
756 <xsl:value-of select="(($BLKD_BIF_W * @BIF_X) + ($BLKD_MOD_BIF_GAP_H * @BIF_X) + ($BLKD_MOD_LANE_W * 1))"/>
758 <xsl:if test="(@ORIENTED='CENTER')">
759 <xsl:value-of select="ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_BIF_W div 2)"/>
763 <xsl:if test="not(@IS_INTCONN)">
764 <xsl:variable name="horz_line_y_" select="($bif_y_ + $bif_dy_ + ceiling($BLKD_BIFC_H div 2))"/>
766 <xsl:variable name="horz_line_x1_">
768 <xsl:when test="@BIF_X = '0'">0</xsl:when>
769 <xsl:otherwise><xsl:value-of select="($BLKD_MOD_W - $BLKD_MOD_LANE_W)"/></xsl:otherwise>
773 <xsl:variable name="horz_line_x2_">
775 <xsl:when test="@BIF_X = '0'"><xsl:value-of select="$BLKD_MOD_LANE_W"/></xsl:when>
776 <xsl:otherwise><xsl:value-of select="$BLKD_MOD_W + 1"/></xsl:otherwise>
781 <line x1="{$horz_line_x1_}"
782 y1="{$horz_line_y_ - 2}"
783 x2="{$horz_line_x2_}"
784 y2="{$horz_line_y_ - 2}"
785 style="stroke:{$bif_buscol_};stroke-width:1"/>
789 <use x="{$bif_x_}" y="{$bif_y_ + $bif_dy_}" xlink:href="#{$bif_busstd_}_Bif"/>
791 <text class="biflabel"
792 x="{$bif_x_ + ceiling($BLKD_BIF_W div 2)}"
793 y="{$bif_y_ + $bif_dy_ + ceiling($BLKD_BIF_H div 2) + 3}">
794 <xsl:value-of select="$bif_name_"/>
800 <xsl:if test="@INTCINDEX">
801 <xsl:variable name="intr_col_">
802 <xsl:call-template name="intcIdx2Color">
803 <xsl:with-param name="intcIdx" select="@INTCINDEX"/>
807 <xsl:call-template name="_draw_InterruptCntrl">
808 <xsl:with-param name="intr_col" select="$intr_col_"/>
809 <xsl:with-param name="intr_x" select="($BLKD_MOD_W - ceiling($BLKD_INTR_W div 2))"/>
810 <xsl:with-param name="intr_y" select="3"/>
811 <xsl:with-param name="intr_idx" select="@INTCINDEX"/>
815 <xsl:if test="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iModInst)]/@INTCINDEX">
816 <xsl:variable name="intr_col_">
817 <xsl:call-template name="intcIdx2Color">
818 <xsl:with-param name="iIntcIdx" select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iModInst)]/@INTCINDEX"/>
822 <xsl:call-template name="_draw_InterruptCntrl">
823 <xsl:with-param name="iIntr_X" select="($BLKD_MOD_W - ceiling($BLKD_INTR_W div 2))"/>
824 <xsl:with-param name="iIntr_Y" select="3"/>
825 <xsl:with-param name="iIntr_COL" select="$intr_col_"/>
826 <xsl:with-param name="iIntr_IDX" select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iModInst)]/@INTCINDEX"/>
831 <xsl:for-each select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iModInst)]/INTCCNTLRTRGS/INTCTRG">
833 <xsl:variable name="intr_col_">
834 <xsl:call-template name="intcIdx2Color">
835 <xsl:with-param name="iIntcIdx" select="@INTCINDEX"/>
839 <xsl:call-template name="_draw_InterruptSource">
840 <xsl:with-param name="iIntr_X" select="($BLKD_MOD_W - $BLKD_INTR_W)"/>
841 <xsl:with-param name="iIntr_Y" select="((position() - 1) * (ceiling($BLKD_INTR_H div 2) + 3))"/>
842 <xsl:with-param name="iIntr_COL" select="$intr_col_"/>
843 <xsl:with-param name="iIntr_PRI" select="@PRIORITY"/>
844 <xsl:with-param name="iIntr_IDX" select="@INTCINDEX"/>
852 <xsl:template name="Define_MemoryUnit">
853 <xsl:param name="iShapeId" select="1000"/>
855 <xsl:variable name="horiz_idx_" select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/@STACK_HORIZ_INDEX"/>
856 <xsl:variable name="is_multistk_" select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/@IS_MULTISTK"/>
859 <xsl:when test="(($is_multistk_ = 'TRUE') or (/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[(@STACK_HORIZ_INDEX = $horiz_idx_)]))">
860 <xsl:call-template name="Define_Processor_MemoryUnit">
861 <xsl:with-param name="iShapeId" select="$iShapeId"/>
866 <xsl:call-template name="Define_StandAlone_MemoryUnit">
867 <xsl:with-param name="iShapeId" select="$iShapeId"/>
876 <xsl:template name="Define_Processor_MemoryUnit">
877 <xsl:param name="iShapeId" select="1000"/>
880 <xsl:param name="cstkIndex" select="'_processor_'"/>
883 <xsl:variable name="mods_h_" select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/@MODS_H"/>
884 <xsl:variable name="mods_w_" select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/@MODS_W"/>
885 <xsl:variable name="memW_" select="($BLKD_MOD_W * $mods_w_)"/>
886 <xsl:variable name="memH_" select="($BLKD_MOD_H * $mods_h_)"/>
888 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]">
890 <!-- first define its symbols as individual modules -->
891 <xsl:for-each select="MODULE[@MODCLASS='MEMORY']">
892 <xsl:variable name="modInst_" select="@INSTANCE"/>
893 <xsl:variable name="modType_" select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$modInst_)]/@MODTYPE"/>
895 <xsl:call-template name="Define_Peripheral">
896 <xsl:with-param name="iModVori" select="'normal'"/>
897 <xsl:with-param name="iModInst" select="$modInst_"/>
898 <xsl:with-param name="iModType" select="$modType_"/>
902 <xsl:for-each select="MODULE[@MODCLASS='MEMORY_CNTLR']">
903 <xsl:variable name="modInst_" select="@INSTANCE"/>
904 <xsl:variable name="modType_" select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$modInst_)]/@MODTYPE"/>
906 <xsl:call-template name="Define_Peripheral">
907 <xsl:with-param name="iModVori" select="'rot180'"/>
908 <xsl:with-param name="iModInst" select="$modInst_"/>
909 <xsl:with-param name="iModType" select="$modType_"/>
917 <xsl:variable name="symbol_name_">
918 <xsl:call-template name="_gen_Stack_SymbolName">
919 <xsl:with-param name="iHorizIdx" select="@STACK_HORIZ_INDEX"/>
920 <xsl:with-param name="iVertiIdx" select="@SHAPE_VERTI_INDEX"/>
925 <xsl:message>The mp stack name is <xsl:value-of select="$mp_stack_name_"/></xsl:message>
928 <symbol id="{$symbol_name_}">
936 style="fill:{$COL_BG}; stroke:{$COL_WHITE}; stroke-width:2"/>
938 <!-- Draw the memory block-->
939 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[(@MODCLASS = 'MEMORY')]">
941 <xsl:variable name="modInst_" select="@INSTANCE"/>
943 <use x="{ceiling($memW_ div 2) - ($BLKD_MOD_W div 2)}"
945 xlink:href="#symbol_{$modInst_}"/>
948 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[((@MODCLASS='MEMORY_CNTLR') and (@ORIENTED = 'WEST'))]">
949 <xsl:variable name="modInst_" select="@INSTANCE"/>
953 xlink:href="#symbol_{$modInst_}"/>
956 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[((@MODCLASS='MEMORY_CNTLR') and (@ORIENTED = 'EAST'))]">
957 <xsl:variable name="modInst_" select="@INSTANCE"/>
959 <use x="{$BLKD_MOD_W}"
961 xlink:href="#symbol_{$modInst_}"/>
964 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[((@MODCLASS='MEMORY_CNTLR') and (@ORIENTED = 'CENTER'))]">
965 <xsl:variable name="modInst_" select="@INSTANCE"/>
967 <use x="{ceiling($memW_ div 2) - ($BLKD_MOD_W div 2)}"
969 xlink:href="#symbol_{$modInst_}"/>
977 <xsl:template name="Define_StandAlone_MemoryUnit">
979 <xsl:param name="iShapeId" select="0"/>
981 <xsl:variable name="mods_h_" select="@MODS_H"/>
982 <xsl:variable name="mods_w_" select="@MODS_W"/>
984 <xsl:variable name="memc_name_" select="MODULE[not(@MODCLASS = 'MEMORY')]/@INSTANCE"/>
985 <xsl:variable name="memc_busstd_" select="/EDKSYSTEM/BLKDSHAPES/BCLANESPACES/BCLANESPACE/BUSCONNLANE[(BUSCONN[(@INSTANCE = $memc_name_)])]/@BUSSTD"/>
988 <xsl:variable name="memc_busstd_" select="/EDKSYSTEM/BLKDSHAPES/BCLANESPACES/BCLANESPACE/BUSCONNLANE/@BUSSTD"/>
989 <xsl:variable name="memc_busstd_" select="/EDKSYSTEM/BCLANESPACES/BCLANESPACE/BUSCONNLANE[(BUSCONN[(@INSTANCE)])]/@BUSSTD"/>
990 <xsl:message>Memory cntlr name <xsl:value-of select="$memc_name_"/></xsl:message>
991 <xsl:message>Memory cntlr name <xsl:value-of select="$memc_name_"/></xsl:message>
992 <xsl:message>Memory cntlr busstd <xsl:value-of select="$memc_busstd_"/></xsl:message>
995 <xsl:variable name="peri_col_">
998 <xsl:when test="$mods_w_ > 1">
999 <xsl:value-of select="$COL_BG"/>
1002 <xsl:when test="/EDKSYSTEM/BLKDSHAPES/BCLANESPACES/BCLANESPACE/BUSCONNLANE[(BUSCONN[(@INSTANCE = $memc_name_)])]/@BUSSTD">
1003 <xsl:call-template name="BusType2Color">
1004 <xsl:with-param name="iBusType" select="$memc_busstd_"/>
1005 </xsl:call-template>
1009 <xsl:call-template name="BusType2Color">
1010 <xsl:with-param name="iBusType" select="'TRS'"/>
1011 </xsl:call-template>
1017 <!-- first define its symbols as individual modules -->
1018 <xsl:for-each select="MODULE[(@MODCLASS = 'MEMORY')]">
1019 <xsl:variable name="modInst_" select="@INSTANCE"/>
1020 <xsl:variable name="modType_" select="/EDKSYSTEM/MODULES/MODULE[@INSTANCE=$modInst_]/@MODTYPE"/>
1022 <xsl:call-template name="Define_Peripheral">
1023 <xsl:with-param name="iModVori" select="'rot180'"/>
1024 <xsl:with-param name="iModInst" select="$modInst_"/>
1025 <xsl:with-param name="iModType" select="$modType_"/>
1026 </xsl:call-template>
1029 <xsl:for-each select="MODULE[not(@MODCLASS='MEMORY')]">
1030 <xsl:variable name="modInst_" select="@INSTANCE"/>
1031 <xsl:variable name="modType_" select="/EDKSYSTEM/MODULES/MODULE[@INSTANCE=$modInst_]/@MODTYPE"/>
1034 <xsl:message>Memory cntlr inst <xsl:value-of select="$modInst_"/></xsl:message>
1036 <xsl:call-template name="Define_Peripheral">
1037 <xsl:with-param name="iModVori" select="'normal'"/>
1038 <xsl:with-param name="iModInst" select="$modInst_"/>
1039 <xsl:with-param name="iModType" select="$modType_"/>
1040 </xsl:call-template>
1043 <xsl:variable name="memW_" select="($BLKD_MOD_W * $mods_w_)"/>
1044 <xsl:variable name="memH_" select="($BLKD_MOD_H * $mods_h_)"/>
1046 <xsl:variable name="symbol_name_">
1047 <xsl:call-template name="_gen_Stack_SymbolName">
1048 <xsl:with-param name="iHorizIdx" select="@STACK_HORIZ_INDEX"/>
1049 <xsl:with-param name="iVertiIdx" select="@SHAPE_VERTI_INDEX"/>
1050 </xsl:call-template>
1054 <symbol id="{$symbol_name_}">
1060 width = "{$memW_ + 4}"
1061 height= "{$memH_ + 4}"
1062 style="fill:{$peri_col_}; stroke:{$peri_col_}; stroke-width:2"/>
1065 <!-- Draw the memory block-->
1068 <xsl:when test="$mods_w_ = 1">
1070 <xsl:for-each select="MODULE[(@MODCLASS='MEMORY')]">
1071 <xsl:variable name="modInst_" select="@INSTANCE"/>
1074 y="{$BLKD_MOD_H + 2}"
1075 xlink:href="#symbol_{$modInst_}"/>
1079 <!-- Draw the memory controllers-->
1080 <xsl:for-each select="MODULE[not(@MODCLASS='MEMORY')]">
1081 <xsl:variable name="modInst_" select="@INSTANCE"/>
1085 xlink:href="#symbol_{$modInst_}"/>
1089 <xsl:when test="$mods_w_ > 1">
1090 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[(@MODCLASS = 'MEMORY')]">
1092 <xsl:variable name="modInst_" select="@INSTANCE"/>
1094 <use x="{ceiling($memW_ div 2) - ($BLKD_MOD_W div 2)}"
1095 y="{$BLKD_MOD_H + 2}"
1096 xlink:href="#symbol_{$modInst_}"/>
1099 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[(not(@MODCLASS='MEMORY') and (@ORIENTED = 'WEST'))]">
1100 <xsl:variable name="modInst_" select="@INSTANCE"/>
1104 xlink:href="#symbol_{$modInst_}"/>
1107 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[(not(@MODCLASS='MEMORY') and (@ORIENTED = 'EAST'))]">
1108 <xsl:variable name="modInst_" select="@INSTANCE"/>
1110 <use x="{$BLKD_MOD_W}"
1112 xlink:href="#symbol_{$modInst_}"/>
1115 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[(not(@MODCLASS='MEMORY') and (@ORIENTED = 'CENTER'))]">
1116 <xsl:variable name="modInst_" select="@INSTANCE"/>
1118 <use x="{ceiling($memW_ div 2) - ($BLKD_MOD_W div 2)}"
1120 xlink:href="#symbol_{$modInst_}"/>
1131 <xsl:template name="Define_StandAlone_MPMC">
1134 <xsl:param name="drawarea_w" select="500"/>
1135 <xsl:param name="drawarea_h" select="500"/>
1138 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/MPMCSHAPE">
1140 <xsl:variable name="mpmcInst_" select="@INSTANCE"/>
1141 <xsl:variable name="mpmcType_" select="/EDKSYSTEM/MODULES/MODULE[@INSTANCE=$mpmcInst_]/@MODTYPE"/>
1143 <xsl:message>Drawing instance <xsl:value-of select="$mpmcInst_"/></xsl:message>
1146 <xsl:variable name="mpmc_w_" select="($G_total_drawarea_W - ($BLKD_INNER_GAP * 2))"/>
1147 <xsl:variable name="label_y_" select="ceiling($BLKD_MPMC_MOD_H div 2) - ceiling($BLKD_MOD_LABEL_H div 2)"/>
1149 <symbol id="mpmcmodule_{$mpmcInst_}">
1152 width = "{$mpmc_w_}"
1153 height= "{$BLKD_MPMC_MOD_H}"
1154 style="fill:{$COL_MPMC_BG}; stroke:{$COL_BLACK}; stroke-width:2"/>
1156 <rect x="{$BLKD_MOD_LANE_H}"
1160 width= "{$BLKD_MOD_LABEL_W}"
1161 height="{$BLKD_MOD_LABEL_H}"
1162 style="fill:{$COL_WHITE}; stroke:none;"/>
1164 <text class="bciptype"
1165 x="{ceiling(($BLKD_MOD_LANE_H + $BLKD_MOD_LABEL_W) div 2)}"
1166 y="{$label_y_ + 8}">
1167 <xsl:value-of select="$mpmcType_"/>
1170 <text class="bciplabel"
1171 x="{ceiling(($BLKD_MOD_LANE_H + $BLKD_MOD_LABEL_W) div 2)}"
1172 y="{$label_y_ + 16}">
1173 <xsl:value-of select="$mpmcInst_"/>
1176 <text class="mpmctitle"
1177 x="{ceiling($mpmc_w_ div 2)}"
1178 y="{$label_y_ + 16}">MPMC Module Interface</text>
1189 <!-- ======================= END DEF FUNCTIONS ============================ -->
1191 <!-- ======================= UTILITY FUNCTIONS ============================ -->
1193 <xsl:template name="_draw_InterruptSource">
1195 <xsl:param name="iIntr_X" select="0"/>
1196 <xsl:param name="iIntr_Y" select="0"/>
1197 <xsl:param name="iIntr_PRI" select="0"/>
1198 <xsl:param name="iIntr_IDX" select="0"/>
1199 <xsl:param name="iIntr_COL" select="$COL_BLKD_INTR_0"/>
1206 width= "{$BLKD_INTR_W}"
1207 height="{ceiling($BLKD_INTR_H div 2)}" style="fill:{$iIntr_COL}; stroke:none; stroke-width:1"/>
1209 <line x1="{$iIntr_X + ceiling($BLKD_INTR_W div 2)}"
1211 x2="{$iIntr_X + ceiling($BLKD_INTR_W div 2)}"
1212 y2="{$iIntr_Y + ceiling($BLKD_INTR_H div 2)}"
1213 style="stroke:{$COL_BLACK};stroke-width:1"/>
1215 <xsl:variable name="txt_ofs_">
1216 <xsl:if test="($iIntr_PRI > 9)">4.5</xsl:if>
1217 <xsl:if test="not($iIntr_PRI > 9)">0</xsl:if>
1220 <text class="intrsymbol"
1221 x="{$iIntr_X + 2 - $txt_ofs_}"
1223 <xsl:value-of select="$iIntr_PRI"/>
1226 <text class="intrsymbol"
1227 x="{$iIntr_X + 2 + ceiling($BLKD_INTR_W div 2)}"
1229 <xsl:value-of select="$iIntr_IDX"/>
1234 <xsl:template name="_draw_InterruptCntrl">
1236 <xsl:param name="iIntr_X" select="0"/>
1237 <xsl:param name="iIntr_Y" select="0"/>
1238 <xsl:param name="iIntr_IDX" select="0"/>
1239 <xsl:param name="iIntr_COL" select="$COL_BLKD_INTR_0"/>
1246 width= "{ceiling($BLKD_INTR_W div 2)}"
1247 height="{$BLKD_INTR_H}" style="fill:{$iIntr_COL}; stroke:none; stroke-width:1"/>
1249 <line x1="{$iIntr_X}"
1250 y1="{$iIntr_Y + ceiling($BLKD_INTR_H div 4)}"
1251 x2="{$iIntr_X + ceiling($BLKD_INTR_W div 2)}"
1252 y2="{$iIntr_Y + ceiling($BLKD_INTR_H div 4)}"
1253 style="stroke:{$COL_BLACK};stroke-width:2"/>
1255 <text class="intrsymbol"
1257 y="{$iIntr_Y + 8 + ceiling($BLKD_INTR_H div 2)}">
1258 <xsl:value-of select="$iIntr_IDX"/>
1264 <xsl:template name="_draw_InterruptedProc">
1266 <xsl:param name="iIntr_X" select="0"/>
1267 <xsl:param name="iIntr_Y" select="0"/>
1268 <xsl:param name="iIntr_IDX" select="0"/>
1269 <xsl:param name="iIntr_COL" select="$COL_BLKD_INTR_0"/>
1276 width= "{ceiling($BLKD_INTR_W div 2)}"
1277 height="{$BLKD_INTR_H}" style="fill:{$iIntr_COL}; stroke:none; stroke-width:1"/>
1279 <line x1="{$iIntr_X}"
1280 y1="{$iIntr_Y + ceiling($BLKD_INTR_H div 4) - 2}"
1281 x2="{$iIntr_X + ceiling($BLKD_INTR_W div 2)}"
1282 y2="{$iIntr_Y + ceiling($BLKD_INTR_H div 4) - 2}"
1283 style="stroke:{$COL_BLACK};stroke-width:1"/>
1285 <line x1="{$iIntr_X}"
1286 y1="{$iIntr_Y + ceiling($BLKD_INTR_H div 4) + 2}"
1287 x2="{$iIntr_X + ceiling($BLKD_INTR_W div 2)}"
1288 y2="{$iIntr_Y + ceiling($BLKD_INTR_H div 4) + 2}"
1289 style="stroke:{$COL_BLACK};stroke-width:1"/>
1291 <text class="intrsymbol"
1293 y="{$iIntr_Y + 8 + ceiling($BLKD_INTR_H div 2)}">
1294 <xsl:value-of select="$iIntr_IDX"/>
1299 <xsl:template name="_calc_CStackShapesAbv_Height">
1300 <xsl:param name="iCStackIndex" select="100"/>
1301 <xsl:param name="iCSactkMods_Y" select="1000"/>
1304 <xsl:message>Stack Index <xsl:value-of select="$cstackIndex"/></xsl:message>
1306 <xsl:message>Stack Y <xsl:value-of select="$cstackModY"/></xsl:message>
1308 <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@CSTACK_INDEX = $iCStackIndex)])">0</xsl:if>
1310 <xsl:if test="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@CSTACK_INDEX = $iCStackIndex)]">
1312 <xsl:variable name="shapesAbv_Heights_">
1313 <CSTACK_MOD HEIGHT="0"/>
1315 <!-- Store the heights of all the peripherals above this one heights in a variable -->
1316 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[((@CSTACK_INDEX = $iCStackIndex) and (@CSTACK_MODS_Y < $iCStackMods_Y))]">
1318 <xsl:variable name="shapeHeight_">
1322 <xsl:when test="@MODCLASS = 'PERIPHERAL'">
1323 <xsl:call-template name="_calc_PeriShape_Height">
1324 <xsl:with-param name="iShapeInst" select="MODULE/@INSTANCE"/>
1325 </xsl:call-template>
1328 <xsl:when test="@MODCLASS = 'MEMORY_UNIT'">
1329 <xsl:call-template name="_calc_MemoryUnit_Height">
1330 <xsl:with-param name="iShapeId" select="@SHAPE_ID"/>
1331 </xsl:call-template>
1334 <xsl:otherwise>0</xsl:otherwise>
1339 <xsl:message>Calculated height of cstack shape of type <xsl:value-of select="@MODCLASS"/> as <xsl:value-of select="$shapeHeight_"/></xsl:message>
1342 <CSTACK_MOD HEIGHT="{$shapeHeight_ + $BLKD_BIF_H}"/>
1347 <xsl:message>Calculated height of cstack as <xsl:value-of select="sum(exsl:node-set($shapesAbv_Heights_)/CSTACK_MOD/@HEIGHT)"/></xsl:message>
1350 <xsl:value-of select="sum(exsl:node-set($shapesAbv_Heights_)/CSTACK_MOD/@HEIGHT)"/>
1356 <xsl:template name="_calc_PeriShape_Height">
1357 <xsl:param name="iShapeInst" select="'_shape_'"/>
1360 <xsl:message>Calculating height of <xsl:value-of select="$shapeInst"/></xsl:message>
1363 <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE/MODULE[(@INSTANCE = $iShapeInst)]/@BIFS_H) and not(/EDKSYSTEM/BLKDSHAPES/BRIDGESHAPES/MODULE[(@INSTANCE = $iShapeInst)]/@BIFS_H)">0</xsl:if>
1365 <xsl:if test="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE/MODULE[(@INSTANCE = $iShapeInst)]/@BIFS_H)">
1366 <xsl:variable name="bifs_h_" select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE/MODULE[(@INSTANCE = $iShapeInst)]/@BIFS_H"/>
1368 <xsl:value-of select="($BLKD_MOD_LABEL_H + ($BLKD_BIF_H * $bifs_h_) + ($BLKD_MOD_BIF_GAP_V * $bifs_h_) + ($BLKD_MOD_LANE_H * 2))"/>
1371 <xsl:if test="(/EDKSYSTEM/BLKDSHAPES/BRIDGESHAPES/MODULE[(@INSTANCE = $iShapeInst)]/@BIFS_H)">
1372 <xsl:variable name="bifs_h_" select="/EDKSYSTEM/BLKDSHAPES/BRIDGESHAPES/MODULE[(@INSTANCE = $iShapeInst)]/@BIFS_H"/>
1374 <xsl:value-of select="($BLKD_MOD_LABEL_H + ($BLKD_BIF_H * $bifs_h_) + ($BLKD_MOD_BIF_GAP_V * $bifs_h_) + ($BLKD_MOD_LANE_H * 2))"/>
1377 <xsl:if test="(/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[(@INSTANCE = $iShapeInst)]/@BIFS_H)">
1378 <xsl:variable name="bifs_h_" select="/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[(@INSTANCE = $iShapeInst)]/@BIFS_H"/>
1380 <xsl:value-of select="($BLKD_MOD_LABEL_H + ($BLKD_BIF_H * $bifs_h_) + ($BLKD_MOD_BIF_GAP_V * $bifs_h_) + ($BLKD_MOD_LANE_H * 2))"/>
1385 <xsl:template name="_calc_Shape_Height">
1386 <xsl:param name="iShapeId" select="_shape_"/>
1389 <xsl:message>Calculating height of <xsl:value-of select="$shapeId"/></xsl:message>
1392 <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)])">0</xsl:if>
1394 <xsl:if test="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE/@BIFS_H)">
1395 <xsl:variable name="bifs_h_" select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE/@BIFS_H"/>
1397 <xsl:value-of select="($BLKD_MOD_LABEL_H + ($BIF_H * $bifs_h_) + ($BLKD_MOD_BIF_GAP_V * $bifs_h_) + ($BLKD_MOD_LANE_H * 2))"/>
1403 <xsl:template name="_calc_MemoryUnit_Height">
1404 <xsl:param name="iShapeId" select="1000"/>
1406 <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)])">0</xsl:if>
1408 <xsl:if test="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]">
1410 <!-- Store the memory controller heights in a variable -->
1411 <xsl:variable name="memC_heights_">
1412 <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[(@MODCLASS = 'MEMORY_CNTLR')])">
1413 <MEM_CNTLR INSTANCE="{@INSTANCE}" HEIGHT="0"/>
1416 <xsl:if test="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[(@MODCLASS = 'MEMORY_CNTLR')])">
1417 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[(@MODCLASS = 'MEMORY_CNTLR')]">
1418 <xsl:variable name="memC_height_">
1419 <xsl:call-template name="_calc_PeriShape_Height">
1420 <xsl:with-param name="iShapeInst" select="@INSTANCE"/>
1421 </xsl:call-template>
1423 <MEM_CNTLR INSTANCE="{@INSTANCE}" HEIGHT="{$memC_height_}"/>
1428 <!-- Store the bram heights in a variable -->
1429 <xsl:variable name="bram_heights_">
1430 <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[not(@MODCLASS = 'MEMORY_CNTLR')])">
1431 <BRAM INSTANCE="{@INSTANCE}" HEIGHT="0"/>
1433 <xsl:if test="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[not(@MODCLASS = 'MEMORY_CNTLR')]">
1434 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[not(@MODCLASS = 'MEMORY_CNTLR')]">
1435 <xsl:variable name="bram_height_">
1436 <xsl:call-template name="_calc_PeriShape_Height">
1437 <xsl:with-param name="iShapeInst" select="@INSTANCE"/>
1438 </xsl:call-template>
1440 <BRAM INSTANCE="{@INSTANCE}" HEIGHT="{$bram_height_}"/>
1445 <!-- Select the maximum of them -->
1446 <xsl:variable name="max_bram_height_" select="math:max(exsl:node-set($bram_heights_)/BRAM/@HEIGHT)"/>
1447 <xsl:variable name="max_memC_height_" select="math:max(exsl:node-set($memC_heights_)/MEM_CNTLR/@HEIGHT)"/>
1449 <xsl:value-of select="$max_bram_height_ + $max_memC_height_"/>
1455 <xsl:template name="_calc_SbsBucket_Height">
1456 <xsl:param name="iBucketId" select="100"/>
1459 <xsl:message>Looking of height of bucket <xsl:value-of select="$bucketId"/></xsl:message>
1461 <xsl:variable name="bkt_gap_" select="$BLKD_BIF_H"/>
1463 <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/SBSBUCKETS/SBSBUCKET[(@BUSINDEX = $iBucketId)])">0</xsl:if>
1465 <xsl:if test="/EDKSYSTEM/BLKDSHAPES/SBSBUCKETS/SBSBUCKET[(@BUSINDEX = $iBucketId)]">
1466 <xsl:variable name="mods_h_" select="/EDKSYSTEM/BLKDSHAPES/SBSBUCKETS/SBSBUCKET[(@BUSINDEX = $iBucketId)]/@MODS_H"/>
1468 <xsl:value-of select="((($BLKD_MOD_BKTLANE_H * 2) + ((($BLKD_MOD_H + $BLKD_BIFC_H) * $mods_h_) + ($BLKD_MOD_BUCKET_G * ($mods_h_ - 1)))) + $bkt_gap_)"/>
1473 ===============================================
1475 Symbol Naming Functions
1477 ===============================================
1481 <xsl:template name="_gen_Proc_StackName">
1482 <xsl:param name="iProcInst" select="'_unknown_'"/>
1483 symbol_STACK_<xsl:value-of select="$iProcInst"/>
1486 <xsl:template name="_gen_Proc_GroupName">
1487 <xsl:param name="iProcInst" select="'_unknown_'"/>
1488 symbol_GROUP_<xsl:value-of select="$iProcInst"/>
1492 <xsl:template name="_gen_Space_Name"><xsl:param name="iStackToEast" select="'NONE'"/><xsl:param name="iStackToWest" select="'NONE'"/>symbol_SPACE_WEST_<xsl:value-of select="$iStackToWest"/>_EAST_<xsl:value-of select="$iStackToEast"/></xsl:template>
1493 <xsl:template name="_gen_Stack_Name"><xsl:param name="iHorizIdx" select="'_unknown_'"/>symbol_STACK_<xsl:value-of select="$iHorizIdx"/></xsl:template>
1494 <xsl:template name="_gen_Stack_SymbolName"><xsl:param name="iHorizIdx" select="'_unknown_'"/><xsl:param name="iVertiIdx" select="'_unknown_'"/>symbol_STACK_<xsl:value-of select="$iHorizIdx"/>_SHAPE_<xsl:value-of select="$iVertiIdx"/></xsl:template>
1497 <!-- ======================= END UTILITY FUNCTIONS ======================= -->