]> git.sur5r.net Git - freertos/blob - Demo/MicroBlaze_Spartan-6_EthernetLite/PlatformStudioProject/__xps/.dswkshop/MdtTinySvgBLKD_Peripherals.xsl
Start to re-arrange files to include FreeRTOS+ in main download.
[freertos] / Demo / MicroBlaze_Spartan-6_EthernetLite / PlatformStudioProject / __xps / .dswkshop / MdtTinySvgBLKD_Peripherals.xsl
1 <?xml version="1.0" standalone="no"?>
2                         
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">
10                                 
11 <!--    
12 <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"
13                doctype-public="-//W3C//DTD SVG 1.0//EN"
14                    doctype-system="http://www.w3.org/TR/SVG/DTD/svg10.dtd"/>
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 <xsl:template name="Define_IPBucket">
23                         
24         <xsl:for-each select="BLKDIAGRAM/IPBUCKET">
25                 
26                 <xsl:for-each select="MODULE">  
27                         <xsl:sort data-type="text" select="@MODTYPE" order="ascending"/>
28                         
29                         <xsl:call-template name="Define_IPBucketModule">
30                                 <xsl:with-param name="iIPType"   select="@MODTYPE"/>
31                                 <xsl:with-param name="iIPName"   select="@INSTANCE"/>
32                         </xsl:call-template>    
33                         
34                 </xsl:for-each>         
35                 
36                 <g id="ipbucket">
37                         <xsl:variable name="bucket_w_"  select="(($BLKD_MOD_BKTLANE_W * 2) + (($BLKD_MOD_W * @MODS_W) + ($BLKD_MOD_BUCKET_G * (@MODS_W - 1))))"/>
38                         <xsl:variable name="bucket_h_"  select="(($BLKD_MOD_BKTLANE_H * 2) + (($BLKD_MOD_H * @MODS_H) + ($BLKD_MOD_BUCKET_G * (@MODS_H - 1))))"/>
39                 
40                 <rect x="0" 
41                       y="0"  
42                           rx="4"
43                           ry="4"
44                       width= "{$bucket_w_}" 
45                       height="{$bucket_h_}" 
46                       style="stroke-width:2; stroke:{$COL_BLACK}; fill:{$COL_IORING_LT}"/>
47                                  
48                         <xsl:variable name="bkt_mods_w_" select="@MODS_W"/>
49                         
50                         <xsl:for-each select="MODULE">  
51                                 
52                                 <xsl:variable name="clm_"   select="((     position() - 1)  mod $bkt_mods_w_)"/>
53                                 <xsl:variable name="row_"   select="floor((position() - 1)  div $bkt_mods_w_)"/>
54                                 
55                                 <xsl:variable name="bk_x_"  select="$BLKD_MOD_BKTLANE_W + ($clm_ * ($BLKD_MOD_W + $BLKD_MOD_BUCKET_G))"/>
56                                 <xsl:variable name="bk_y_"  select="$BLKD_MOD_BKTLANE_H + ($row_ * ($BLKD_MOD_H + $BLKD_MOD_BUCKET_G))"/>
57                                 
58                                          
59                                 <use x="{$bk_x_}"   
60                                          y="{$bk_y_}" 
61                                          xlink:href="#ipbktmodule_{@INSTANCE}"/>                                  
62                                          
63                                          
64                         </xsl:for-each>          
65                                          
66         </g>            
67         
68 </xsl:for-each> 
69 </xsl:template> 
70
71
72 <xsl:template name="Define_UNKBucket">
73                         
74         <xsl:for-each select="BLKDIAGRAM/UNKBUCKET">
75         
76                 <g id="unkbucket">
77                         <xsl:variable name="bucket_w_"  select="(($BLKD_MOD_BKTLANE_W * 2) + (($BLKD_MOD_W * @MODS_W) + ($BLKD_MOD_BUCKET_G * (@MODS_W - 1))))"/>
78                         <xsl:variable name="bucket_h_"  select="(($BLKD_MOD_BKTLANE_H * 2) + (($BLKD_MOD_H * @MODS_H) + ($BLKD_MOD_BUCKET_G * (@MODS_H - 1))))"/>
79                 
80                 <rect x="0" 
81                       y="0"  
82                           rx="4"
83                           ry="4"
84                       width= "{$bucket_w_}" 
85                       height="{$bucket_h_}" 
86                       style="stroke-width:2; stroke:{$COL_BLACK}; fill:{$COL_BG_UNK}"/>
87                                  
88                         <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@IS_PROMOTED and @IS_PENALIZED)]">   
89                         
90                         <xsl:variable name="bkt_mods_w_" select="@MODS_W"/>
91                                 
92                                 <xsl:variable name="mod_row_"    select="@BKTROW"/>     
93                                 <xsl:variable name="row_mods_h_" select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/UNKBUCKET/BKTROW[(@INDEX = $mod_row_)]/@MODS_H"/> 
94
95 <!--                            
96                                 <xsl:message>The row module is <xsl:value-of select="@BKTROW"/></xsl:message>
97                                 <xsl:message>The height of the module is <xsl:value-of select="$row_mods_h_"/></xsl:message>
98 -->                             
99                                 
100                                 <xsl:variable name="bk_x_"  select="$BLKD_MOD_BKTLANE_W + (@MODS_X * ($BLKD_MOD_W + $BLKD_MOD_BUCKET_G))"/>
101                                 <xsl:variable name="bk_y_"  select="$BLKD_MOD_BKTLANE_H + ($row_mods_h_ * ($BLKD_MOD_H + $BLKD_MOD_BUCKET_G))"/>
102                                 
103                                 <use x="{$bk_x_}"   
104                                          y="{$bk_y_}" 
105                                          xlink:href="#symbol_unkmodule_{@BKTROW}_{@MODS_X}"/>                             
106 <!--                             
107 -->                              
108
109                         </xsl:for-each>          
110
111                         
112                 </g>            
113                 
114         </xsl:for-each> 
115 </xsl:template> 
116
117                 
118 <xsl:template name="Define_SBSBuckets">
119         
120         <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/SBSBUCKETS/SBSBUCKET">       
121                 
122                 <xsl:variable name="busStd_"    select="@BUSSTD"/>
123                 <xsl:variable name="busName_"   select="@BUSNAME"/>
124 <!--            
125                 <xsl:variable name="busStd_"    select="BUSCONNS/BUSCONN/@BUSSTD"/>
126 -->     
127                 <xsl:variable name="bus_conn_w_" select="BUSCONNS/@BUSLANE_W"/>
128                 
129                 
130                 <xsl:variable name="bktColor_">
131                         <xsl:call-template name="F_BusStd2RGB">
132                                 <xsl:with-param name="iBusStd" select="$busStd_"/>
133                         </xsl:call-template>
134                 </xsl:variable>
135                 
136                 <xsl:variable name="bktBgColor_">
137                         <xsl:call-template name="F_BusStd2RGB_LT">
138                                 <xsl:with-param name="iBusStd" select="$busStd_"/>
139                         </xsl:call-template>
140                 </xsl:variable>
141                 
142                 
143                 <xsl:for-each select="MODULE">  
144                         
145                         <xsl:sort data-type="text" select="@MODTYPE" order="ascending"/>
146                 
147                         <xsl:call-template name="Define_SBSBucketModule">
148                                 <xsl:with-param name="iBifType"  select="$busStd_"/>
149                                 <xsl:with-param name="iIPType"   select="@MODTYPE"/>
150                                 <xsl:with-param name="iIPName"   select="@INSTANCE"/>
151                         </xsl:call-template>    
152                         
153                 </xsl:for-each>         
154                 
155                 <g id="sbsbucket_{$busName_}">
156                         <xsl:variable name="bucket_w_"  select="(($BLKD_MOD_BKTLANE_W * 2) + (($BLKD_MOD_W * @MODS_W) + ($BLKD_MOD_BUCKET_G * (@MODS_W - 1))))"/>
157                         <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))))"/>
158                         
159                         <rect x="0"
160                               y="0"  
161                                   rx="4"
162                                   ry="4"
163                               width= "{$bucket_w_}" 
164                               height="{$bucket_h_}" 
165                               style="stroke-width:2; stroke:{$bktColor_}; fill:{$bktBgColor_}"/>
166                                  
167                         <xsl:variable name="bkt_mods_w_" select="@MODS_W"/>
168                         
169                         <xsl:for-each select="MODULE">  
170                                 
171                                 <xsl:sort data-type="text" select="@MODTYPE" order="ascending"/>
172                                 
173                                 <xsl:variable name="clm_"   select="((     position() - 1)  mod $bkt_mods_w_)"/>
174                                 <xsl:variable name="row_"   select="floor((position() - 1)  div $bkt_mods_w_)"/>
175                                 
176                                 <xsl:variable name="bk_x_"  select="$BLKD_MOD_BKTLANE_W + ($clm_ * ($BLKD_MOD_W + $BLKD_MOD_BUCKET_G))"/>
177                                 <xsl:variable name="bk_y_"  select="$BLKD_MOD_BKTLANE_H + ($row_ * ($BLKD_MOD_H + $BLKD_BIFC_H + $BLKD_MOD_BUCKET_G))"/>
178                                          
179                                 <!-- Lay out the module in the bucket -->
180                                  <use x="{$bk_x_}" y="{$bk_y_}"  xlink:href="#sbsbktmodule_{@INSTANCE}"/>                 
181                                 
182                                 <!-- Add its connection to the piece shared bus -->
183                                 <xsl:variable name="h_bus_y_" select="$bk_y_ + ceiling($BLKD_BIFC_H div 2) - ceiling($BLKD_P2P_BUS_W div 2)"/>
184                                 
185 <!--                            
186                                 <xsl:variable name="h_bus_x_" select="$bk_x_ - ($BLKD_MOD_BUCKET_G + ceiling($BLKD_MOD_W div 2))"/>
187 -->     
188                                 <xsl:variable name="h_bus_x_">
189                                         <xsl:choose>
190                                                 <xsl:when test="($clm_ = '0')">0</xsl:when>
191                                         
192                                                 <xsl:when test="not($clm_ = '0')">
193                                                         <xsl:value-of select="$bk_x_ - ($BLKD_MOD_BUCKET_G + ceiling($BLKD_MOD_W div 2))"/>
194                                                 </xsl:when>
195                                         </xsl:choose>
196                                 </xsl:variable>
197                                 
198 <!--                            
199                                 <xsl:variable name="h_bus_y_" select="$bk_y_ + ceiling($BLKD_BIFC_H div 2) - ceiling($BLKD_P2P_BUS_W)"/>
200                                 <xsl:message>h bus x <xsl:value-of select="$h_bus_x_"/></xsl:message>
201                                 <xsl:message>h bus y <xsl:value-of select="$h_bus_y_"/></xsl:message>
202 -->     
203                                 <xsl:variable name="h_bus_height_" select="$BLKD_P2P_BUS_W"/>
204                                 <xsl:variable name="h_bus_width_"  select="($bk_x_ - $h_bus_x_ + ceiling($BLKD_MOD_W div 2))"/> 
205                                 
206                                 <rect x="{$h_bus_x_}" 
207                                   y="{$h_bus_y_}"  
208                                   width= "{$h_bus_width_}" 
209                                   height="{$BLKD_P2P_BUS_W}" 
210                                   style="fill:{$bktColor_}"/>
211                                 
212                         </xsl:for-each>
213                         
214                         <xsl:variable name="num_sbsbktmods_" select="count(MODULE)"/>
215                         <xsl:variable name="num_sbsbktrows_" select="ceiling($num_sbsbktmods_ div $BLKD_BKT_MODS_PER_ROW)"/>
216                         
217                         <!-- If there is more than one row, connect the rows with a vertical bar -->            
218                         <xsl:if test="($num_sbsbktrows_ &gt; 1)">
219                                 
220                                 <xsl:variable name="v_bus_x_"    select="$BLKD_MOD_BKTLANE_W + ($BLKD_MOD_W + $BLKD_MOD_BUCKET_G)"/>
221                                 
222                                 <xsl:variable name="bkt_top_"    select="$BLKD_MOD_BKTLANE_H + (0                      * ($BLKD_MOD_H + $BLKD_BIFC_H + $BLKD_MOD_BUCKET_G))"/>
223                                 <xsl:variable name="bkt_bot_"    select="$BLKD_MOD_BKTLANE_H + (($num_sbsbktrows_ - 1) * ($BLKD_MOD_H + $BLKD_BIFC_H + $BLKD_MOD_BUCKET_G))"/>
224                                 
225                                 <xsl:variable name="v_bus_y_top_" select="$bkt_top_ + ceiling($BLKD_BIFC_H div 2) - ceiling($BLKD_P2P_BUS_W div 2)"/>
226                                 <xsl:variable name="v_bus_y_bot_" select="$bkt_bot_ + ceiling($BLKD_BIFC_H div 2) - ceiling($BLKD_P2P_BUS_W div 2)"/>
227                                 
228                                 <xsl:variable name="v_bus_width_"   select="$BLKD_P2P_BUS_W"/>
229                                 <xsl:variable name="v_bus_height_"  select="($v_bus_y_bot_ - $v_bus_y_top_)"/>
230                                 <rect x="0" 
231                                   y="{$v_bus_y_top_}"  
232                                   width= "{$v_bus_width_}" 
233                                   height="{$v_bus_height_}" 
234                                   style="fill:{$bktColor_}"/>
235                         </xsl:if>
236                         
237                 </g>
238                 
239         </xsl:for-each>         
240         
241 </xsl:template> 
242         
243         
244 <xsl:template name="Define_SBSBucketModule">
245         
246         <xsl:param name="iBusStd"  select="'PLB46'"/>
247         <xsl:param name="iIPName"  select="'_ipType_'"/>
248         <xsl:param name="iIPType"  select="'_ipName_'"/>
249         
250 <!--    
251         <xsl:message>The IPType is <xsl:value-of select="$iIPType"/> </xsl:message>
252 -->     
253         <xsl:variable name="bif_y_">
254                 <xsl:value-of select="$BLKD_MOD_LANE_H + $BLKD_BIFC_H"/>        
255         </xsl:variable>
256
257         <xsl:variable name="label_y_">
258                 <xsl:value-of select="$BLKD_MOD_LANE_H + $BLKD_BIF_H + $BLKD_BIFC_H +  $BLKD_MOD_BIF_GAP_V"/>   
259         </xsl:variable>
260         
261         <xsl:variable name="modBgColor_">
262                 <xsl:choose>
263                         <xsl:when test="$iIPType = 'mpmc'"><xsl:value-of select="$COL_MPMC_BG"/></xsl:when>
264                         <xsl:otherwise><xsl:value-of select="$COL_BG"/></xsl:otherwise>
265                 </xsl:choose>
266         </xsl:variable>
267         
268     <g id="sbsbktmodule_{$iIPName}">
269                 
270                 <rect x="0"
271                       y="{$BLKD_BIFC_H}"
272                           rx="6" 
273                           ry="6" 
274                       width = "{$BLKD_MOD_W}"
275                       height= "{$BLKD_MOD_H}"
276                           style="fill:{$modBgColor_}; stroke:{$COL_WHITE}; stroke-width:2"/>            
277                           
278                 <rect x="{ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_MOD_LABEL_W div 2)}"
279                       y="{$label_y_}"
280                           rx="3" 
281                           ry="3" 
282                       width= "{$BLKD_MOD_LABEL_W}"
283                       height="{$BLKD_MOD_LABEL_H}"
284                           style="fill:{$COL_WHITE}; stroke:none;"/>             
285                 
286                 <xsl:if test="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$iIPName)]/@GROUP">
287                 
288                         <rect x="{ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_MOD_LABEL_W div 2)}"
289                           y="{$label_y_ + $BLKD_BIF_H + ceiling($BLKD_BIF_H div 3) - 2}"
290                               rx="3" 
291                               ry="3" 
292                           width= "{$BLKD_MOD_LABEL_W}"
293                           height="{$BLKD_BIF_H}"
294                                   style="fill:{$COL_IORING_LT}; stroke:none;"/>         
295                           
296 <!-- 
297                    <text class="ioplblgrp" 
298                                   x="{ceiling($BLKD_MOD_W div 2)}"
299                           y="{$label_y_ + $BLKD_BIF_H + ceiling($BLKD_BIF_H div 3) + 12}">
300                            <xsl:value-of select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iIPName)]/@GROUP"/>
301                         </text>
302 -->     
303            
304                         <xsl:call-template name="F_WriteText">
305                                 <xsl:with-param name="iX"               select="ceiling($BLKD_MOD_W div 2)"/>
306                                 <xsl:with-param name="iY"               select="($label_y_ + $BLKD_BIF_H + ceiling($BLKD_BIF_H div 3) + 12)"/>
307                                 <xsl:with-param name="iText"    select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iIPName)]/@GROUP"/>
308                                 <xsl:with-param name="iClass"   select="'iogrp_label'"/>
309                         </xsl:call-template>    
310                                 
311                 </xsl:if> 
312            
313 <!-- 
314                 <text class="bciptype" 
315                           x="{ceiling($BLKD_MOD_W div 2)}"
316                           y="{$label_y_ + 8}">
317                                 <xsl:value-of select="$iIPType"/>
318                 </text>
319                                 
320                 <text class="bciplabel" 
321                           x="{ceiling($BLKD_MOD_W div 2)}"
322                           y="{$label_y_ + 16}">
323                                 <xsl:value-of select="$iIPName"/>
324            </text>
325 -->        
326                 <xsl:call-template name="F_WriteText">
327                         <xsl:with-param name="iX"               select="ceiling($BLKD_MOD_W div 2)"/>
328                         <xsl:with-param name="iY"               select="($label_y_ + 8)"/>
329                         <xsl:with-param name="iText"    select="$iIPType"/>
330                         <xsl:with-param name="iClass"   select="'bc_iptype'"/>
331                 </xsl:call-template>    
332                 
333                 <xsl:call-template name="F_WriteText">
334                         <xsl:with-param name="iX"               select="ceiling($BLKD_MOD_W div 2)"/>
335                         <xsl:with-param name="iY"               select="($label_y_ + 18)"/>
336                         <xsl:with-param name="iText"    select="$iIPName"/>
337                         <xsl:with-param name="iClass"   select="'bc_ipinst'"/>
338                 </xsl:call-template>    
339                         
340            
341                 <xsl:for-each select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iIPName)]/BUSINTERFACE[(@IS_INMHS = 'TRUE')]">
342                         
343                         <xsl:variable name="bifBusStd_">
344                                 <xsl:choose>
345                                         <xsl:when test="@BUSSTD">
346                                                 <xsl:value-of select="@BUSSTD"/>        
347                                         </xsl:when>
348                                         <xsl:otherwise>
349                                                 <xsl:value-of select="'USER'"/> 
350                                         </xsl:otherwise>
351                                 </xsl:choose>
352                         </xsl:variable>
353                         
354                         <xsl:variable name="bifName_">
355                                 <xsl:choose>
356                                         <xsl:when test="string-length(@NAME) &lt;= 5">
357                                                 <xsl:value-of select="@NAME"/>  
358                                         </xsl:when>
359                                         <xsl:otherwise>
360                                                 <xsl:value-of select="substring(@NAME,0,5)"/>   
361                                         </xsl:otherwise>
362                                 </xsl:choose>
363                         </xsl:variable>
364         
365                     <xsl:variable name="bif_x_"  select="ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_BIF_W div 2)"/>
366                         
367                         <!-- Draw the BIF -->
368                         <use  x="{$bif_x_}"   y="{$bif_y_}"  xlink:href="#{$bifBusStd_}_BifLabel"/>
369                         
370          
371                         <!-- Draw the BIF connection -->
372                         <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="#{$bifBusStd_}_busconn_{@TYPE}"/>
373                         
374 <!--
375                         <text class="bif_label" 
376                                   x="{$bif_x_ + ceiling($BLKD_BIF_W div 2)}"
377                                   y="{$bif_y_ + ceiling($BLKD_BIF_H div 2) + 3}">
378                                         <xsl:value-of select="$bifName_"/>
379                         </text>
380 -->                     
381                         <xsl:call-template name="F_WriteText">
382                                 <xsl:with-param name="iX"               select="($bif_x_ + ceiling($BLKD_BIF_W div 2))"/>
383                                 <xsl:with-param name="iY"               select="($bif_y_ + ceiling($BLKD_BIF_H div 2) + 3)"/>
384                                 <xsl:with-param name="iText"    select="$bifName_"/>
385                                 <xsl:with-param name="iClass"   select="'bif_label'"/>
386                         </xsl:call-template>    
387                         
388                 </xsl:for-each>
389                 
390                 <xsl:if test="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iIPName)]/INTERRUPTINFO[(@TYPE = 'CONTROLLER')]">
391                 
392                         <xsl:variable name="intcIdx_" select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$iIPName)]/INTERRUPTINFO[(@TYPE = 'CONTROLLER')]/@INTC_INDEX"/>
393                         
394                         <xsl:variable name="intrColor_">
395                                 <xsl:call-template name="F_IntcIdx2RGB">
396                                         <xsl:with-param name="iIntcIdx" select="$intcIdx_"/>
397                                 </xsl:call-template>    
398                         </xsl:variable>
399                         
400                         <xsl:call-template name="F_draw_InterruptCntrl">
401                                 <xsl:with-param name="iIntr_X"   select="($BLKD_MOD_W - ceiling($BLKD_INTR_W div 2))"/>
402                                 <xsl:with-param name="iIntr_Y"   select="3 + $BLKD_BIFC_H"/>
403                                 <xsl:with-param name="iIntr_COL" select="$intrColor_"/>
404                                 <xsl:with-param name="iIntr_IDX" select="$intcIdx_"/>
405                         </xsl:call-template>    
406                 </xsl:if>
407                 
408                       
409                 <xsl:for-each select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iIPName)]/INTERRUPTINFO[(@TYPE = 'SOURCE')]/TARGET">
410 <!-- 
411                         <xsl:variable name="intcIdx_" select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE=$iIPName)]/INTERRUPTINFO[(@TYPE = 'SOURCE')]/@INTC_INDEX"/>
412 -->                     
413                         <xsl:variable name="intrColor_">
414                                 <xsl:call-template name="F_IntcIdx2RGB">
415                                         <xsl:with-param name="iIntcIdx" select="@INTC_INDEX"/>
416                                 </xsl:call-template>    
417                         </xsl:variable>
418                         
419                         <xsl:call-template name="F_draw_InterruptSource">
420                                 <xsl:with-param name="iIntr_X"   select="($BLKD_MOD_W - $BLKD_INTR_W)"/>
421                                 <xsl:with-param name="iIntr_Y"   select="((position() - 1) * (ceiling($BLKD_INTR_H div 2) + 3)) + $BLKD_BIFC_H"/>
422                                 <xsl:with-param name="iIntr_COL" select="$intrColor_"/>
423                                 <xsl:with-param name="iIntr_PRI" select="@PRIORITY"/>
424                                 <xsl:with-param name="iIntr_IDX" select="@INTC_INDEX"/>
425                         </xsl:call-template>    
426                         
427                 </xsl:for-each>
428                 
429         </g>                      
430         
431 </xsl:template> 
432
433 <xsl:template name="Define_IPBucketModule">
434         
435         <xsl:param name="iIPType"   select="'_ip_type_'"/>
436         <xsl:param name="iIPName"   select="'_ip_name_'"/>
437         
438         <xsl:variable name="bif_y_">
439                 <xsl:value-of select="$BLKD_MOD_LANE_H"/>       
440         </xsl:variable>
441
442         <xsl:variable name="label_y_">
443                 <xsl:value-of select="(ceiling($BLKD_MOD_H div 2) - ceiling($BLKD_MOD_LABEL_H div 2))"/>        
444         </xsl:variable>
445         
446     <g id="ipbktmodule_{$iIPName}">
447
448                 <rect x="0"
449                       y="0"
450                           rx="6" 
451                           ry="6" 
452                       width = "{$BLKD_MOD_W}"
453                       height= "{$BLKD_MOD_H}"
454                           style="fill:{$COL_BG}; stroke:{$COL_BLACK}; stroke-width:2"/>         
455                           
456                 <rect x="{ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_MOD_LABEL_W div 2)}"
457                       y="{$label_y_}"
458                           rx="3" 
459                           ry="3" 
460                       width= "{$BLKD_MOD_LABEL_W}"
461                       height="{$BLKD_MOD_LABEL_H}"
462                           style="fill:{$COL_WHITE}; stroke:none;"/>             
463 <!--
464                           y="{$label_y_ + ceiling($BLKD_MOD_LABEL_H div 2) - 4}"
465                           y="{$label_y_ + ceiling($BLKD_MOD_LABEL_H div 2) + 4}"
466 -->                       
467                         <xsl:call-template name="F_WriteText">
468                                 <xsl:with-param name="iX"               select="ceiling($BLKD_MOD_W div 2)"/>
469                                 <xsl:with-param name="iY"               select="($label_y_ + 8)"/>
470                                 <xsl:with-param name="iText"    select="$iIPType"/>
471                                 <xsl:with-param name="iClass"   select="'bc_iptype'"/>
472                         </xsl:call-template>    
473                         
474                         <xsl:call-template name="F_WriteText">
475                                 <xsl:with-param name="iX"               select="ceiling($BLKD_MOD_W div 2)"/>
476                                 <xsl:with-param name="iY"               select="($label_y_ + 20)"/>
477                                 <xsl:with-param name="iText"    select="$iIPName"/>
478                                 <xsl:with-param name="iClass"   select="'bc_ipinst'"/>
479                         </xsl:call-template>    
480                         
481 <!-- 
482                 <text class="bc_iptype" 
483                           x="{ceiling($BLKD_MOD_W div 2)}"
484                           y="{$label_y_ + 8}">
485                                 <xsl:value-of select="$iIPType"/>
486                 </text>
487                                 
488                 <text class="bc_ipinst" 
489                           x="{ceiling($BLKD_MOD_W div 2)}"
490                           y="{$label_y_ + 16}">
491                                 <xsl:value-of select="$iIPName"/>
492            </text>
493 -->     
494            
495                 <xsl:if test="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iIPName)]/@GROUP">
496                 
497                         <rect x="{ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_MOD_LABEL_W div 2)}"
498                               y="{$label_y_ + $BLKD_BIF_H + ceiling($BLKD_BIF_H div 3) - 2}"
499                                   rx="3" 
500                                   ry="3" 
501                               width= "{$BLKD_MOD_LABEL_W}"
502                               height="{$BLKD_BIF_H}"
503                                   style="fill:{$COL_IORING_LT}; stroke:none;"/>         
504                                   
505                                 <xsl:call-template name="F_WriteText">
506                                         <xsl:with-param name="iX"               select="ceiling($BLKD_MOD_W div 2)"/>
507                                         <xsl:with-param name="iY"               select="($label_y_ + $BLKD_BIF_H + ceiling($BLKD_BIF_H div 3) + 12)"/>
508                                         <xsl:with-param name="iText"    select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iIPName)]/@GROUP"/>
509                                         <xsl:with-param name="iClass"   select="'iogrp_label'"/>
510                                 </xsl:call-template>    
511                                 
512         <!-- 
513                            <text class="iogrp_label" 
514                                   x="{ceiling($BLKD_MOD_W div 2)}"
515                               y="{$label_y_ + $BLKD_BIF_H + ceiling($BLKD_BIF_H div 3) + 12}">
516                                    <xsl:value-of select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iIPName)]/@GROUP"/>
517                                 </text>
518         -->                     
519            
520                 </xsl:if> 
521                 
522                 <xsl:for-each select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iIPName)]/INTERRUPTINFO[(@TYPE = 'SOURCE')]">
523                         
524                         <xsl:variable name="intrColor_">
525                                 <xsl:call-template name="F_IntcIdx2RGB">
526                                         <xsl:with-param name="iIntcIdx" select="@INTC_INDEX"/>
527                                 </xsl:call-template>    
528                         </xsl:variable>
529                         
530                         <xsl:call-template name="F_draw_InterruptSource">
531                                 <xsl:with-param name="iIntr_X"   select="($BLKD_MOD_W - $BLKD_INTR_W)"/>
532                                 <xsl:with-param name="iIntr_Y"   select="((position() - 1) * (ceiling($BLKD_INTR_H div 2) + 3))"/>
533                                 <xsl:with-param name="iIntr_COL" select="$intrColor_"/>
534                                 <xsl:with-param name="iIntr_PRI" select="@PRIORITY"/>
535                                 <xsl:with-param name="iIntr_IDX" select="@INTC_INDEX"/>
536                         </xsl:call-template>    
537                         
538                 </xsl:for-each>
539            
540         </g>                      
541         
542 </xsl:template> 
543         
544         
545 <xsl:template name="Define_Peripheral"> 
546 <!-- 
547         when the module is oriented normal its label goes above the bifs 
548     when the module is oriented rot180, (part of a processor memory  
549         controller for example) its label goes below the bifs 
550 -->     
551
552         <xsl:param name="iModVori"    select="'normal'"/>
553         <xsl:param name="iModInst"    select="'_instance_'"/>
554         <xsl:param name="iModType"    select="'_modtype_'"/>
555         <xsl:param name="iUnkInst"    select="'_unknown_'"/>
556         <xsl:param name="iHorizIdx"   select="'_unknown_'"/>
557         <xsl:param name="iVertiIdx"   select="'_unknown_'"/>
558         
559 <!--    
560         <xsl:message>Stack       Y <xsl:value-of select="$cstkMods_Y"/></xsl:message>
561         <xsl:message>Stack Index Y <xsl:value-of select="$cstkIndex"/></xsl:message>
562 -->     
563         
564         <xsl:variable name="modName_">
565                 <xsl:choose>
566                         <xsl:when test="$iUnkInst = '_unknown_'">
567                                 <xsl:value-of select="$iModInst"/>      
568                         </xsl:when>
569                         <xsl:otherwise>
570                                 <xsl:value-of select="$iUnkInst"/>      
571                         </xsl:otherwise>
572                 </xsl:choose>
573         </xsl:variable>
574         
575         <xsl:variable name="modSymbolName_">
576                 <xsl:choose>
577                         <xsl:when test="(not($iHorizIdx = '_unknown_') and not($iVertiIdx = '_unknown_'))">
578                                 <xsl:call-template name="F_generate_Stack_SymbolName"> 
579                                         <xsl:with-param name="iHorizIdx"  select="$iHorizIdx"/>
580                                         <xsl:with-param name="iVertiIdx"  select="$iVertiIdx"/>
581                                 </xsl:call-template>            
582                         </xsl:when>
583                         <xsl:otherwise>symbol_<xsl:value-of select="$modName_"/></xsl:otherwise>
584                 </xsl:choose>
585         </xsl:variable>
586         
587         <xsl:variable name="modTypeName_" select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iModInst)]/@MODTYPE"/>
588         
589 <!--    
590         <xsl:message>The symbol type of the module is <xsl:value-of select="$modTypeName_"/></xsl:message>
591         <xsl:message>The symbol name of the module is <xsl:value-of select="$modSymbolName_"/></xsl:message>
592 -->     
593         
594         <xsl:variable name="bifs_h_">   
595                 <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE/MODULE[(@INSTANCE = $iModInst)]/@BIFS_H) and not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/BRIDGESHAPES/MODULE[(@INSTANCE = $iModInst)]/@BIFS_H)">0</xsl:if>
596         
597                 <xsl:if test="($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE/MODULE[(@INSTANCE = $iModInst)]/@BIFS_H)">
598                         <xsl:value-of select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE/MODULE[(@INSTANCE = $iModInst)]/@BIFS_H"/>
599                 </xsl:if>
600         
601                 <xsl:if test="($G_ROOT/EDKSYSTEM/BLKDIAGRAM/BRIDGESHAPES/MODULE[(@INSTANCE = $iModInst)]/@BIFS_H)">
602                         <xsl:value-of select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/BRIDGESHAPES/MODULE[(@INSTANCE = $iModInst)]/@BIFS_H"/>
603                 </xsl:if>
604         </xsl:variable>         
605         
606         <xsl:variable name="label_y_">
607                 <xsl:choose>
608                         <xsl:when test="$iModVori = 'rot180'">
609                                 <xsl:value-of select="($BLKD_MOD_LANE_H + (($BLKD_BIF_H + $BLKD_MOD_BIF_GAP_V) * $bifs_h_))"/>  
610                         </xsl:when>
611                         <xsl:otherwise>
612                                 <xsl:value-of select="$BLKD_MOD_LANE_H"/>       
613                         </xsl:otherwise>
614                 </xsl:choose>
615         </xsl:variable>
616         
617         <xsl:variable name="bif_dy_">
618                 <xsl:choose>
619                         <xsl:when test="$iModVori = 'rot180'">
620                                 <xsl:value-of select="$BLKD_MOD_LANE_H"/>       
621                         </xsl:when>
622                         <xsl:otherwise>
623                                 <xsl:value-of select="($BLKD_MOD_LANE_H + $BLKD_MOD_LABEL_H + $BLKD_MOD_BIF_GAP_V)"/>   
624                         </xsl:otherwise>
625                 </xsl:choose>
626         </xsl:variable>
627         
628         <xsl:variable name="peri_stroke_col_">
629                 <xsl:choose>
630                         <xsl:when test="((@MODCLASS = 'MASTER_SLAVE') or (@MODCLASS = 'MONITOR')) and BUSCONNS/BUSCONN">
631                                 <xsl:call-template name="F_BusStd2RGB">
632                                         <xsl:with-param name="iBusStd" select="BUSCONNS/BUSCONN/@BUSSTD"/>
633                                 </xsl:call-template>
634                         </xsl:when>
635                         
636                         <xsl:otherwise>
637                                 <xsl:value-of select="$COL_WHITE"/>
638                         </xsl:otherwise>
639                 </xsl:choose>
640         </xsl:variable>
641         
642         <xsl:variable name="modHeight_">
643                 <xsl:call-template name="F_Calc_PeriShape_Height">
644                         <xsl:with-param name="iShapeInst"  select="$modName_"/>
645                 </xsl:call-template>    
646         </xsl:variable>         
647         
648     <g id="{$modSymbolName_}">
649                 
650                 <xsl:if test="$modTypeName_ = 'mpmc'">
651                 <rect x="0"
652                       y="0"
653                           rx="6" 
654                           ry="6" 
655                       width = "{$BLKD_MOD_W}"
656                       height= "{$modHeight_}"
657                           style="fill:{$COL_MPMC_BG}; stroke:{$peri_stroke_col_}; stroke-width:2"/>             
658                 </xsl:if>       
659                 
660                 <xsl:if test="not($modTypeName_ = 'mpmc')">
661                         <rect x="0"
662                               y="0"
663                                   rx="6" 
664                                   ry="6" 
665                               width = "{$BLKD_MOD_W}"
666                               height= "{$modHeight_}"
667                                   style="fill:{$COL_BG}; stroke:{$peri_stroke_col_}; stroke-width:2"/>          
668                 </xsl:if>       
669                 
670                                           
671                 <rect x="{ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_MOD_LABEL_W div 2)}"
672                       y="{$label_y_}"
673                           rx="3" 
674                           ry="3" 
675                       width= "{$BLKD_MOD_LABEL_W}"
676                       height="{$BLKD_MOD_LABEL_H}"
677                           style="fill:{$COL_WHITE}; stroke:none;"/>             
678                           
679 <!--                      
680                           y="{$label_y_ + ceiling($BLKD_MOD_LABEL_H div 2) - 4}">
681                           y="{$label_y_ + ceiling($BLKD_MOD_LABEL_H div 2) + 4}">
682 -->
683 <!-- 
684                 <text class="bc_iptype" 
685                           x="{ceiling($BLKD_MOD_W div 2)}"
686                           y="{$label_y_ + 8}">
687                                 <xsl:value-of select="$iModType"/>
688                 </text>
689                                 
690                 <text class="bc_ipinst" 
691                           x="{ceiling($BLKD_MOD_W div 2)}"
692                           y="{$label_y_ + 16}">
693                                 <xsl:value-of select="$iModInst"/>
694            </text>
695 -->        
696                         <xsl:call-template name="F_WriteText">
697                                 <xsl:with-param name="iX"               select="ceiling($BLKD_MOD_W div 2)"/>
698                                 <xsl:with-param name="iY"               select="($label_y_ + 8)"/>
699                                 <xsl:with-param name="iText"    select="$iModType"/>
700                                 <xsl:with-param name="iClass"   select="'bc_iptype'"/>
701                         </xsl:call-template>    
702                         
703                         <xsl:call-template name="F_WriteText">
704                                 <xsl:with-param name="iX"               select="ceiling($BLKD_MOD_W div 2)"/>
705                                 <xsl:with-param name="iY"               select="($label_y_ + 16)"/>
706                                 <xsl:with-param name="iText"    select="$iModInst"/>
707                                 <xsl:with-param name="iClass"   select="'bc_ipinst'"/>
708                         </xsl:call-template>    
709                         
710            
711                 <xsl:if test="$G_ROOT/EDKSYSTEM/MODULES/MODULE[@INSTANCE=$iModInst]/@GROUP">
712                 
713                         <rect x="{ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_MOD_LABEL_W div 2)}"
714                               y="{$label_y_ + $BLKD_BIF_H + ceiling($BLKD_BIF_H div 3) - 2}"
715                                   rx="3" 
716                                   ry="3" 
717                               width= "{$BLKD_MOD_LABEL_W}"
718                               height="{$BLKD_BIF_H}"
719                                   style="fill:{$COL_IORING_LT}; stroke:none;"/>         
720                                   
721 <!-- 
722                            <text class="iogrp_label" 
723                                   x="{ceiling($BLKD_MOD_W div 2)}"
724                               y="{$label_y_ + $BLKD_BIF_H + ceiling($BLKD_BIF_H div 3) + 12}">
725                                    <xsl:value-of select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[@INSTANCE=$iModInst]/@GROUP"/>
726                                 </text>
727 -->                             
728                                 <xsl:call-template name="F_WriteText">
729                                         <xsl:with-param name="iX"               select="ceiling($BLKD_MOD_W div 2)"/>
730                                         <xsl:with-param name="iY"               select="($label_y_ + $BLKD_BIF_H + ceiling($BLKD_BIF_H div 3) + 12)"/>
731                                         <xsl:with-param name="iText"    select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iModInst)]/@GROUP"/>
732                                         <xsl:with-param name="iClass"   select="'iogrp_label'"/>
733                                 </xsl:call-template>    
734                                 
735            
736                 </xsl:if> 
737            
738                 <xsl:for-each select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iModInst)]/BUSINTERFACE[(@BIF_X and @BIF_Y and not(@BUSNAME = '__NOC__'))]">
739                         
740                         <xsl:variable name="bifBusStd_">
741                                 <xsl:choose>
742                                         <xsl:when test="@BUSSTD">
743                                                 <xsl:value-of select="@BUSSTD"/>        
744                                         </xsl:when>
745                                         <xsl:otherwise>
746                                                 <xsl:value-of select="'TRS'"/>  
747                                         </xsl:otherwise>
748                                 </xsl:choose>
749                         </xsl:variable>
750                         
751                         <xsl:variable name="bif_y_">
752                                 <xsl:value-of select="(($BLKD_BIF_H + $BLKD_MOD_BIF_GAP_V)  * @BIF_Y)"/>
753                         </xsl:variable>
754                         
755                         <xsl:variable name="bif_buscol_">
756                                 <xsl:call-template name="F_BusStd2RGB">
757                                         <xsl:with-param name="iBusStd" select="$bifBusStd_"/>
758                                 </xsl:call-template>
759                         </xsl:variable>
760                 
761                         
762                         <xsl:variable name="bifName_">
763                                 <xsl:choose>
764                                         <xsl:when test="not(@NAME)">'UNK'</xsl:when>
765                                         <xsl:when test="string-length(@NAME) &lt;= 5">
766                                                 <xsl:value-of select="@NAME"/>  
767                                         </xsl:when>
768                                         <xsl:otherwise>
769                                                 <xsl:value-of select="substring(@NAME,0,5)"/>   
770                                         </xsl:otherwise>
771                                 </xsl:choose>
772                         </xsl:variable>
773         
774                         <xsl:variable name="bif_x_" >
775                                 <xsl:if test="not(@ORIENTED='CENTER')">
776                                         <xsl:value-of select="(($BLKD_BIF_W * @BIF_X) + ($BLKD_MOD_BIF_GAP_H * @BIF_X) + ($BLKD_MOD_LANE_W * 1))"/>
777                                 </xsl:if>
778                                 <xsl:if test="(@ORIENTED='CENTER')">
779                                         <xsl:value-of select="ceiling($BLKD_MOD_W div 2) - ceiling($BLKD_BIF_W div 2)"/>
780                                 </xsl:if>
781                         </xsl:variable> 
782                         
783                         <xsl:if test="not(@IS_INTCONN)">
784                                 <xsl:variable name="horz_line_y_" select="($bif_y_  + $bif_dy_ + ceiling($BLKD_BIFC_H div 2))"/>
785                         
786                                 <xsl:variable name="horz_line_x1_">
787                                         <xsl:choose>
788                                                 <xsl:when test="@BIF_X = '0'">0</xsl:when>
789                                                 <xsl:otherwise><xsl:value-of select="($BLKD_MOD_W - $BLKD_MOD_LANE_W)"/></xsl:otherwise>
790                                         </xsl:choose>
791                                 </xsl:variable>
792                         
793                                 <xsl:variable name="horz_line_x2_">
794                                         <xsl:choose>
795                                                 <xsl:when test="@BIF_X = '0'"><xsl:value-of select="$BLKD_MOD_LANE_W"/></xsl:when>
796                                                 <xsl:otherwise><xsl:value-of select="$BLKD_MOD_W + 1"/></xsl:otherwise>
797                                         </xsl:choose>
798                                 </xsl:variable>
799                         
800                         
801                                 <line x1="{$horz_line_x1_}" 
802                                           y1="{$horz_line_y_ - 2}"
803                                   x2="{$horz_line_x2_}" 
804                                   y2="{$horz_line_y_ - 2}" 
805                                  style="stroke:{$bif_buscol_};stroke-width:1"/>
806                           
807                         </xsl:if>
808                         
809                         <use  x="{$bif_x_}"   y="{$bif_y_ + $bif_dy_}"  xlink:href="#{$bifBusStd_}_BifLabel"/>
810 <!-- 
811                         <text class="bif_label" 
812                                   x="{$bif_x_  + ceiling($BLKD_BIF_W div 2)}"
813                                   y="{$bif_y_ + $bif_dy_ + ceiling($BLKD_BIF_H div 2) + 3}">
814                                         <xsl:value-of select="$bifName_"/>
815                         </text>
816 -->                     
817                         <xsl:call-template name="F_WriteText">
818                                 <xsl:with-param name="iX"               select="($bif_x_  + ceiling($BLKD_BIF_W div 2))"/>
819                                 <xsl:with-param name="iY"               select="($bif_y_ + $bif_dy_ + ceiling($BLKD_BIF_H div 2) + 3)"/>
820                                 
821                                 <xsl:with-param name="iText"    select="$bifName_"/>
822                                 <xsl:with-param name="iClass"   select="'bif_label'"/>
823                         </xsl:call-template>    
824                                 
825                 </xsl:for-each>
826                 
827 <!--            
828                 <xsl:if test="@INTC_INDEX">
829                         <xsl:variable name="intrColor_">
830                                 <xsl:call-template name="F_IntcIdx2RGB">
831                                         <xsl:with-param name="intcIdx" select="@INTC_INDEX"/>
832                                 </xsl:call-template>    
833                         </xsl:variable>
834                         
835                         <xsl:call-template name="F_draw_InterruptCntrl">
836                                 <xsl:with-param name="intr_col" select="$intrColor_"/>
837                                 <xsl:with-param name="intr_x"   select="($BLKD_MOD_W - ceiling($BLKD_INTR_W div 2))"/>
838                                 <xsl:with-param name="intr_y"   select="3"/>
839                                 <xsl:with-param name="intr_idx" select="@INTC_INDEX"/>
840                         </xsl:call-template>    
841                 </xsl:if>
842 -->             
843                 <xsl:if test="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iModInst)]/@INTC_INDEX">
844                         <xsl:variable name="intrColor_">
845                                 <xsl:call-template name="F_IntcIdx2RGB">
846                                         <xsl:with-param name="iIntcIdx" select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iModInst)]/@INTC_INDEX"/>
847                                 </xsl:call-template>    
848                         </xsl:variable>
849                         
850                         <xsl:call-template name="F_draw_InterruptCntrl">
851                                 <xsl:with-param name="iIntr_X"   select="($BLKD_MOD_W - ceiling($BLKD_INTR_W div 2))"/>
852                                 <xsl:with-param name="iIntr_Y"   select="3"/>
853                                 <xsl:with-param name="iIntr_COL" select="$intrColor_"/>
854                                 <xsl:with-param name="iIntr_IDX" select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iModInst)]/@INTC_INDEX"/>
855                         </xsl:call-template>    
856                 </xsl:if>
857                 
858                 
859                 <xsl:for-each select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $iModInst)]/INTERRUPTINFO[@TYPE ='TARGET']">
860                 
861                         <xsl:variable name="intrColor_">
862                                 <xsl:call-template name="F_IntcIdx2RGB">
863                                         <xsl:with-param name="iIntcIdx" select="@INTC_INDEX"/>
864                                 </xsl:call-template>    
865                         </xsl:variable>
866                         
867                         <xsl:call-template name="F_draw_InterruptSource">
868                                 <xsl:with-param name="iIntr_X"   select="($BLKD_MOD_W - $BLKD_INTR_W)"/>
869                                 <xsl:with-param name="iIntr_Y"   select="((position() - 1) * (ceiling($BLKD_INTR_H div 2) + 3))"/>
870                                 <xsl:with-param name="iIntr_COL" select="$intrColor_"/>
871                                 <xsl:with-param name="iIntr_PRI" select="@PRIORITY"/>
872                                 <xsl:with-param name="iIntr_IDX" select="@INTC_INDEX"/>
873                         </xsl:call-template>    
874                         
875                 </xsl:for-each>
876         </g>                      
877 </xsl:template> 
878         
879 <xsl:template name="Define_MemoryUnit"> 
880         <xsl:param name="iShapeId"  select="1000"/>
881         
882         <xsl:variable name="horiz_idx_"   select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/@STACK_HORIZ_INDEX"/>
883         <xsl:variable name="is_multistk_" select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/@IS_MULTISTK"/>
884         
885         <xsl:choose>
886                 <xsl:when test="(($is_multistk_ = 'TRUE') or ($G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE[(@STACK_HORIZ_INDEX = $horiz_idx_)]))">
887                         <xsl:call-template name="Define_Processor_MemoryUnit"> 
888                                 <xsl:with-param name="iShapeId"  select="$iShapeId"/>
889                         </xsl:call-template>
890                 </xsl:when>
891                 
892                 <xsl:otherwise>
893                         <xsl:call-template name="Define_StandAlone_MemoryUnit"> 
894                                 <xsl:with-param name="iShapeId"  select="$iShapeId"/>
895                         </xsl:call-template>
896                 </xsl:otherwise>
897                 
898         </xsl:choose>
899         
900 </xsl:template> 
901         
902         
903 <xsl:template name="Define_Processor_MemoryUnit"> 
904         <xsl:param name="iShapeId"  select="1000"/>
905         
906 <!--    
907         <xsl:param name="cstkIndex"    select="'_processor_'"/>
908 -->     
909         
910         <xsl:variable name="mods_h_"  select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/@MODS_H"/>
911         <xsl:variable name="mods_w_"  select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/@MODS_W"/>
912         <xsl:variable name="memW_" select="($BLKD_MOD_W * $mods_w_)"/>
913         <xsl:variable name="memH_" select="($BLKD_MOD_H * $mods_h_)"/>
914         
915         <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]">
916                 
917                 <!-- first define its symbols as individual modules --> 
918                 <xsl:for-each select="MODULE[(@MODCLASS = 'MEMORY')]">
919                 
920                         <xsl:variable name="modInst_" select="@INSTANCE"/>
921                         <xsl:variable name="modType_" select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $modInst_)]/@MODTYPE"/>
922                 
923                         <xsl:call-template name="Define_Peripheral"> 
924                                 <xsl:with-param name="iModVori"  select="'normal'"/>
925                                 <xsl:with-param name="iModInst"  select="$modInst_"/>
926                                 <xsl:with-param name="iModType"  select="$modType_"/>
927                         </xsl:call-template>            
928                 </xsl:for-each> 
929         
930                 <xsl:for-each select="MODULE[@MODCLASS='MEMORY_CNTLR']">
931                 
932                         <xsl:variable name="modInst_" select="@INSTANCE"/>
933                         <xsl:variable name="modType_" select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $modInst_)]/@MODTYPE"/>
934                 
935                         <xsl:call-template name="Define_Peripheral"> 
936                                 <xsl:with-param name="iModVori"  select="'rot180'"/>
937                                 <xsl:with-param name="iModInst"  select="$modInst_"/>
938                                 <xsl:with-param name="iModType"  select="$modType_"/>
939                         </xsl:call-template>            
940                 </xsl:for-each> 
941         </xsl:for-each>
942         
943 <!--    
944 -->     
945         
946         <xsl:variable name="symbol_name_">
947                 <xsl:call-template name="F_generate_Stack_SymbolName"> 
948                         <xsl:with-param name="iHorizIdx" select="@STACK_HORIZ_INDEX"/>
949                         <xsl:with-param name="iVertiIdx" select="@SHAPE_VERTI_INDEX"/>
950                 </xsl:call-template>            
951         </xsl:variable>
952         
953 <!--    
954         <xsl:message>The mp stack name is <xsl:value-of select="$mp_stack_name_"/></xsl:message>
955 -->     
956                 
957     <g id="{$symbol_name_}">
958
959                 <rect x="0"
960                       y="0"
961                           rx="6" 
962                           ry="6" 
963                       width = "{$memW_}"
964                       height= "{$memH_}"
965                           style="fill:{$COL_BG}; stroke:{$COL_WHITE}; stroke-width:2"/>         
966                           
967                 <!-- Draw the memory block-->             
968                 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[(@MODCLASS = 'MEMORY')]">
969                         
970                         <xsl:variable name="modInst_" select="@INSTANCE"/>
971                         
972                          <use  x="{ceiling($memW_ div 2) - ($BLKD_MOD_W div 2)}"  
973                                    y="0"  
974                                    xlink:href="#symbol_{$modInst_}"/> 
975                 </xsl:for-each>
976                 
977                 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[((@MODCLASS='MEMORY_CNTLR') and (@ORIENTED = 'WEST'))]">
978                         <xsl:variable name="modInst_" select="@INSTANCE"/>
979                         
980                          <use  x="0"  
981                                    y="{$BLKD_MOD_H}"  
982                                    xlink:href="#symbol_{$modInst_}"/> 
983                 </xsl:for-each>
984                 
985                 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[((@MODCLASS='MEMORY_CNTLR') and (@ORIENTED = 'EAST'))]">
986                         <xsl:variable name="modInst_" select="@INSTANCE"/>
987                         
988                          <use  x="{$BLKD_MOD_W}"  
989                                    y="{$BLKD_MOD_H}"  
990                                    xlink:href="#symbol_{$modInst_}"/> 
991                 </xsl:for-each>
992                 
993                 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[((@MODCLASS='MEMORY_CNTLR') and (@ORIENTED = 'CENTER'))]">
994                         <xsl:variable name="modInst_" select="@INSTANCE"/>
995                         
996                          <use  x="{ceiling($memW_ div 2) - ($BLKD_MOD_W div 2)}"  
997                                    y="{$BLKD_MOD_H}"  
998                                    xlink:href="#symbol_{$modInst_}"/> 
999                 </xsl:for-each>
1000                 
1001         </g>
1002         
1003 </xsl:template> 
1004
1005         
1006 <xsl:template name="Define_StandAlone_MemoryUnit"> 
1007         
1008         <xsl:param name="iShapeId" select="0"/>
1009         
1010         <xsl:variable name="mods_h_"  select="@MODS_H"/>
1011         <xsl:variable name="mods_w_"  select="@MODS_W"/>
1012         
1013         <xsl:variable name="memcName_"   select="MODULE[not(@MODCLASS = 'MEMORY')]/@INSTANCE"/>
1014         <xsl:variable name="memcBusStd_" select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/BCLANESPACES/BCLANESPACE/BUSCONNLANE[(BUSCONN[(@INSTANCE = $memcName_)])]/@BUSSTD"/>
1015         
1016 <!--    
1017         <xsl:variable name="memcBusStd_" select="/EDKSYSTEM/BLKDIAGRAM/BCLANESPACES/BCLANESPACE/BUSCONNLANE/@BUSSTD"/>
1018         <xsl:variable name="memcBusStd_" select="/EDKSYSTEM/BCLANESPACES/BCLANESPACE/BUSCONNLANE[(BUSCONN[(@INSTANCE)])]/@BUSSTD"/>
1019         <xsl:message>Memory cntlr name <xsl:value-of select="$memcName_"/></xsl:message>
1020         <xsl:message>Memory cntlr name <xsl:value-of select="$memcName_"/></xsl:message>
1021         <xsl:message>Memory cntlr busstd <xsl:value-of select="$memcBusStd_"/></xsl:message>
1022 -->     
1023         
1024         <xsl:variable name="peri_col_">
1025                 
1026                 <xsl:choose>
1027                         <xsl:when test="$mods_w_ &gt; 1">
1028                                 <xsl:value-of select="$COL_BG"/>
1029                         </xsl:when>
1030                         
1031                         <xsl:when test="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/BCLANESPACES/BCLANESPACE/BUSCONNLANE[(BUSCONN[(@INSTANCE = $memcName_)])]/@BUSSTD">
1032                                 <xsl:call-template name="F_BusStd2RGB">
1033                                         <xsl:with-param name="iBusStd" select="$memcBusStd_"/>
1034                                 </xsl:call-template>
1035                         </xsl:when>
1036                 
1037                         <xsl:otherwise>
1038                                 <xsl:call-template name="F_BusStd2RGB">
1039                                         <xsl:with-param name="iBusStd" select="'TRS'"/>
1040                                 </xsl:call-template>
1041                         </xsl:otherwise>
1042                 </xsl:choose>           
1043                 
1044         </xsl:variable>  
1045         
1046         <!-- first define its symbols as individual modules --> 
1047         <xsl:for-each select="MODULE[(@MODCLASS = 'MEMORY')]">
1048         
1049                 <xsl:variable name="modInst_" select="@INSTANCE"/>
1050                 <xsl:variable name="modType_" select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $modInst_)]/@MODTYPE"/>
1051                 
1052                 <xsl:call-template name="Define_Peripheral"> 
1053                         <xsl:with-param name="iModVori"  select="'rot180'"/>
1054                         <xsl:with-param name="iModInst"  select="$modInst_"/>
1055                         <xsl:with-param name="iModType"  select="$modType_"/>
1056                 </xsl:call-template>            
1057         </xsl:for-each> 
1058         
1059         <xsl:for-each select="MODULE[not(@MODCLASS='MEMORY')]">
1060                 <xsl:variable name="modInst_" select="@INSTANCE"/>
1061                 <xsl:variable name="modType_" select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $modInst_)]/@MODTYPE"/>
1062                 
1063 <!--            
1064                 <xsl:message>Memory cntlr inst <xsl:value-of select="$modInst_"/></xsl:message>
1065 -->             
1066                 <xsl:call-template name="Define_Peripheral"> 
1067                         <xsl:with-param name="iModVori"  select="'normal'"/>
1068                         <xsl:with-param name="iModInst"  select="$modInst_"/>
1069                         <xsl:with-param name="iModType"  select="$modType_"/>
1070                 </xsl:call-template>            
1071         </xsl:for-each> 
1072         
1073         <xsl:variable name="memW_" select="($BLKD_MOD_W * $mods_w_)"/>
1074         <xsl:variable name="memH_" select="($BLKD_MOD_H * $mods_h_)"/>
1075         
1076         <xsl:variable name="symbol_name_">
1077                 <xsl:call-template name="F_generate_Stack_SymbolName"> 
1078                         <xsl:with-param name="iHorizIdx" select="@STACK_HORIZ_INDEX"/>
1079                         <xsl:with-param name="iVertiIdx" select="@SHAPE_VERTI_INDEX"/>
1080                 </xsl:call-template>            
1081         </xsl:variable>
1082         
1083                 
1084     <g id="{$symbol_name_}">
1085                 
1086                 <rect x="0"
1087                       y="0"
1088                           rx="6" 
1089                           ry="6" 
1090                       width = "{$memW_ + 4}"
1091                       height= "{$memH_ + 4}"
1092                           style="fill:{$peri_col_}; stroke:{$peri_col_}; stroke-width:2"/>              
1093                           
1094
1095                 <!-- Draw the memory block-->             
1096                 <xsl:choose>
1097                         
1098                         <xsl:when test="$mods_w_ = 1">
1099                                 
1100                                 <xsl:for-each select="MODULE[(@MODCLASS='MEMORY')]">    
1101                                         <xsl:variable name="modInst_" select="@INSTANCE"/>
1102                                 
1103                                         <use  x="2"  
1104                                               y="{$BLKD_MOD_H + 2}"  
1105                                               xlink:href="#symbol_{$modInst_}"/> 
1106                                 </xsl:for-each>
1107                         
1108                         
1109                         <!-- Draw the memory controllers-->               
1110                                 <xsl:for-each select="MODULE[not(@MODCLASS='MEMORY')]"> 
1111                                         <xsl:variable name="modInst_" select="@INSTANCE"/>
1112                                 
1113                                         <use  x="2"  
1114                                                   y="0"  
1115                                               xlink:href="#symbol_{$modInst_}"/> 
1116                                 </xsl:for-each>
1117                         </xsl:when>     
1118                 
1119                         <xsl:when test="$mods_w_ &gt; 1">
1120                                 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[(@MODCLASS = 'MEMORY')]">
1121                                 
1122                                         <xsl:variable name="modInst_" select="@INSTANCE"/>
1123                                 
1124                                          <use  x="{ceiling($memW_ div 2) - ($BLKD_MOD_W div 2)}"  
1125                                                    y="{$BLKD_MOD_H + 2}"  
1126                                                    xlink:href="#symbol_{$modInst_}"/> 
1127                                 </xsl:for-each>
1128                         
1129                                 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[(not(@MODCLASS='MEMORY') and (@ORIENTED = 'WEST'))]">
1130                                         <xsl:variable name="modInst_" select="@INSTANCE"/>
1131                                 
1132                                         <use  x="0"  
1133                                               y="0"  
1134                                               xlink:href="#symbol_{$modInst_}"/> 
1135                                 </xsl:for-each>
1136                         
1137                                 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[(not(@MODCLASS='MEMORY') and (@ORIENTED = 'EAST'))]">
1138                                         <xsl:variable name="modInst_" select="@INSTANCE"/>
1139                                 
1140                                         <use  x="{$BLKD_MOD_W}"  
1141                                               y="0"  
1142                                               xlink:href="#symbol_{$modInst_}"/> 
1143                                 </xsl:for-each>
1144                         
1145                                 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[(not(@MODCLASS='MEMORY') and (@ORIENTED = 'CENTER'))]">       
1146                                         <xsl:variable name="modInst_" select="@INSTANCE"/>
1147                                 
1148                                         <use  x="{ceiling($memW_ div 2) - ($BLKD_MOD_W div 2)}"  
1149                                               y="0"  
1150                                                   xlink:href="#symbol_{$modInst_}"/> 
1151                             </xsl:for-each>
1152                                 
1153                         </xsl:when>     
1154                 </xsl:choose>
1155                           
1156         </g>                      
1157         
1158 </xsl:template> 
1159         
1160         
1161 <xsl:template name="Define_StandAlone_MPMC"> 
1162         
1163 <!--    
1164         <xsl:param name="drawarea_w"  select="500"/>
1165         <xsl:param name="drawarea_h"  select="500"/>
1166 -->     
1167         
1168         <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/MPMCSHAPE">
1169                 
1170                 <xsl:variable name="mpmcInst_" select="@INSTANCE"/>
1171                 <xsl:variable name="mpmcType_" select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[@INSTANCE=$mpmcInst_]/@MODTYPE"/>
1172 <!--            
1173                 <xsl:message>Drawing instance <xsl:value-of select="$mpmcInst_"/></xsl:message>
1174 -->             
1175                 
1176                 <xsl:variable name="mpmc_w_"  select="($G_Total_DrawArea_W - ($BLKD_INNER_GAP * 2))"/>
1177                 <xsl:variable name="label_y_"  select="ceiling($BLKD_MPMC_MOD_H div 2) - ceiling($BLKD_MOD_LABEL_H div 2)"/>
1178                 
1179                 <g id="mpmcmodule_{$mpmcInst_}">
1180                         <rect x="0"
1181                           y="0"
1182                           width = "{$mpmc_w_}"
1183                           height= "{$BLKD_MPMC_MOD_H}"
1184                               style="fill:{$COL_MPMC_BG}; stroke:{$COL_BLACK}; stroke-width:2"/>
1185                           
1186                     <rect x="{$BLKD_MOD_LANE_H}"
1187                           y="{$label_y_}"
1188                               rx="3"
1189                               ry="3"
1190                           width= "{$BLKD_MOD_LABEL_W}"
1191                           height="{$BLKD_MOD_LABEL_H}"
1192                               style="fill:{$COL_WHITE}; stroke:none;"/>
1193 <!-- 
1194                         <text class="bc_iptype" 
1195                                   x="{ceiling(($BLKD_MOD_LANE_H + $BLKD_MOD_LABEL_W) div 2)}"
1196                                   y="{$label_y_ + 8}">
1197                                         <xsl:value-of select="$mpmcType_"/>
1198                         </text>
1199                                 
1200                         <text class="bc_ipinst" 
1201                                   x="{ceiling(($BLKD_MOD_LANE_H + $BLKD_MOD_LABEL_W) div 2)}"
1202                                   y="{$label_y_ + 16}">
1203                                         <xsl:value-of select="$mpmcInst_"/>
1204                    </text>
1205                    
1206                         <text class="mpmc_title" 
1207                                   x="{ceiling($mpmc_w_ div 2)}"
1208                                   y="{$label_y_ + 16}">MPMC Module Interface</text>
1209 -->                     
1210                         <xsl:call-template name="F_WriteText">
1211                                 <xsl:with-param name="iX"               select="(ceiling(($BLKD_MOD_LANE_H + $BLKD_MOD_LABEL_W) div 2))"/>
1212                                 <xsl:with-param name="iY"               select="($label_y_ + 8)"/>
1213                                 <xsl:with-param name="iText"    select="$mpmcType_"/>
1214                                 <xsl:with-param name="iClass"   select="'bc_iptype'"/>
1215                         </xsl:call-template>    
1216                         
1217                         <xsl:call-template name="F_WriteText">
1218                                 <xsl:with-param name="iX"               select="(ceiling(($BLKD_MOD_LANE_H + $BLKD_MOD_LABEL_W) div 2))"/>
1219                                 <xsl:with-param name="iY"               select="($label_y_ + 16)"/>
1220                                 <xsl:with-param name="iText"    select="$mpmcInst_"/>
1221                                 <xsl:with-param name="iClass"   select="'bc_ipinst'"/>
1222                         </xsl:call-template>    
1223                         
1224                         <xsl:call-template name="F_WriteText">
1225                                 <xsl:with-param name="iX"               select="ceiling($mpmc_w_ div 2)"/>
1226                                 <xsl:with-param name="iY"               select="($label_y_ + 16)"/>
1227                                 <xsl:with-param name="iText"    select="'MPMC Module Interface'"/>
1228                                 <xsl:with-param name="iClass"   select="'mpmc_title'"/>
1229                         </xsl:call-template>    
1230                         
1231            
1232                 </g>    
1233                 
1234         </xsl:for-each>
1235         
1236 </xsl:template> 
1237         
1238
1239 <!-- ======================= END DEF FUNCTIONS ============================ -->
1240
1241 <!-- ======================= UTILITY FUNCTIONS ============================ -->
1242
1243 <xsl:template name="F_draw_InterruptSource">
1244
1245         <xsl:param name="iIntr_X"   select="0"/>
1246         <xsl:param name="iIntr_Y"   select="0"/>
1247         <xsl:param name="iIntr_PRI" select="0"/>
1248         <xsl:param name="iIntr_IDX" select="0"/>
1249         <xsl:param name="iIntr_COL" select="$COL_INTR_0"/>
1250         
1251                 <rect  
1252                         x="{$iIntr_X}"
1253                         y="{$iIntr_Y}"
1254                         rx="3"
1255                         ry="3"
1256                         width= "{$BLKD_INTR_W}" 
1257                         height="{ceiling($BLKD_INTR_H div 2)}" style="fill:{$iIntr_COL}; stroke:none; stroke-width:1"/> 
1258                         
1259                 <line x1="{$iIntr_X + ceiling($BLKD_INTR_W div 2)}" 
1260                           y1="{$iIntr_Y}"
1261                           x2="{$iIntr_X + ceiling($BLKD_INTR_W div 2)}" 
1262                           y2="{$iIntr_Y + ceiling($BLKD_INTR_H div 2)}" 
1263                           style="stroke:{$COL_BLACK};stroke-width:1"/>
1264                           
1265                 <xsl:variable name="txt_ofs_">
1266                         <xsl:if test="($iIntr_PRI &gt; 9)">4.5</xsl:if>
1267                         <xsl:if test="not($iIntr_PRI &gt; 9)">0</xsl:if>
1268                 </xsl:variable>   
1269                 
1270 <!-- 
1271                 <text class="intrsymbol" 
1272                           x="{$iIntr_X + 2 - $txt_ofs_}"
1273                           y="{$iIntr_Y + 8}">
1274                                 <xsl:value-of select="$iIntr_PRI"/>
1275                 </text>
1276                         
1277                 <text class="intrsymbol" 
1278                           x="{$iIntr_X + 2 + ceiling($BLKD_INTR_W div 2)}"
1279                           y="{$iIntr_Y + 8}">
1280                                 <xsl:value-of select="$iIntr_IDX"/>
1281                 </text>
1282 -->             
1283
1284                 <xsl:call-template name="F_WriteText">
1285                         <xsl:with-param name="iX"               select="($iIntr_X + 2 - $txt_ofs_)"/>
1286                         <xsl:with-param name="iY"               select="($iIntr_Y + 8)"/>
1287                         <xsl:with-param name="iText"    select="$iIntr_PRI"/>
1288                         <xsl:with-param name="iClass"   select="'intr_symbol'"/>
1289                 </xsl:call-template>    
1290                 
1291                 <xsl:call-template name="F_WriteText">
1292                         <xsl:with-param name="iX"               select="($iIntr_X + 2 + ceiling($BLKD_INTR_W div 2))"/>
1293                         <xsl:with-param name="iY"               select="($iIntr_Y + 8)"/>
1294                         <xsl:with-param name="iText"    select="$iIntr_IDX"/>
1295                         <xsl:with-param name="iClass"   select="'intr_symbol'"/>
1296                 </xsl:call-template>                    
1297                         
1298 </xsl:template>
1299
1300 <xsl:template name="F_draw_InterruptCntrl">
1301
1302         <xsl:param name="iIntr_X"   select="0"/>
1303         <xsl:param name="iIntr_Y"   select="0"/>
1304         <xsl:param name="iIntr_IDX" select="0"/>
1305         <xsl:param name="iIntr_COL" select="$COL_INTR_0"/>
1306         
1307                 <rect  
1308                         x="{$iIntr_X}"
1309                         y="{$iIntr_Y}"
1310                         rx="3"
1311                         ry="3"
1312                         width= "{ceiling($BLKD_INTR_W div 2)}" 
1313                         height="{$BLKD_INTR_H}" style="fill:{$iIntr_COL}; stroke:none; stroke-width:1"/> 
1314                         
1315                 <line x1="{$iIntr_X}" 
1316                           y1="{$iIntr_Y + ceiling($BLKD_INTR_H div 4)}"
1317                           x2="{$iIntr_X + ceiling($BLKD_INTR_W div 2)}" 
1318                           y2="{$iIntr_Y + ceiling($BLKD_INTR_H div 4)}" 
1319                           style="stroke:{$COL_BLACK};stroke-width:2"/>
1320 <!-- 
1321                 <text class="intrsymbol" 
1322                           x="{$iIntr_X + 2}"
1323                           y="{$iIntr_Y + 8 + ceiling($BLKD_INTR_H div 2)}">
1324                                 <xsl:value-of select="$iIntr_IDX"/>
1325                 </text>
1326 -->             
1327                 <xsl:call-template name="F_WriteText">
1328                         <xsl:with-param name="iX"               select="($iIntr_X + 2)"/>
1329                         <xsl:with-param name="iY"               select="($iIntr_Y + 8 + ceiling($BLKD_INTR_H div 2))"/>
1330                         <xsl:with-param name="iText"    select="$iIntr_IDX"/>
1331                         <xsl:with-param name="iClass"   select="'intr_symbol'"/>
1332                 </xsl:call-template>                    
1333                 
1334 </xsl:template>
1335
1336
1337 <xsl:template name="F_draw_InterruptedProc">
1338
1339         <xsl:param name="iIntr_X"   select="0"/>
1340         <xsl:param name="iIntr_Y"   select="0"/>
1341         <xsl:param name="iIntr_IDX" select="0"/>
1342         <xsl:param name="iIntr_COL" select="$COL_INTR_0"/>
1343         
1344                 <rect  
1345                         x="{$iIntr_X}"
1346                         y="{$iIntr_Y}"
1347                         rx="3"
1348                         ry="3"
1349                         width= "{ceiling($BLKD_INTR_W div 2)}" 
1350                         height="{$BLKD_INTR_H}" style="fill:{$iIntr_COL}; stroke:none; stroke-width:1"/> 
1351                         
1352                 <line x1="{$iIntr_X}" 
1353                           y1="{$iIntr_Y + ceiling($BLKD_INTR_H div 4) - 2}"
1354                           x2="{$iIntr_X + ceiling($BLKD_INTR_W div 2)}" 
1355                           y2="{$iIntr_Y + ceiling($BLKD_INTR_H div 4) - 2}" 
1356                           style="stroke:{$COL_BLACK};stroke-width:1"/>
1357                           
1358                 <line x1="{$iIntr_X}" 
1359                           y1="{$iIntr_Y + ceiling($BLKD_INTR_H div 4) + 2}"
1360                           x2="{$iIntr_X + ceiling($BLKD_INTR_W div 2)}" 
1361                           y2="{$iIntr_Y + ceiling($BLKD_INTR_H div 4) + 2}" 
1362                           style="stroke:{$COL_BLACK};stroke-width:1"/>
1363                           
1364 <!--
1365                 <text class="intrsymbol" 
1366                           x="{$iIntr_X + 2}"
1367                           y="{$iIntr_Y + 8 + ceiling($BLKD_INTR_H div 2)}">
1368                                 <xsl:value-of select="$iIntr_IDX"/>
1369                 </text>
1370  -->                      
1371                 
1372                 <xsl:call-template name="F_WriteText">
1373                         <xsl:with-param name="iX"               select="($iIntr_X + 2)"/>
1374                         <xsl:with-param name="iY"               select="($iIntr_Y + 8 + ceiling($BLKD_INTR_H div 2))"/>
1375                         <xsl:with-param name="iText"    select="$iIntr_IDX"/>
1376                         <xsl:with-param name="iClass"   select="'intr_symbol'"/>
1377                 </xsl:call-template>                    
1378                         
1379 </xsl:template>
1380
1381 <xsl:template name="F_Calc_CStackShapesAbv_Height">
1382         <xsl:param name="iCStackIndex"  select="100"/>
1383         <xsl:param name="iCStackMods_Y" select="1000"/>
1384         
1385 <!--    
1386         <xsl:message>Stack Index <xsl:value-of select="$cstackIndex"/></xsl:message>
1387         
1388         <xsl:message>Stack Y <xsl:value-of select="$cstackModY"/></xsl:message>
1389 -->     
1390         <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@CSTACK_INDEX = $iCStackIndex)])">0</xsl:if>
1391         
1392         <xsl:if test="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@CSTACK_INDEX = $iCStackIndex)]">
1393         
1394                 <xsl:variable name="shapesAbv_Heights_">
1395                         <CSTACK_MOD HEIGHT="0"/>
1396                         
1397                         <!-- Store the heights of all the peripherals above this one heights in a variable -->
1398                         <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[((@CSTACK_INDEX = $iCStackIndex) and (@CSTACK_MODS_Y &lt; $iCStackMods_Y))]">
1399                                 
1400                                 <xsl:variable name="shapeHeight_">
1401                                         
1402                                         <xsl:choose>
1403                                                 
1404                                                 <xsl:when test="@MODCLASS = 'PERIPHERAL'">
1405                                                         <xsl:call-template name="F_Calc_PeriShape_Height">      
1406                                                                 <xsl:with-param name="iShapeInst" select="MODULE/@INSTANCE"/>
1407                                                         </xsl:call-template>    
1408                                                 </xsl:when>
1409                                                 
1410                                                 <xsl:when test="@MODCLASS = 'MEMORY_UNIT'">
1411                                                         <xsl:call-template name="F_Calc_MemoryUnit_Height">     
1412                                                                 <xsl:with-param name="iShapeId" select="@SHAPE_ID"/>
1413                                                         </xsl:call-template>    
1414                                                 </xsl:when>
1415                                                 
1416                                                 <xsl:otherwise>0</xsl:otherwise>
1417                                         </xsl:choose>
1418                                 </xsl:variable>
1419                                 
1420 <!--                            
1421                                 <xsl:message>Calculated height of cstack shape of type <xsl:value-of select="@MODCLASS"/> as <xsl:value-of select="$shapeHeight_"/></xsl:message>
1422 -->                     
1423                                 
1424                                 <CSTACK_MOD HEIGHT="{$shapeHeight_ + $BLKD_BIF_H}"/>
1425                         </xsl:for-each>
1426                 </xsl:variable>
1427                 
1428 <!--            
1429                 <xsl:message>Calculated height of cstack as <xsl:value-of select="sum(exsl:node-set($shapesAbv_Heights_)/CSTACK_MOD/@HEIGHT)"/></xsl:message>
1430 -->             
1431                 
1432                 <xsl:value-of select="sum(exsl:node-set($shapesAbv_Heights_)/CSTACK_MOD/@HEIGHT)"/>
1433         </xsl:if>
1434         
1435 </xsl:template>
1436
1437
1438 <xsl:template name="F_Calc_PeriShape_Height">
1439         <xsl:param name="iShapeInst"  select="'_shape_'"/>
1440         
1441 <!--    
1442         <xsl:message>Calculating height of <xsl:value-of select="$iShapeInst"/></xsl:message>
1443 -->     
1444         
1445         <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE/MODULE[(@INSTANCE = $iShapeInst)]/@BIFS_H) and 
1446                       not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE[(@INSTANCE = $iShapeInst)]/@BIFS_H) and 
1447                       not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/BRIDGESHAPES/MODULE[(@INSTANCE = $iShapeInst)]/@BIFS_H)">0</xsl:if>
1448         
1449         <xsl:if test="($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE/MODULE[(@INSTANCE = $iShapeInst)]/@BIFS_H)">
1450                 <xsl:variable name="bifs_h_" select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE/MODULE[(@INSTANCE = $iShapeInst)]/@BIFS_H"/>
1451                 
1452                 <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))"/>
1453         </xsl:if>
1454         
1455         <xsl:if test="($G_ROOT/EDKSYSTEM/BLKDIAGRAM/BRIDGESHAPES/MODULE[(@INSTANCE = $iShapeInst)]/@BIFS_H)">
1456                 <xsl:variable name="bifs_h_" select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/BRIDGESHAPES/MODULE[(@INSTANCE = $iShapeInst)]/@BIFS_H"/>
1457                 
1458                 <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))"/>
1459         </xsl:if>
1460         
1461         <xsl:if test="($G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE[(@INSTANCE = $iShapeInst)]/@BIFS_H)">
1462                 <xsl:variable name="bifs_h_" select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/PROCSHAPES/MODULE[(@INSTANCE = $iShapeInst)]/@BIFS_H"/>
1463                 
1464                 <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))"/>
1465         </xsl:if>
1466         
1467 </xsl:template>
1468         
1469 <xsl:template name="F_Calc_Shape_Height">
1470         <xsl:param name="iShapeId"  select="_shape_"/>
1471         
1472 <!--    
1473         <xsl:message>Calculating height of <xsl:value-of select="$shapeId"/></xsl:message>
1474 -->     
1475         
1476         <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)])">0</xsl:if>
1477         
1478         <xsl:if test="($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE/@BIFS_H)">
1479                 <xsl:variable name="bifs_h_" select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE/@BIFS_H"/>
1480                 
1481                 <xsl:value-of select="($BLKD_MOD_LABEL_H + ($BIF_H * $bifs_h_) + ($BLKD_MOD_BIF_GAP_V * $bifs_h_) + ($BLKD_MOD_LANE_H * 2))"/>
1482         </xsl:if>
1483         
1484 </xsl:template>
1485
1486
1487 <xsl:template name="F_Calc_MemoryUnit_Height">
1488         <xsl:param name="iShapeId"  select="1000"/>
1489         
1490         <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)])">0</xsl:if>
1491         
1492         <xsl:if test="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]">
1493         
1494                 <!-- Store the memory controller heights in a variable -->      
1495                 <xsl:variable name="memC_heights_">     
1496                         <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[(@MODCLASS = 'MEMORY_CNTLR')])">
1497                                 <MEM_CNTLR INSTANCE="{@INSTANCE}" HEIGHT="0"/>
1498                         </xsl:if>
1499                         
1500                         <xsl:if test="($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[(@MODCLASS = 'MEMORY_CNTLR')])">
1501                                 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[(@MODCLASS = 'MEMORY_CNTLR')]">
1502                                         <xsl:variable name="memC_height_">
1503                                                 <xsl:call-template name="F_Calc_PeriShape_Height">      
1504                                                         <xsl:with-param name="iShapeInst" select="@INSTANCE"/>
1505                                                 </xsl:call-template>
1506                                         </xsl:variable>
1507                                         <MEM_CNTLR INSTANCE="{@INSTANCE}" HEIGHT="{$memC_height_}"/>
1508                                 </xsl:for-each>
1509                         </xsl:if>
1510                 </xsl:variable>
1511                 
1512                 <!-- Store the bram heights in a variable -->   
1513                 <xsl:variable name="bram_heights_">     
1514                         <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[not(@MODCLASS = 'MEMORY_CNTLR')])">
1515                                 <BRAM INSTANCE="{@INSTANCE}" HEIGHT="0"/>
1516                         </xsl:if>
1517                         <xsl:if test="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[not(@MODCLASS = 'MEMORY_CNTLR')]">
1518                                 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/CMPLXSHAPE[(@SHAPE_ID = $iShapeId)]/MODULE[not(@MODCLASS = 'MEMORY_CNTLR')]">
1519                                         <xsl:variable name="bram_height_">
1520                                                 <xsl:call-template name="F_Calc_PeriShape_Height">      
1521                                                         <xsl:with-param name="iShapeInst" select="@INSTANCE"/>
1522                                                 </xsl:call-template>
1523                                         </xsl:variable>
1524                                         <BRAM INSTANCE="{@INSTANCE}" HEIGHT="{$bram_height_}"/>
1525                                 </xsl:for-each>
1526                         </xsl:if>
1527                 </xsl:variable>
1528                 
1529                 <!-- Select the maximum of them -->
1530                 <xsl:variable name="max_bram_height_" select="math:max(exsl:node-set($bram_heights_)/BRAM/@HEIGHT)"/>
1531                 <xsl:variable name="max_memC_height_" select="math:max(exsl:node-set($memC_heights_)/MEM_CNTLR/@HEIGHT)"/>
1532                 
1533                 <xsl:value-of select="$max_bram_height_ + $max_memC_height_"/>
1534         </xsl:if>
1535
1536 </xsl:template>
1537
1538
1539 <xsl:template name="F_Calc_SbsBucket_Height">
1540         <xsl:param name="iBucketId"  select="100"/>
1541         
1542 <!--    
1543         <xsl:message>Looking of height of bucket <xsl:value-of select="$iBucketId"/></xsl:message>
1544 -->     
1545         <xsl:variable name="bkt_gap_" select="$BLKD_BIF_H"/>
1546         
1547         <xsl:if test="not($G_ROOT/EDKSYSTEM/BLKDIAGRAM/SBSBUCKETS/SBSBUCKET[(@BUS_INDEX = $iBucketId)])">0</xsl:if>
1548         
1549         <xsl:if test="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/SBSBUCKETS/SBSBUCKET[(@BUS_INDEX = $iBucketId)]">
1550                 <xsl:variable name="mods_h_" select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/SBSBUCKETS/SBSBUCKET[(@BUS_INDEX = $iBucketId)]/@MODS_H"/>
1551                 <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_)"/>
1552         </xsl:if>
1553 </xsl:template>
1554         
1555 <!--
1556         ===============================================
1557         
1558                 Symbol Naming Functions
1559         
1560         ===============================================
1561 -->             
1562         
1563         
1564 <xsl:template name="F_generate_Proc_StackName">
1565 <xsl:param name="iProcInst"  select="'_unknown_'"/>
1566 symbol_STACK_<xsl:value-of select="$iProcInst"/>
1567 </xsl:template>
1568         
1569 <xsl:template name="F_generate_Proc_GroupName">
1570 <xsl:param name="iProcInst"  select="'_unknown_'"/>
1571 symbol_GROUP_<xsl:value-of select="$iProcInst"/>
1572 </xsl:template>
1573         
1574         
1575 <xsl:template name="F_generate_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>
1576 <xsl:template name="F_generate_Stack_Name"><xsl:param name="iHorizIdx"       select="'_unknown_'"/>symbol_STACK_<xsl:value-of select="$iHorizIdx"/></xsl:template>
1577 <xsl:template name="F_generate_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>
1578         
1579
1580 <!-- ======================= END UTILITY FUNCTIONS  ======================= -->
1581 </xsl:stylesheet>
1582