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:exsl="http://exslt.org/common"
6 xmlns:dyn="http://exslt.org/dynamic"
7 xmlns:math="http://exslt.org/math"
8 xmlns:xlink="http://www.w3.org/1999/xlink"
9 extension-element-prefixes="math dyn exsl xlink">
12 <xsl:output method="xml"
16 doctype-public="-//W3C//DTD SVG Tiny 1.1//EN"
17 doctype-system="http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd"/>
21 <!-- ======================= DEF BLOCK =================================== -->
22 <xsl:template name="Define_AllStacks">
24 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/BCLANESPACES/BCLANESPACE[(@EAST < $G_ROOT/EDKSYSTEM/BLKDIAGRAM/@STACK_HORIZ_WIDTH)]">
26 <xsl:call-template name="Define_Stack">
27 <xsl:with-param name="iStackIdx" select="@EAST"/>
34 <xsl:template name="Define_Stack">
35 <xsl:param name="iStackIdx" select="100"/>
37 <!-- Define the stack's peripheral shapes-->
38 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@STACK_HORIZ_INDEX = $iStackIdx) and not(@MODCLASS = 'MEMORY_UNIT'))]">
40 <xsl:for-each select="MODULE">
41 <xsl:variable name="modInst_" select="@INSTANCE"/>
42 <xsl:variable name="modType_" select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $modInst_)]/@MODTYPE"/>
43 <xsl:call-template name="Define_Peripheral">
44 <xsl:with-param name="iModInst" select="$modInst_"/>
45 <xsl:with-param name="iModType" select="$modType_"/>
46 <xsl:with-param name="iShapeId" select="../@SHAPE_ID"/>
47 <xsl:with-param name="iHorizIdx" select="../@STACK_HORIZ_INDEX"/>
48 <xsl:with-param name="iVertiIdx" select="../@SHAPE_VERTI_INDEX"/>
54 <!-- Define the stack's memory shapes-->
55 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@STACK_HORIZ_INDEX = $iStackIdx) and (@MODCLASS='MEMORY_UNIT'))]">
56 <xsl:call-template name="Define_MemoryUnit">
57 <xsl:with-param name="iShapeId" select="@SHAPE_ID"/>
62 <!-- Define the stack's processors-->
63 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE[@INSTANCE and @BIFS_W and @BIFS_H and (@STACK_HORIZ_INDEX = $iStackIdx)]">
64 <xsl:call-template name="Define_Processor"/>
67 <!-- Make an inventory of all the things in this processor's stack -->
68 <xsl:variable name="pstackW_">
69 <xsl:call-template name="F_Calc_Stack_Width">
70 <xsl:with-param name="iStackIdx" select="$iStackIdx"/>
74 <xsl:variable name="pstackH_">
75 <xsl:call-template name="F_Calc_Stack_Height">
76 <xsl:with-param name="iStackIdx" select="$iStackIdx"/>
81 <xsl:message>Proc Stack Height <xsl:value-of select="$pstackH_"/></xsl:message>
82 <xsl:message>Proc Stack Height <xsl:value-of select="$pstackH_"/></xsl:message>
85 <xsl:variable name="procW_" select="$BLKD_MOD_W"/>
86 <xsl:variable name="procX_" select="(ceiling($pstackW_ div 2) - ceiling($procW_ div 2))"/>
88 <xsl:variable name="sbsGap_" select="($BLKD_PROC2SBS_GAP + $G_Total_SharedBus_H)"/>
90 <xsl:variable name="stack_name_">
91 <xsl:call-template name="F_generate_Stack_Name">
92 <xsl:with-param name="iHorizIdx" select="$iStackIdx"/>
97 <xsl:message>Horiz index<xsl:value-of select="$stackIdx"/></xsl:message>
98 <xsl:message>Drawing stack <xsl:value-of select="$stack_name_"/></xsl:message>
101 <!-- Now use all this stuff to draw the stack-->
102 <g id="{$stack_name_}">
107 width = "{$pstackW_}"
108 height= "{$pstackH_}"
109 style="fill:{$COL_BG}; stroke:none;"/>
112 <!-- First draw the the processor's peripherals-->
113 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@STACK_HORIZ_INDEX = $iStackIdx)]">
114 <xsl:sort select="@STACK_VERTI_INDEX" data-type="number"/>
117 <xsl:variable name="shapeW_" select="(@MODS_W * $BLKD_MOD_W)"/>
118 <xsl:variable name="shapeX_" select="(ceiling($pstackW_ div 2) - ceiling($shapeW_ div 2))"/>
120 <xsl:variable name="stack_SymName_">
121 <xsl:call-template name="F_generate_Stack_SymbolName">
122 <xsl:with-param name="iHorizIdx" select="@STACK_HORIZ_INDEX"/>
123 <xsl:with-param name="iVertiIdx" select="@SHAPE_VERTI_INDEX"/>
128 <xsl:message>Drawing stack peripheral <xsl:value-of select="$stack_SymName_"/></xsl:message>
130 <xsl:variable name="shapeY_">
131 <xsl:call-template name="F_Calc_Stack_Shape_Y">
132 <xsl:with-param name="iHorizIdx" select="@STACK_HORIZ_INDEX"/>
133 <xsl:with-param name="iVertiIdx" select="@SHAPE_VERTI_INDEX"/>
137 <use x="{$shapeX_}" y="{$shapeY_}" xlink:href="#{$stack_SymName_}"/>
142 <!-- Then draw the slave buckets for the shared busses that this processor is master to -->
143 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/SBSBUCKETS/SBSBUCKET[(@STACK_HORIZ_INDEX = $iStackIdx)]">
144 <xsl:sort select="@SHAPE_VERTI_INDEX" data-type="number"/>
146 <xsl:variable name="bucketW_" select="(($BLKD_MOD_BKTLANE_W * 2) + (($BLKD_MOD_W * @MODS_W) + ($BLKD_MOD_BUCKET_G * (@MODS_W - 1))))"/>
147 <xsl:variable name="bucketX_" select="(ceiling($pstackW_ div 2) - ceiling($bucketW_ div 2))"/>
149 <xsl:variable name="bucketY_">
150 <xsl:call-template name="F_Calc_Stack_Shape_Y">
151 <xsl:with-param name="iHorizIdx" select="@STACK_HORIZ_INDEX"/>
152 <xsl:with-param name="iVertiIdx" select="@SHAPE_VERTI_INDEX"/>
157 <xsl:message>SBS Bucket Y <xsl:value-of select="$bucketY_"/></xsl:message>
160 <use x="{$bucketX_}" y="{$bucketY_}" xlink:href="#sbsbucket_{@BUSNAME}"/>
162 <xsl:variable name="slavesOfTxt_">SLAVES OF <xsl:value-of select="@BUSNAME"/></xsl:variable>
164 <text class="bkt_label"
166 y="{$bucketY_ - 4}"><xsl:value-of select="$slavesOfTxt_"/></text>
169 <xsl:call-template name="F_WriteText">
170 <xsl:with-param name="iX" select="$bucketX_"/>
171 <xsl:with-param name="iY" select="($bucketY_ - 4)"/>
172 <xsl:with-param name="iText" select="$slavesOfTxt_"/>
173 <xsl:with-param name="iClass" select="'bkt_label'"/>
179 <!-- Then draw the the processor itself -->
180 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE[(@STACK_HORIZ_INDEX = $iStackIdx)]">
181 <xsl:sort select="@SHAPE_VERTI_INDEX" data-type="number"/>
183 <xsl:variable name="procY_">
184 <xsl:call-template name="F_Calc_Stack_Shape_Y">
185 <xsl:with-param name="iHorizIdx" select="@STACK_HORIZ_INDEX"/>
186 <xsl:with-param name="iVertiIdx" select="@SHAPE_VERTI_INDEX"/>
190 <xsl:variable name="stack_SymName_">
191 <xsl:call-template name="F_generate_Stack_SymbolName">
192 <xsl:with-param name="iHorizIdx" select="@STACK_HORIZ_INDEX"/>
193 <xsl:with-param name="iVertiIdx" select="@SHAPE_VERTI_INDEX"/>
197 <use x="{$procX_}" y="{$procY_}" xlink:href="#{$stack_SymName_}"/>
201 <xsl:if test = "not(@IS_LIKEPROC)">
202 <text class="ipclass_label"
204 y="{$procY_ - 4}">PROCESSOR</text>
207 <xsl:if test = "@IS_LIKEPROC = 'TRUE'">
209 <text class="ipclass_label"
211 y="{$procY_ - 4}">USER MODULE</text>
216 <xsl:if test = "not(@IS_LIKEPROC)">
217 <xsl:call-template name="F_WriteText">
218 <xsl:with-param name="iX" select="$procX_"/>
219 <xsl:with-param name="iY" select="($procY_ - 4)"/>
220 <xsl:with-param name="iText" select="'PROCESSOR'"/>
221 <xsl:with-param name="iClass" select="'ipclass_label'"/>
225 <xsl:if test = "@IS_LIKEPROC = 'TRUE'">
226 <xsl:call-template name="F_WriteText">
227 <xsl:with-param name="iX" select="$procX_"/>
228 <xsl:with-param name="iY" select="($procY_ - 4)"/>
229 <xsl:with-param name="iText" select="'USER MODULE'"/>
230 <xsl:with-param name="iClass" select="'ipclass_label'"/>
240 <xsl:template name="Define_Processor">
241 <xsl:param name="iProcInst" select="@INSTANCE"/>
242 <xsl:param name="iModType" select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iProcInst)]/@MODTYPE"/>
244 <xsl:variable name="label_y_">
245 <xsl:value-of select="$BLKD_MOD_LANE_H"/>
249 <xsl:message>The proctype is <xsl:value-of select="$procType"/></xsl:message>
252 <xsl:variable name="procH_" select="(($BLKD_MOD_LANE_H * 2) + (($BLKD_BIF_H + $BLKD_MOD_BIF_GAP_V) * @BIFS_H) + ($BLKD_MOD_LABEL_H + $BLKD_MOD_BIF_GAP_V))"/>
253 <xsl:variable name="procW_" select="(($BLKD_MOD_LANE_W * 2) + (($BLKD_BIF_W * @BIFS_W) + $BLKD_MOD_BIF_GAP_H))"/>
255 <xsl:variable name="procColor_">
257 <xsl:when test="contains($iModType,'microblaze')"><xsl:value-of select="$COL_PROC_BG_MB"/></xsl:when>
258 <xsl:when test="contains($iModType,'ppc')"><xsl:value-of select="$COL_PROC_BG_PP"/></xsl:when>
260 <xsl:value-of select="$COL_PROC_BG_USR"/>
266 <xsl:message>The proc color is <xsl:value-of select="$procColor"/></xsl:message>
269 <xsl:variable name="procName_">
270 <xsl:call-template name="F_generate_Stack_SymbolName">
271 <xsl:with-param name="iHorizIdx" select="@STACK_HORIZ_INDEX"/>
272 <xsl:with-param name="iVertiIdx" select="@SHAPE_VERTI_INDEX"/>
277 <xsl:message>The proc name is <xsl:value-of select="$procName_"/></xsl:message>
280 <g id="{$procName_}">
288 style="fill:{$procColor_}; stroke:{$COL_WHITE}; stroke-width:2"/>
291 <rect x="{ceiling($procW_ div 2) - ceiling($BLKD_MOD_LABEL_W div 2)}"
292 y="{$BLKD_MOD_LANE_H}"
295 width= "{$BLKD_MOD_LABEL_W}"
296 height="{$BLKD_MOD_LABEL_H}"
297 style="fill:{$COL_WHITE}; stroke:none;"/>
299 <text class="bciptype"
300 x="{ceiling($procW_ div 2)}"
301 y="{$BLKD_MOD_LANE_H + 8}">
302 <xsl:value-of select="$iModType"/>
305 <text class="bciplabel"
306 x="{ceiling($procW_ div 2)}"
307 y="{$BLKD_MOD_LANE_H + 16}">
308 <xsl:value-of select="$iProcInst"/>
312 <xsl:call-template name="F_WriteText">
313 <xsl:with-param name="iX" select="ceiling($procW_ div 2)"/>
314 <xsl:with-param name="iY" select="($BLKD_MOD_LANE_H + 8)"/>
315 <xsl:with-param name="iText" select="$iModType"/>
316 <xsl:with-param name="iClass" select="'bc_iptype'"/>
319 <xsl:call-template name="F_WriteText">
320 <xsl:with-param name="iX" select="ceiling($procW_ div 2)"/>
321 <xsl:with-param name="iY" select="($BLKD_MOD_LANE_H + 16)"/>
322 <xsl:with-param name="iText" select="$iProcInst"/>
323 <xsl:with-param name="iClass" select="'bc_ipinst'"/>
328 <xsl:if test="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iProcInst)]/@GROUP">
330 <rect x="{ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_MOD_LABEL_W div 2)}"
331 y="{$BLKD_MOD_LANE_H + $BIF_H + ceiling($BLKD_BIF_H div 3) - 2}"
334 width= "{$BLKD_MOD_LABEL_W}"
335 height="{$BLKD_BIF_H}"
336 style="fill:{$COL_IORING_LT}; stroke:none;"/>
338 <text class="ioplblgrp"
339 x="{ceiling($BLKD_MOD_W div 2)}"
340 y="{$BLKD_MOD_LANE_H + $BIF_H + ceiling($BIF_H div 3) + 12}">
341 <xsl:value-of select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iProcInst)]/@GROUP"/>
344 <xsl:call-template name="F_WriteText">
345 <xsl:with-param name="iX" select="ceiling($BLKD_MOD_W div 2)"/>
346 <xsl:with-param name="iY" select="($BLKD_MOD_LANE_H + $BIF_H + ceiling($BIF_H div 3) + 12)"/>
347 <xsl:with-param name="iText" select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iProcInst)]/@GROUP"/>
348 <xsl:with-param name="iClass" select="'iogrp_label'"/>
354 <xsl:for-each select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iProcInst)]/BUSINTERFACE[(@BIF_X and @BIF_Y)]">
356 <xsl:variable name="bifBusStd_">
358 <xsl:when test="@BUSSTD">
359 <xsl:value-of select="@BUSSTD"/>
362 <xsl:value-of select="'TRS'"/>
367 <xsl:variable name="bifBusColor_">
368 <xsl:call-template name="F_BusStd2RGB">
369 <xsl:with-param name="iBusStd" select="$bifBusStd_"/>
374 <xsl:variable name="bifName_">
376 <xsl:when test="string-length(@NAME) <= 5">
377 <xsl:value-of select="@NAME"/>
380 <xsl:value-of select="substring(@NAME,0,5)"/>
385 <xsl:variable name="bif_x_" select="(( $BLKD_BIF_W * @BIF_X) + ($BLKD_MOD_BIF_GAP_H * @BIF_X) + ($BLKD_MOD_LANE_W * 1))"/>
386 <xsl:variable name="bif_y_" select="((($BLKD_BIF_H + $BLKD_MOD_BIF_GAP_V) * @BIF_Y) + ($BLKD_MOD_LANE_H + $BLKD_MOD_LABEL_H + $BLKD_MOD_BIF_GAP_V))"/>
388 <xsl:variable name="horz_line_y_" select="($bif_y_ + ceiling($BLKD_BIFC_H div 2))"/>
390 <xsl:variable name="horz_line_x1_">
392 <xsl:when test="@BIF_X = '0'">0</xsl:when>
393 <xsl:otherwise><xsl:value-of select="($BLKD_MOD_W - $BLKD_MOD_LANE_W)"/></xsl:otherwise>
397 <xsl:variable name="horz_line_x2_">
399 <xsl:when test="@BIF_X = '0'"><xsl:value-of select="$BLKD_MOD_LANE_W"/></xsl:when>
400 <xsl:otherwise><xsl:value-of select="$BLKD_MOD_W + 1"/></xsl:otherwise>
405 <line x1="{$horz_line_x1_}"
406 y1="{$horz_line_y_ - 2}"
407 x2="{$horz_line_x2_}"
408 y2="{$horz_line_y_ - 2}"
409 style="stroke:{$bifBusColor_};stroke-width:1"/>
411 <use x="{$bif_x_}" y="{$bif_y_}" xlink:href="#{$bifBusStd_}_BifLabel"/>
414 <text class="bif_label"
415 x="{$bif_x_ + ceiling($BIF_W div 2)}"
416 y="{$bif_y_ + ceiling($BIF_H div 2) + 3}">
417 <xsl:value-of select="$bifName_"/>
421 <xsl:call-template name="F_WriteText">
422 <xsl:with-param name="iX" select="($bif_x_ + ceiling($BIF_W div 2))"/>
423 <xsl:with-param name="iY" select="($bif_y_ + ceiling($BIF_H div 2) + 3)"/>
424 <xsl:with-param name="iText" select="$bifName_"/>
425 <xsl:with-param name="iClass" select="'bif_label'"/>
430 <xsl:variable name="intcIdx_">
432 <xsl:when test="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iProcInst)]/INTERRUPTINFO/@INTC_INDEX">
433 <xsl:value-of select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iProcInst)]/INTERRUPTINFO/@INTC_INDEX"/>
435 <xsl:otherwise>"_no_interrupt_cntlr_"</xsl:otherwise>
440 <xsl:message> The intc index should <xsl:value-of select="$interrupt_cntlr_"/></xsl:message>
441 <xsl:message> The intc index is <xsl:value-of select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $interrupt_cntlr_)]/@INTC_INDEX"/></xsl:message>
443 <xsl:if test="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(INTERRUPTINFO[(@INTC_INDEX = $intcIdx_)])]">
445 <xsl:variable name="intrColor_">
446 <xsl:call-template name="F_IntcIdx2RGB">
447 <xsl:with-param name="iIntcIdx" select="$intcIdx_"/>
449 <xsl:with-param name="iIntcIdx" select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $interrupt_cntlr_)]/INTERRUPTINFO/@INTC_INDEX"/>
454 <xsl:call-template name="F_draw_InterruptedProc">
455 <xsl:with-param name="iIntr_X" select="($BLKD_MOD_W - ceiling($BLKD_INTR_W div 2))"/>
456 <xsl:with-param name="iIntr_Y" select="3"/>
457 <xsl:with-param name="iIntr_COL" select="$intrColor_"/>
458 <xsl:with-param name="iIntr_IDX" select="$intcIdx_"/>