]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/PPC405_Xilinx_Virtex4_GCC/__xps/.dswkshop/MdtSvgBLKD_Peripherals.xsl
Prepare for V9.0.0 release.
[freertos] / FreeRTOS / Demo / PPC405_Xilinx_Virtex4_GCC / __xps / .dswkshop / MdtSvgBLKD_Peripherals.xsl
1 <?xml version="1.0" standalone="no"?>
2                         
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">
10                                 
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"/>
14                         
15 <!--    
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"/>
18 -->     
19
20
21 <!-- ======================= DEF FUNCTIONS =================================== -->
22
23 <xsl:template name="Define_FreeCmplxModules">
24         
25         <xsl:for-each select="BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@IS_PROMOTED and not(@IS_PENALIZED) and not(@STACK_INDEX))]">  
26                 
27                 <xsl:variable name="cmplxId_" select="position()"/>
28                 
29                 <xsl:if test="@MODCLASS='MEMORY_UNIT'">
30                         <xsl:call-template name="Define_PeripheralMemory">
31                                 <xsl:with-param name="iPeriId" select="$cmplxId_"/>
32                         </xsl:call-template>
33                 </xsl:if>
34                 
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_"/>
41                         </xsl:call-template>            
42                 </xsl:if>
43                 
44         </xsl:for-each>         
45 </xsl:template> 
46
47
48 <xsl:template name="Define_PenalizedModules">
49         
50         <xsl:for-each select="BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@IS_PROMOTED and @IS_PENALIZED)]">     
51                 
52                 <xsl:variable name="penalId_">unkmodule_<xsl:value-of select="@BKTROW"/>_<xsl:value-of select="@MODS_X"/></xsl:variable>
53                 
54 <!--            
55                 <xsl:message>Drawing penalized module <xsl:value-of select="$penalId_"/></xsl:message>
56 -->             
57                 
58                 <xsl:if test="@MODCLASS='MEMORY_UNIT'">
59                         <xsl:call-template name="Define_PeripheralMemory">
60                                 <xsl:with-param name="iPeriId" select="$penalId_"/>
61                         </xsl:call-template>
62                 </xsl:if>
63                 
64 <!--            
65                 <xsl:if test="((@MODCLASS='MASTER_SLAVE') or (@MODCLASS = 'MONITOR'))">
66 -->             
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_"/>
73                         </xsl:call-template>            
74 <!--                    
75                 </xsl:if>
76 -->             
77                 
78         </xsl:for-each>         
79 </xsl:template> 
80
81
82 <xsl:template name="Define_IPBucket">
83                         
84         <xsl:for-each select="BLKDSHAPES/IPBUCKET">
85                 
86                 <xsl:for-each select="MODULE">  
87                         
88                         <xsl:call-template name="Define_IPBucketModule">
89                                 <xsl:with-param name="iIPType"   select="@MODTYPE"/>
90                                 <xsl:with-param name="iIPName"   select="@INSTANCE"/>
91                         </xsl:call-template>    
92                         
93                 </xsl:for-each>         
94                 
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))))"/>
98                 
99                 <rect x="0" 
100                       y="0"  
101                           rx="4"
102                           ry="4"
103                       width= "{$bucket_w_}" 
104                       height="{$bucket_h_}" 
105                       style="stroke-width:2; stroke:{$COL_BLACK}; fill:{$COL_IORING_LT}"/>
106                                  
107                         <xsl:variable name="bkt_mods_w_" select="@MODS_W"/>
108                         
109                         <xsl:for-each select="MODULE">  
110                                 
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_)"/>
113                                 
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))"/>
116                                 
117                                          
118                                 <use x="{$bk_x_}"   
119                                          y="{$bk_y_}" 
120                                          xlink:href="#ipbktmodule_{@INSTANCE}"/>                                  
121                                          
122                                          
123                         </xsl:for-each>          
124                                          
125         </symbol>               
126         
127 </xsl:for-each> 
128 </xsl:template> 
129
130
131 <xsl:template name="Define_UNKBucket">
132                         
133         <xsl:for-each select="BLKDSHAPES/UNKBUCKET">
134         
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))))"/>
138                 
139                 <rect x="0" 
140                       y="0"  
141                           rx="4"
142                           ry="4"
143                       width= "{$bucket_w_}" 
144                       height="{$bucket_h_}" 
145                       style="stroke-width:2; stroke:{$COL_BLACK}; fill:{$COL_BG_UNK}"/>
146                                  
147                         <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@IS_PROMOTED and @IS_PENALIZED)]">  
148                         
149                         <xsl:variable name="bkt_mods_w_" select="@MODS_W"/>
150                                 
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"/>        
153
154 <!--                            
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>
157 -->                             
158                                 
159                                 
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))"/>
162                                 
163                                 <use x="{$bk_x_}"   
164                                          y="{$bk_y_}" 
165                                          xlink:href="#symbol_unkmodule_{@BKTROW}_{@MODS_X}"/>                             
166 <!--                             
167 -->                              
168
169                         </xsl:for-each>          
170
171                         
172                 </symbol>               
173                 
174         </xsl:for-each> 
175 </xsl:template> 
176
177                 
178 <xsl:template name="Define_SBSBuckets">
179         
180         <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/SBSBUCKETS/SBSBUCKET">      
181                 
182                 <xsl:variable name="bus_name_"   select="@BUSNAME"/>
183                 <xsl:variable name="bus_std_"    select="@BUSSTD"/>
184 <!--            
185                 <xsl:variable name="bus_std_"    select="BUSCONNS/BUSCONN/@BUSSTD"/>
186 -->     
187                 <xsl:variable name="bus_conn_w_" select="BUSCONNS/@BUSLANE_W"/>
188                 
189                 <xsl:variable name="bucket_bg_col_">
190                         <xsl:call-template name="BusType2LightColor">
191                                 <xsl:with-param name="iBusType" select="$bus_std_"/>
192                         </xsl:call-template>
193                 </xsl:variable>
194                 
195                 <xsl:variable name="bucket_col_">
196                         <xsl:call-template name="BusType2Color">
197                                 <xsl:with-param name="iBusType" select="$bus_std_"/>
198                         </xsl:call-template>
199                 </xsl:variable>
200                 
201                 
202                 <xsl:for-each select="MODULE">  
203                         
204                         <xsl:sort data-type="text" select="@INSTANCE" order="ascending"/>
205                 
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"/>
210                         </xsl:call-template>    
211                         
212                 </xsl:for-each>         
213                 
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))))"/>
217                         
218                         <rect x="0"
219                               y="0"  
220                                   rx="4"
221                                   ry="4"
222                               width= "{$bucket_w_}" 
223                               height="{$bucket_h_}" 
224                               style="stroke-width:2; stroke:{$bucket_col_}; fill:{$bucket_bg_col_}"/>
225                                  
226                         <xsl:variable name="bkt_mods_w_" select="@MODS_W"/>
227                         
228                         <xsl:for-each select="MODULE">  
229                                 
230                                 <xsl:sort data-type="text" select="@INSTANCE" order="ascending"/>
231                                 
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_)"/>
234                                 
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))"/>
237                                          
238                                 <!-- Lay out the module in the bucket -->
239                                  <use x="{$bk_x_}" y="{$bk_y_}"  xlink:href="#sbsbktmodule_{@INSTANCE}"/>                 
240                                 
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)"/>
243                                 
244 <!--                            
245                                 <xsl:variable name="h_bus_x_" select="$bk_x_ - ($BLKD_MOD_BUCKET_G + ceiling($BLKD_MOD_W div 2))"/>
246 -->     
247                                 <xsl:variable name="h_bus_x_">
248                                         <xsl:choose>
249                                                 <xsl:when test="($clm_ = '0')">0</xsl:when>
250                                         
251                                                 <xsl:when test="not($clm_ = '0')">
252                                                         <xsl:value-of select="$bk_x_ - ($BLKD_MOD_BUCKET_G + ceiling($BLKD_MOD_W div 2))"/>
253                                                 </xsl:when>
254                                         </xsl:choose>
255                                 </xsl:variable>
256                                 
257 <!--                            
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>
261 -->     
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))"/> 
264                                 
265                                 <rect x="{$h_bus_x_}" 
266                                   y="{$h_bus_y_}"  
267                                   width= "{$h_bus_width_}" 
268                                   height="{$BLKD_P2P_BUS_W}" 
269                                   style="fill:{$bucket_col_}"/>
270                                 
271                         </xsl:for-each>
272                         
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)"/>
275                         
276                         <!-- If there is more than one row, connect the rows with a vertical bar -->            
277                         <xsl:if test="($num_sbsbktrows_ &gt; 1)">
278                                 
279                                 <xsl:variable name="v_bus_x_"    select="$BLKD_MOD_BKTLANE_W + ($BLKD_MOD_W + $BLKD_MOD_BUCKET_G)"/>
280                                 
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))"/>
283                                 
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)"/>
286                                 
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_)"/>
289                                 <rect x="0" 
290                                   y="{$v_bus_y_top_}"  
291                                   width= "{$v_bus_width_}" 
292                                   height="{$v_bus_height_}" 
293                                   style="fill:{$bucket_col_}"/>
294                         </xsl:if>
295                         
296                 </symbol>
297                 
298         </xsl:for-each>         
299         
300         
301 </xsl:template> 
302         
303         
304 <xsl:template name="Define_SBSBucketModule">
305         
306         <xsl:param name="iBifType"  select="'OPB'"/>
307         <xsl:param name="iIPName"   select="'_ipType_'"/>
308         <xsl:param name="iIPType"   select="'_ipName_'"/>
309         
310 <!--    
311         <xsl:message>The IPType is <xsl:value-of select="$iIPType"/> </xsl:message>
312 -->     
313         <xsl:variable name="bif_y_">
314                 <xsl:value-of select="$BLKD_MOD_LANE_H + $BLKD_BIFC_H"/>        
315         </xsl:variable>
316
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"/>   
319         </xsl:variable>
320         
321         <xsl:variable name="modBg_Col_">
322                 <xsl:choose>
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>
325                 </xsl:choose>
326         </xsl:variable>
327         
328     <symbol id="sbsbktmodule_{$iIPName}">
329                 
330                 <rect x="0"
331                       y="{$BLKD_BIFC_H}"
332                           rx="6" 
333                           ry="6" 
334                       width = "{$BLKD_MOD_W}"
335                       height= "{$BLKD_MOD_H}"
336                           style="fill:{$modBg_Col_}; stroke:{$COL_WHITE}; stroke-width:2"/>             
337                           
338                 <rect x="{ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_MOD_LABEL_W div 2)}"
339                       y="{$label_y_}"
340                           rx="3" 
341                           ry="3" 
342                       width= "{$BLKD_MOD_LABEL_W}"
343                       height="{$BLKD_MOD_LABEL_H}"
344                           style="fill:{$COL_WHITE}; stroke:none;"/>             
345                 
346                 <xsl:if test="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$iIPName)]/@GROUP">
347                 
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}"
350                               rx="3" 
351                               ry="3" 
352                           width= "{$BLKD_MOD_LABEL_W}"
353                           height="{$BLKD_BIF_H}"
354                                   style="fill:{$COL_IORING_LT}; stroke:none;"/>         
355                           
356         
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"/>
361                         </text>
362            
363                 </xsl:if> 
364            
365                 <text class="bciptype" 
366                           x="{ceiling($BLKD_MOD_W div 2)}"
367                           y="{$label_y_ + 8}">
368                                 <xsl:value-of select="$iIPType"/>
369                 </text>
370                                 
371                 <text class="bciplabel" 
372                           x="{ceiling($BLKD_MOD_W div 2)}"
373                           y="{$label_y_ + 16}">
374                                 <xsl:value-of select="$iIPName"/>
375            </text>
376            
377                 <xsl:for-each select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iIPName)]/BUSINTERFACE[not(@BUSNAME = '__NOC__')]">
378                         
379                         <xsl:variable name="bif_busstd_">
380                                 <xsl:choose>
381                                         <xsl:when test="@BUSSTD">
382                                                 <xsl:value-of select="@BUSSTD"/>        
383                                         </xsl:when>
384                                         <xsl:otherwise>
385                                                 <xsl:value-of select="'TRS'"/>  
386                                         </xsl:otherwise>
387                                 </xsl:choose>
388                         </xsl:variable>
389                         
390                         <xsl:variable name="bif_name_">
391                                 <xsl:choose>
392                                         <xsl:when test="string-length(@NAME) &lt;= 5">
393                                                 <xsl:value-of select="@NAME"/>  
394                                         </xsl:when>
395                                         <xsl:otherwise>
396                                                 <xsl:value-of select="substring(@NAME,0,5)"/>   
397                                         </xsl:otherwise>
398                                 </xsl:choose>
399                         </xsl:variable>
400         
401                     <xsl:variable name="bif_x_"  select="ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_BIF_W div 2)"/>
402                         
403                         <!-- Draw the BIF -->
404                         <use  x="{$bif_x_}"   y="{$bif_y_}"  xlink:href="#{$bif_busstd_}_Bif"/>
405                         
406 <!--                    
407                         <symbol id="{$bus_type}_busconn_SLAVE"> 
408 -->              
409          
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}"/>
412                                 
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_"/>
417                         </text>
418                         
419                 </xsl:for-each>
420                 
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"/>
425                                 </xsl:call-template>    
426                         </xsl:variable>
427                         
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"/>
433                         </xsl:call-template>    
434                 </xsl:if>
435                 
436                       
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"/>
441                                 </xsl:call-template>    
442                         </xsl:variable>
443                         
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"/>
450                         </xsl:call-template>    
451                         
452                 </xsl:for-each>
453                 
454         </symbol>                         
455         
456 </xsl:template> 
457
458 <xsl:template name="Define_IPBucketModule">
459         
460         <xsl:param name="iIPType"   select="'_ip_type_'"/>
461         <xsl:param name="iIPName"   select="'_ip_name_'"/>
462         
463         <xsl:variable name="bif_y_">
464                 <xsl:value-of select="$BLKD_MOD_LANE_H"/>       
465         </xsl:variable>
466
467         <xsl:variable name="label_y_">
468                 <xsl:value-of select="(ceiling($BLKD_MOD_H div 2) - ceiling($BLKD_MOD_LABEL_H div 2))"/>        
469         </xsl:variable>
470         
471     <symbol id="ipbktmodule_{$iIPName}">
472
473                 <rect x="0"
474                       y="0"
475                           rx="6" 
476                           ry="6" 
477                       width = "{$BLKD_MOD_W}"
478                       height= "{$BLKD_MOD_H}"
479                           style="fill:{$COL_BG}; stroke:{$COL_BLACK}; stroke-width:2"/>         
480                           
481                 <rect x="{ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_MOD_LABEL_W div 2)}"
482                       y="{$label_y_}"
483                           rx="3" 
484                           ry="3" 
485                       width= "{$BLKD_MOD_LABEL_W}"
486                       height="{$BLKD_MOD_LABEL_H}"
487                           style="fill:{$COL_WHITE}; stroke:none;"/>             
488                           
489 <!--
490                           y="{$label_y_ + ceiling($BLKD_MOD_LABEL_H div 2) - 4}"
491                           y="{$label_y_ + ceiling($BLKD_MOD_LABEL_H div 2) + 4}"
492 -->                       
493
494                 <text class="bciptype" 
495                           x="{ceiling($BLKD_MOD_W div 2)}"
496                           y="{$label_y_ + 8}">
497                                 <xsl:value-of select="$iIPType"/>
498                 </text>
499                                 
500                 <text class="bciplabel" 
501                           x="{ceiling($BLKD_MOD_W div 2)}"
502                           y="{$label_y_ + 16}">
503                                 <xsl:value-of select="$iIPName"/>
504            </text>
505            
506                 <xsl:if test="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iIPName)]/@GROUP">
507                 
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}"
510                           rx="3" 
511                           ry="3" 
512                       width= "{$BLKD_MOD_LABEL_W}"
513                       height="{$BLKD_BIF_H}"
514                           style="fill:{$COL_IORING_LT}; stroke:none;"/>         
515                           
516         
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"/>
521                         </text>
522            
523                 </xsl:if> 
524                 
525                 <xsl:for-each select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$iIPName)]/INTCCNTLRTRGS/INTCTRG">
526                         
527                         <xsl:variable name="intr_col_">
528                                 <xsl:call-template name="intcIdx2Color">
529                                         <xsl:with-param name="iIntcIdx" select="@INTCINDEX"/>
530                                 </xsl:call-template>    
531                         </xsl:variable>
532                         
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"/>
539                         </xsl:call-template>    
540                         
541                 </xsl:for-each>
542            
543         </symbol>                         
544         
545 </xsl:template> 
546         
547         
548 <xsl:template name="Define_Peripheral"> 
549 <!-- 
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 
553 -->     
554
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_'"/>
561         
562 <!--    
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>
565 -->     
566         
567         <xsl:variable name="modName_">
568                 <xsl:choose>
569                         <xsl:when test="$iUnkInst = '_unknown_'">
570                                 <xsl:value-of select="$iModInst"/>      
571                         </xsl:when>
572                         <xsl:otherwise>
573                                 <xsl:value-of select="$iUnkInst"/>      
574                         </xsl:otherwise>
575                 </xsl:choose>
576         </xsl:variable>
577         
578         <xsl:variable name="modSymbolName_">
579                 <xsl:choose>
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"/>
584                                 </xsl:call-template>            
585                         </xsl:when>
586                         <xsl:otherwise>symbol_<xsl:value-of select="$modName_"/></xsl:otherwise>
587                 </xsl:choose>
588         </xsl:variable>
589         
590         <xsl:variable name="modTypeName_" select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iModInst)]/@MODTYPE"/>
591         
592         
593 <!--    
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>
596 -->     
597         
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>
600         
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"/>
603                 </xsl:if>
604         
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"/>
607                 </xsl:if>
608         </xsl:variable>         
609         
610         <xsl:variable name="label_y_">
611                 <xsl:choose>
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_))"/>  
614                         </xsl:when>
615                         <xsl:otherwise>
616                                 <xsl:value-of select="$BLKD_MOD_LANE_H"/>       
617                         </xsl:otherwise>
618                 </xsl:choose>
619         </xsl:variable>
620         
621         <xsl:variable name="bif_dy_">
622                 <xsl:choose>
623                         <xsl:when test="$iModVori = 'rot180'">
624                                 <xsl:value-of select="$BLKD_MOD_LANE_H"/>       
625                         </xsl:when>
626                         <xsl:otherwise>
627                                 <xsl:value-of select="($BLKD_MOD_LANE_H + $BLKD_MOD_LABEL_H + $BLKD_MOD_BIF_GAP_V)"/>   
628                         </xsl:otherwise>
629                 </xsl:choose>
630         </xsl:variable>
631         
632         <xsl:variable name="peri_stroke_col_">
633                 <xsl:choose>
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"/>
637                                 </xsl:call-template>
638                         </xsl:when>
639                         
640                         <xsl:otherwise>
641                                 <xsl:value-of select="$COL_WHITE"/>
642                         </xsl:otherwise>
643                 </xsl:choose>
644         </xsl:variable>
645         
646         <xsl:variable name="modHeight_">
647                 <xsl:call-template name="_calc_PeriShape_Height">
648                         <xsl:with-param name="iShapeInst"  select="$modName_"/>
649                 </xsl:call-template>    
650         </xsl:variable>         
651         
652     <symbol id="{$modSymbolName_}">
653                 
654                 <xsl:if test="$modTypeName_ = 'mpmc'">
655                 <rect x="0"
656                       y="0"
657                           rx="6" 
658                           ry="6" 
659                       width = "{$BLKD_MOD_W}"
660                       height= "{$modHeight_}"
661                           style="fill:{$COL_MPMC_BG}; stroke:{$peri_stroke_col_}; stroke-width:2"/>             
662                 </xsl:if>       
663                 
664                 <xsl:if test="not($modTypeName_ = 'mpmc')">
665                 <rect x="0"
666                       y="0"
667                           rx="6" 
668                           ry="6" 
669                       width = "{$BLKD_MOD_W}"
670                       height= "{$modHeight_}"
671                           style="fill:{$COL_BG}; stroke:{$peri_stroke_col_}; stroke-width:2"/>          
672                 </xsl:if>       
673                 
674                                           
675                 <rect x="{ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_MOD_LABEL_W div 2)}"
676                       y="{$label_y_}"
677                           rx="3" 
678                           ry="3" 
679                       width= "{$BLKD_MOD_LABEL_W}"
680                       height="{$BLKD_MOD_LABEL_H}"
681                           style="fill:{$COL_WHITE}; stroke:none;"/>             
682                           
683 <!--                      
684                           y="{$label_y_ + ceiling($BLKD_MOD_LABEL_H div 2) - 4}">
685                           y="{$label_y_ + ceiling($BLKD_MOD_LABEL_H div 2) + 4}">
686 -->
687                           
688                 <text class="bciptype" 
689                           x="{ceiling($BLKD_MOD_W div 2)}"
690                           y="{$label_y_ + 8}">
691                                 <xsl:value-of select="$iModType"/>
692                 </text>
693                                 
694                 <text class="bciplabel" 
695                           x="{ceiling($BLKD_MOD_W div 2)}"
696                           y="{$label_y_ + 16}">
697                                 <xsl:value-of select="$iModInst"/>
698            </text>
699            
700                 <xsl:if test="/EDKSYSTEM/MODULES/MODULE[@INSTANCE=$iModInst]/@GROUP">
701                 
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}"
704                           rx="3" 
705                           ry="3" 
706                       width= "{$BLKD_MOD_LABEL_W}"
707                       height="{$BLKD_BIF_H}"
708                           style="fill:{$COL_IORING_LT}; stroke:none;"/>         
709                           
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"/>
714                         </text>
715            
716                 </xsl:if> 
717            
718                 <xsl:for-each select="/EDKSYSTEM/MODULES/MODULE[@INSTANCE=$iModInst]/BUSINTERFACE[(@BIF_X and @BIF_Y and not(@BUSNAME = '__NOC__'))]">
719                         
720                         <xsl:variable name="bif_busstd_">
721                                 <xsl:choose>
722                                         <xsl:when test="@BUSSTD">
723                                                 <xsl:value-of select="@BUSSTD"/>        
724                                         </xsl:when>
725                                         <xsl:otherwise>
726                                                 <xsl:value-of select="'TRS'"/>  
727                                         </xsl:otherwise>
728                                 </xsl:choose>
729                         </xsl:variable>
730                         
731                         <xsl:variable name="bif_y_">
732                                 <xsl:value-of select="(($BLKD_BIF_H + $BLKD_MOD_BIF_GAP_V)  * @BIF_Y)"/>
733                         </xsl:variable>
734                         
735                         <xsl:variable name="bif_buscol_">
736                                 <xsl:call-template name="BusType2Color">
737                                         <xsl:with-param name="iBusType" select="$bif_busstd_"/>
738                                 </xsl:call-template>
739                         </xsl:variable>
740                 
741                         
742                         <xsl:variable name="bif_name_">
743                                 <xsl:choose>
744                                         <xsl:when test="not(@NAME)">'UNK'</xsl:when>
745                                         <xsl:when test="string-length(@NAME) &lt;= 5">
746                                                 <xsl:value-of select="@NAME"/>  
747                                         </xsl:when>
748                                         <xsl:otherwise>
749                                                 <xsl:value-of select="substring(@NAME,0,5)"/>   
750                                         </xsl:otherwise>
751                                 </xsl:choose>
752                         </xsl:variable>
753         
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))"/>
757                                 </xsl:if>
758                                 <xsl:if test="(@ORIENTED='CENTER')">
759                                         <xsl:value-of select="ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_BIF_W div 2)"/>
760                                 </xsl:if>
761                         </xsl:variable> 
762                         
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))"/>
765                         
766                                 <xsl:variable name="horz_line_x1_">
767                                         <xsl:choose>
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>
770                                         </xsl:choose>
771                                 </xsl:variable>
772                         
773                                 <xsl:variable name="horz_line_x2_">
774                                         <xsl:choose>
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>
777                                         </xsl:choose>
778                                 </xsl:variable>
779                         
780                         
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"/>
786                           
787                         </xsl:if>
788                         
789                         <use  x="{$bif_x_}"   y="{$bif_y_ + $bif_dy_}"  xlink:href="#{$bif_busstd_}_Bif"/>
790                                 
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_"/>
795                         </text>
796                         
797                 </xsl:for-each>
798                 
799 <!--            
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"/>
804                                 </xsl:call-template>    
805                         </xsl:variable>
806                         
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"/>
812                         </xsl:call-template>    
813                 </xsl:if>
814 -->             
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"/>
819                                 </xsl:call-template>    
820                         </xsl:variable>
821                         
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"/>
827                         </xsl:call-template>    
828                 </xsl:if>
829                 
830                 
831                 <xsl:for-each select="/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iModInst)]/INTCCNTLRTRGS/INTCTRG">
832                         
833                         <xsl:variable name="intr_col_">
834                                 <xsl:call-template name="intcIdx2Color">
835                                         <xsl:with-param name="iIntcIdx" select="@INTCINDEX"/>
836                                 </xsl:call-template>    
837                         </xsl:variable>
838                         
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"/>
845                         </xsl:call-template>    
846                         
847                 </xsl:for-each>
848                 
849         </symbol>                         
850 </xsl:template> 
851         
852 <xsl:template name="Define_MemoryUnit"> 
853         <xsl:param name="iShapeId"  select="1000"/>
854         
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"/>
857         
858         <xsl:choose>
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"/>
862                         </xsl:call-template>
863                 </xsl:when>
864                 
865                 <xsl:otherwise>
866                         <xsl:call-template name="Define_StandAlone_MemoryUnit"> 
867                                 <xsl:with-param name="iShapeId"  select="$iShapeId"/>
868                         </xsl:call-template>
869                 </xsl:otherwise>
870                 
871         </xsl:choose>
872         
873 </xsl:template> 
874         
875         
876 <xsl:template name="Define_Processor_MemoryUnit"> 
877         <xsl:param name="iShapeId"  select="1000"/>
878         
879 <!--    
880         <xsl:param name="cstkIndex"    select="'_processor_'"/>
881 -->     
882         
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_)"/>
887         
888         <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]">
889                 
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"/>
894                 
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_"/>
899                         </xsl:call-template>            
900                 </xsl:for-each> 
901         
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"/>
905                 
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_"/>
910                         </xsl:call-template>            
911                 </xsl:for-each> 
912         </xsl:for-each>
913         
914 <!--    
915 -->     
916         
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"/>
921                 </xsl:call-template>            
922         </xsl:variable>
923         
924 <!--    
925         <xsl:message>The mp stack name is <xsl:value-of select="$mp_stack_name_"/></xsl:message>
926 -->     
927                 
928     <symbol id="{$symbol_name_}">
929
930                 <rect x="0"
931                       y="0"
932                           rx="6" 
933                           ry="6" 
934                       width = "{$memW_}"
935                       height= "{$memH_}"
936                           style="fill:{$COL_BG}; stroke:{$COL_WHITE}; stroke-width:2"/>         
937                           
938                 <!-- Draw the memory block-->             
939                 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[(@MODCLASS = 'MEMORY')]">
940                         
941                         <xsl:variable name="modInst_" select="@INSTANCE"/>
942                         
943                          <use  x="{ceiling($memW_ div 2) - ($BLKD_MOD_W div 2)}"  
944                                    y="0"  
945                                    xlink:href="#symbol_{$modInst_}"/> 
946                 </xsl:for-each>
947                 
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"/>
950                         
951                          <use  x="0"  
952                                    y="{$BLKD_MOD_H}"  
953                                    xlink:href="#symbol_{$modInst_}"/> 
954                 </xsl:for-each>
955                 
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"/>
958                         
959                          <use  x="{$BLKD_MOD_W}"  
960                                    y="{$BLKD_MOD_H}"  
961                                    xlink:href="#symbol_{$modInst_}"/> 
962                 </xsl:for-each>
963                 
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"/>
966                         
967                          <use  x="{ceiling($memW_ div 2) - ($BLKD_MOD_W div 2)}"  
968                                    y="{$BLKD_MOD_H}"  
969                                    xlink:href="#symbol_{$modInst_}"/> 
970                 </xsl:for-each>
971                 
972         </symbol>                         
973         
974 </xsl:template> 
975
976         
977 <xsl:template name="Define_StandAlone_MemoryUnit"> 
978         
979         <xsl:param name="iShapeId" select="0"/>
980         
981         <xsl:variable name="mods_h_"  select="@MODS_H"/>
982         <xsl:variable name="mods_w_"  select="@MODS_W"/>
983         
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"/>
986         
987 <!--    
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>
993 -->     
994         
995         <xsl:variable name="peri_col_">
996                 
997                 <xsl:choose>
998                         <xsl:when test="$mods_w_ &gt; 1">
999                                 <xsl:value-of select="$COL_BG"/>
1000                         </xsl:when>
1001                         
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>
1006                         </xsl:when>
1007                 
1008                         <xsl:otherwise>
1009                                 <xsl:call-template name="BusType2Color">
1010                                         <xsl:with-param name="iBusType" select="'TRS'"/>
1011                                 </xsl:call-template>
1012                         </xsl:otherwise>
1013                 </xsl:choose>           
1014                 
1015         </xsl:variable>  
1016         
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"/>
1021                 
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>            
1027         </xsl:for-each> 
1028         
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"/>
1032                 
1033 <!--            
1034                 <xsl:message>Memory cntlr inst <xsl:value-of select="$modInst_"/></xsl:message>
1035 -->             
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>            
1041         </xsl:for-each> 
1042         
1043         <xsl:variable name="memW_" select="($BLKD_MOD_W * $mods_w_)"/>
1044         <xsl:variable name="memH_" select="($BLKD_MOD_H * $mods_h_)"/>
1045         
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>            
1051         </xsl:variable>
1052         
1053                 
1054     <symbol id="{$symbol_name_}">
1055                 
1056                 <rect x="0"
1057                       y="0"
1058                           rx="6" 
1059                           ry="6" 
1060                       width = "{$memW_ + 4}"
1061                       height= "{$memH_ + 4}"
1062                           style="fill:{$peri_col_}; stroke:{$peri_col_}; stroke-width:2"/>              
1063                           
1064
1065                 <!-- Draw the memory block-->             
1066                 <xsl:choose>
1067                         
1068                 <xsl:when test="$mods_w_ = 1">
1069                         
1070                         <xsl:for-each select="MODULE[(@MODCLASS='MEMORY')]">    
1071                                 <xsl:variable name="modInst_" select="@INSTANCE"/>
1072                         
1073                                 <use  x="2"  
1074                                       y="{$BLKD_MOD_H + 2}"  
1075                                       xlink:href="#symbol_{$modInst_}"/> 
1076                         </xsl:for-each>
1077                 
1078                 
1079                 <!-- Draw the memory controllers-->               
1080                         <xsl:for-each select="MODULE[not(@MODCLASS='MEMORY')]"> 
1081                                 <xsl:variable name="modInst_" select="@INSTANCE"/>
1082                         
1083                                 <use  x="2"  
1084                                           y="0"  
1085                                       xlink:href="#symbol_{$modInst_}"/> 
1086                         </xsl:for-each>
1087                 </xsl:when>     
1088                 
1089                 <xsl:when test="$mods_w_ &gt; 1">
1090                         <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[(@MODCLASS = 'MEMORY')]">
1091                         
1092                                 <xsl:variable name="modInst_" select="@INSTANCE"/>
1093                         
1094                                  <use  x="{ceiling($memW_ div 2) - ($BLKD_MOD_W div 2)}"  
1095                                            y="{$BLKD_MOD_H + 2}"  
1096                                            xlink:href="#symbol_{$modInst_}"/> 
1097                         </xsl:for-each>
1098                 
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"/>
1101                         
1102                                 <use  x="0"  
1103                                       y="0"  
1104                                       xlink:href="#symbol_{$modInst_}"/> 
1105                         </xsl:for-each>
1106                 
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"/>
1109                         
1110                                 <use  x="{$BLKD_MOD_W}"  
1111                                       y="0"  
1112                                       xlink:href="#symbol_{$modInst_}"/> 
1113                         </xsl:for-each>
1114                 
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"/>
1117                         
1118                                 <use  x="{ceiling($memW_ div 2) - ($BLKD_MOD_W div 2)}"  
1119                                       y="0"  
1120                                           xlink:href="#symbol_{$modInst_}"/> 
1121                     </xsl:for-each>
1122                         
1123                 </xsl:when>     
1124                 </xsl:choose>
1125                           
1126         </symbol>                         
1127         
1128 </xsl:template> 
1129         
1130         
1131 <xsl:template name="Define_StandAlone_MPMC"> 
1132         
1133 <!--    
1134         <xsl:param name="drawarea_w"  select="500"/>
1135         <xsl:param name="drawarea_h"  select="500"/>
1136 -->     
1137         
1138         <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/MPMCSHAPE">
1139                 
1140                 <xsl:variable name="mpmcInst_" select="@INSTANCE"/>
1141                 <xsl:variable name="mpmcType_" select="/EDKSYSTEM/MODULES/MODULE[@INSTANCE=$mpmcInst_]/@MODTYPE"/>
1142 <!--            
1143                 <xsl:message>Drawing instance <xsl:value-of select="$mpmcInst_"/></xsl:message>
1144 -->             
1145                 
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)"/>
1148                 
1149                 <symbol id="mpmcmodule_{$mpmcInst_}">
1150                         <rect x="0"
1151                           y="0"
1152                           width = "{$mpmc_w_}"
1153                           height= "{$BLKD_MPMC_MOD_H}"
1154                               style="fill:{$COL_MPMC_BG}; stroke:{$COL_BLACK}; stroke-width:2"/>
1155                           
1156                     <rect x="{$BLKD_MOD_LANE_H}"
1157                           y="{$label_y_}"
1158                               rx="3"
1159                               ry="3"
1160                           width= "{$BLKD_MOD_LABEL_W}"
1161                           height="{$BLKD_MOD_LABEL_H}"
1162                               style="fill:{$COL_WHITE}; stroke:none;"/>
1163                         
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_"/>
1168                         </text>
1169                                 
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_"/>
1174                    </text>
1175                         
1176                         <text class="mpmctitle" 
1177                                   x="{ceiling($mpmc_w_ div 2)}"
1178                                   y="{$label_y_ + 16}">MPMC Module Interface</text>
1179 <!--                    
1180 -->     
1181            
1182                 </symbol>       
1183                 
1184         </xsl:for-each>
1185         
1186 </xsl:template> 
1187         
1188
1189 <!-- ======================= END DEF FUNCTIONS ============================ -->
1190
1191 <!-- ======================= UTILITY FUNCTIONS ============================ -->
1192
1193 <xsl:template name="_draw_InterruptSource">
1194
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"/>
1200         
1201                 <rect  
1202                         x="{$iIntr_X}"
1203                         y="{$iIntr_Y}"
1204                         rx="3"
1205                         ry="3"
1206                         width= "{$BLKD_INTR_W}" 
1207                         height="{ceiling($BLKD_INTR_H div 2)}" style="fill:{$iIntr_COL}; stroke:none; stroke-width:1"/> 
1208                         
1209                 <line x1="{$iIntr_X + ceiling($BLKD_INTR_W div 2)}" 
1210                           y1="{$iIntr_Y}"
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"/>
1214                           
1215                 <xsl:variable name="txt_ofs_">
1216                         <xsl:if test="($iIntr_PRI &gt; 9)">4.5</xsl:if>
1217                         <xsl:if test="not($iIntr_PRI &gt; 9)">0</xsl:if>
1218                 </xsl:variable>   
1219                 
1220                 <text class="intrsymbol" 
1221                           x="{$iIntr_X + 2 - $txt_ofs_}"
1222                           y="{$iIntr_Y + 8}">
1223                                 <xsl:value-of select="$iIntr_PRI"/>
1224                 </text>
1225                         
1226                 <text class="intrsymbol" 
1227                           x="{$iIntr_X + 2 + ceiling($BLKD_INTR_W div 2)}"
1228                           y="{$iIntr_Y + 8}">
1229                                 <xsl:value-of select="$iIntr_IDX"/>
1230                 </text>
1231                         
1232 </xsl:template>
1233
1234 <xsl:template name="_draw_InterruptCntrl">
1235
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"/>
1240         
1241                 <rect  
1242                         x="{$iIntr_X}"
1243                         y="{$iIntr_Y}"
1244                         rx="3"
1245                         ry="3"
1246                         width= "{ceiling($BLKD_INTR_W div 2)}" 
1247                         height="{$BLKD_INTR_H}" style="fill:{$iIntr_COL}; stroke:none; stroke-width:1"/> 
1248                         
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"/>
1254                           
1255                 <text class="intrsymbol" 
1256                           x="{$iIntr_X + 2}"
1257                           y="{$iIntr_Y + 8 + ceiling($BLKD_INTR_H div 2)}">
1258                                 <xsl:value-of select="$iIntr_IDX"/>
1259                 </text>
1260                         
1261 </xsl:template>
1262
1263
1264 <xsl:template name="_draw_InterruptedProc">
1265
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"/>
1270         
1271                 <rect  
1272                         x="{$iIntr_X}"
1273                         y="{$iIntr_Y}"
1274                         rx="3"
1275                         ry="3"
1276                         width= "{ceiling($BLKD_INTR_W div 2)}" 
1277                         height="{$BLKD_INTR_H}" style="fill:{$iIntr_COL}; stroke:none; stroke-width:1"/> 
1278                         
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"/>
1284                           
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"/>
1290                           
1291                 <text class="intrsymbol" 
1292                           x="{$iIntr_X + 2}"
1293                           y="{$iIntr_Y + 8 + ceiling($BLKD_INTR_H div 2)}">
1294                                 <xsl:value-of select="$iIntr_IDX"/>
1295                 </text>
1296                         
1297 </xsl:template>
1298
1299 <xsl:template name="_calc_CStackShapesAbv_Height">
1300         <xsl:param name="iCStackIndex"  select="100"/>
1301         <xsl:param name="iCSactkMods_Y" select="1000"/>
1302         
1303 <!--    
1304         <xsl:message>Stack Index <xsl:value-of select="$cstackIndex"/></xsl:message>
1305         
1306         <xsl:message>Stack Y <xsl:value-of select="$cstackModY"/></xsl:message>
1307 -->     
1308         <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@CSTACK_INDEX = $iCStackIndex)])">0</xsl:if>
1309         
1310         <xsl:if test="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@CSTACK_INDEX = $iCStackIndex)]">
1311         
1312                 <xsl:variable name="shapesAbv_Heights_">
1313                         <CSTACK_MOD HEIGHT="0"/>
1314                         
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 &lt; $iCStackMods_Y))]">
1317                                 
1318                                 <xsl:variable name="shapeHeight_">
1319                                         
1320                                         <xsl:choose>
1321                                                 
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>    
1326                                                 </xsl:when>
1327                                                 
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>    
1332                                                 </xsl:when>
1333                                                 
1334                                                 <xsl:otherwise>0</xsl:otherwise>
1335                                         </xsl:choose>
1336                                 </xsl:variable>
1337                                 
1338 <!--                            
1339                                 <xsl:message>Calculated height of cstack shape of type <xsl:value-of select="@MODCLASS"/> as <xsl:value-of select="$shapeHeight_"/></xsl:message>
1340 -->                     
1341                                 
1342                                 <CSTACK_MOD HEIGHT="{$shapeHeight_ + $BLKD_BIF_H}"/>
1343                         </xsl:for-each>
1344                 </xsl:variable>
1345                 
1346 <!--            
1347                 <xsl:message>Calculated height of cstack as <xsl:value-of select="sum(exsl:node-set($shapesAbv_Heights_)/CSTACK_MOD/@HEIGHT)"/></xsl:message>
1348 -->             
1349                 
1350                 <xsl:value-of select="sum(exsl:node-set($shapesAbv_Heights_)/CSTACK_MOD/@HEIGHT)"/>
1351         </xsl:if>
1352         
1353 </xsl:template>
1354
1355
1356 <xsl:template name="_calc_PeriShape_Height">
1357         <xsl:param name="iShapeInst"  select="'_shape_'"/>
1358         
1359 <!--    
1360         <xsl:message>Calculating height of <xsl:value-of select="$shapeInst"/></xsl:message>
1361 -->     
1362         
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>
1364         
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"/>
1367                 
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))"/>
1369         </xsl:if>
1370         
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"/>
1373                 
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))"/>
1375         </xsl:if>
1376         
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"/>
1379                 
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))"/>
1381         </xsl:if>
1382         
1383 </xsl:template>
1384         
1385 <xsl:template name="_calc_Shape_Height">
1386         <xsl:param name="iShapeId"  select="_shape_"/>
1387         
1388 <!--    
1389         <xsl:message>Calculating height of <xsl:value-of select="$shapeId"/></xsl:message>
1390 -->     
1391         
1392         <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)])">0</xsl:if>
1393         
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"/>
1396                 
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))"/>
1398         </xsl:if>
1399         
1400 </xsl:template>
1401
1402
1403 <xsl:template name="_calc_MemoryUnit_Height">
1404         <xsl:param name="iShapeId"  select="1000"/>
1405         
1406         <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)])">0</xsl:if>
1407         
1408         <xsl:if test="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]">
1409         
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"/>
1414                         </xsl:if>
1415                         
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>
1422                                         </xsl:variable>
1423                                         <MEM_CNTLR INSTANCE="{@INSTANCE}" HEIGHT="{$memC_height_}"/>
1424                                 </xsl:for-each>
1425                         </xsl:if>
1426                 </xsl:variable>
1427                 
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"/>
1432                         </xsl:if>
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>
1439                                         </xsl:variable>
1440                                         <BRAM INSTANCE="{@INSTANCE}" HEIGHT="{$bram_height_}"/>
1441                                 </xsl:for-each>
1442                         </xsl:if>
1443                 </xsl:variable>
1444                 
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)"/>
1448                 
1449                 <xsl:value-of select="$max_bram_height_ + $max_memC_height_"/>
1450         </xsl:if>
1451
1452 </xsl:template>
1453
1454
1455 <xsl:template name="_calc_SbsBucket_Height">
1456         <xsl:param name="iBucketId"  select="100"/>
1457         
1458 <!--    
1459         <xsl:message>Looking of height of bucket <xsl:value-of select="$bucketId"/></xsl:message>
1460 -->     
1461         <xsl:variable name="bkt_gap_" select="$BLKD_BIF_H"/>
1462         
1463         <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/SBSBUCKETS/SBSBUCKET[(@BUSINDEX = $iBucketId)])">0</xsl:if>
1464         
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"/>
1467                 
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_)"/>
1469         </xsl:if>
1470 </xsl:template>
1471         
1472 <!--
1473         ===============================================
1474         
1475                 Symbol Naming Functions
1476         
1477         ===============================================
1478 -->             
1479         
1480         
1481 <xsl:template name="_gen_Proc_StackName">
1482 <xsl:param name="iProcInst"  select="'_unknown_'"/>
1483 symbol_STACK_<xsl:value-of select="$iProcInst"/>
1484 </xsl:template>
1485         
1486 <xsl:template name="_gen_Proc_GroupName">
1487 <xsl:param name="iProcInst"  select="'_unknown_'"/>
1488 symbol_GROUP_<xsl:value-of select="$iProcInst"/>
1489 </xsl:template>
1490         
1491         
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>
1495         
1496
1497 <!-- ======================= END UTILITY FUNCTIONS  ======================= -->
1498 </xsl:stylesheet>
1499