]> git.sur5r.net Git - freertos/blob - Demo/PPC405_Xilinx_Virtex4_GCC/__xps/.dswkshop/MdtXdsSVG_BlockDiagram.xsl
Add PPC405 port in V10.1 format.
[freertos] / Demo / PPC405_Xilinx_Virtex4_GCC / __xps / .dswkshop / MdtXdsSVG_BlockDiagram.xsl
1 <?xml version="1.0" standalone="no"?>
2 <xsl:stylesheet version="1.0"
3            xmlns:svg="http://www.w3.org/2000/svg"
4            xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5            xmlns:exsl="http://exslt.org/common"
6            xmlns:math="http://exslt.org/math"
7                xmlns:xlink="http://www.w3.org/1999/xlink"
8            extension-element-prefixes="math">
9                    
10 <xsl:include href="MdtXdsSVG_Colors.xsl"/>
11
12 <xsl:include href="MdtXdsSVG_BlkDBifDefs.xsl"/>
13 <xsl:include href="MdtXdsSVG_BlkdBusses.xsl"/>
14 <xsl:include href="MdtXdsSVG_BlkdIOPorts.xsl"/>
15 <xsl:include href="MdtXdsSVG_BlkdProcessors.xsl"/>
16 <xsl:include href="MdtXdsSVG_BlkDDimensions.xsl"/>
17 <xsl:include href="MdtXdsSVG_BlkDModuleDefs.xsl"/>
18 <xsl:include href="MdtXdsSVG_BlkDPeripherals.xsl"/>
19 <xsl:include href="MdtXdsSVG_BlkDCalculations.xsl"/>
20 <xsl:include href="MdtXdsSVG_BlkDBusLaneSpaces.xsl"/>
21         
22 <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"
23                doctype-public="-//W3C//DTD SVG 1.0//EN"
24                    doctype-system="svg10.dtd"/>
25         
26 <xsl:param    name="ADD_VIEWBOX"        select="'FALSE'"/>                 
27 <xsl:param    name="CSS_RENDER"         select="'MdtXdsSVG_Render.css'"/>
28 <xsl:param    name="IN_TESTMODE"        select="'FALSE'"/>
29                 
30         
31 <!-- ======================= MAIN SVG BLOCK =============================== -->
32 <xsl:template match="EDKSYSTEM">
33
34 <!-- ===========================================================================
35     Calculate the width of the Block Diagram based on the total number of      
36     buslanes and modules in the design. If there are no buslanes or modules,
37         a default width, just wide enough to display the KEY and SPECS is used
38    =========================================================================== -->
39         
40 <xsl:variable name="totalStacksW_">
41         <xsl:call-template name="_calc_Stack_X">
42                 <xsl:with-param name="stackIdx"     select="(BLKDSHAPES/@STACK_HORIZ_WIDTH)"/>
43         </xsl:call-template>
44 </xsl:variable>
45         
46 <xsl:variable name="numBridges_"        select="count(BLKDSHAPES/BRIDGESHAPES/MODULE)"/>
47 <xsl:variable name="totalBridgesW_"     select="(($numBridges_ * ($periMOD_W + ($BUS_LANE_W * 2))) + $BRIDGE_GAP)"/>
48 <xsl:variable name="BLKD_DRAWAREA_CLC"  select="$totalStacksW_ + $totalBridgesW_ + ($BLKD_INNER_GAP * 2)"/>
49         
50
51 <xsl:variable name="BLKD_DRAWAREA_W">
52         <xsl:if test="$BLKD_DRAWAREA_CLC &gt; ($BLKD_KEY_W + $BLKD_SPECS_W + $SPECS2KEY_GAP)">
53                 <xsl:value-of select="$BLKD_DRAWAREA_CLC"/>
54         </xsl:if>
55         <xsl:if test="not($BLKD_DRAWAREA_CLC &gt; ($BLKD_KEY_W + $BLKD_SPECS_W + $SPECS2KEY_GAP))">
56                 <xsl:value-of select="($BLKD_KEY_W + $BLKD_SPECS_W + $SPECS2KEY_GAP)"/>
57         </xsl:if>
58 </xsl:variable>
59 <xsl:variable name="BLKD_W"             select="($BLKD_DRAWAREA_W + (($BLKD_PRTCHAN_W  + $BLKD_IORCHAN_W)* 2))"/>
60
61 <!-- =========================================================================== -->
62 <!-- Calculate the height of the Block Diagram based on the total number of      -->
63 <!-- buslanes and modules in the design. Take into account special shapes such   -->
64 <!-- as MultiProc shapes.                                                                                                            -->
65 <!-- =========================================================================== -->
66         
67 <xsl:variable name="max_Stack_BlwSbs_H_">
68         <xsl:call-template name="_calc_Max_Stack_BlwSbs_Height"/>
69 </xsl:variable>
70
71 <xsl:variable name="max_Stack_AbvSbs_H_">
72         <xsl:call-template name="_calc_Max_Stack_AbvSbs_Height"/>
73 </xsl:variable>
74         
75
76 <xsl:variable name="numSbs_"            select="count(BLKDSHAPES/SBSSHAPES/MODULE)"/>
77 <xsl:variable name="totalSbs_H_"        select="($numSbs_ * $SBS_LANE_H)"/>
78
79 <xsl:variable name="IpBktMods_H_">
80         <xsl:if test="BLKDSHAPES/IPBUCKET/@MODS_H"><xsl:value-of select="BLKDSHAPES/IPBUCKET/@MODS_H"/></xsl:if>
81         <xsl:if test="not(BLKDSHAPES/IPBUCKET/@MODS_H)">0</xsl:if>
82 </xsl:variable>
83 <xsl:variable name="totalIpBkt_H_"       select="($IpBktMods_H_ * ($periMOD_H + $BIF_H))"/>
84
85         
86 <xsl:variable name="totalUnkBkt_H_">
87         <xsl:if test="BLKDSHAPES/UNKBUCKET">
88         
89                 <xsl:variable name="UnkBktModsH_">
90                         <xsl:if test="BLKDSHAPES/UNKBUCKET/@MODS_H"><xsl:value-of select="BLKDSHAPES/UNKBUCKET/@MODS_H"/></xsl:if>
91                         <xsl:if test="not(BLKDSHAPES/UNKBUCKET/@MODS_H)">0</xsl:if>
92                 </xsl:variable>
93                 <xsl:variable name="totalUnkModH_"       select="($UnkBktModsH_ * ($periMOD_H + $BIF_H))"/>
94                 
95                 <xsl:variable name="UnkBktBifsH_">
96                         <xsl:if test="BLKDSHAPES/UNKBUCKET/@BIFS_H"><xsl:value-of select="BLKDSHAPES/UNKBUCKET/@BIFS_H"/></xsl:if>
97                         <xsl:if test="not(BLKDSHAPES/UNKBUCKET/@BIFS_H)">0</xsl:if>
98                 </xsl:variable>
99                 <xsl:variable name="totalUnkBifH_"       select="($UnkBktBifsH_ * ($periMOD_H + $BIF_H))"/>
100                 
101                 <xsl:value-of select="($totalUnkBifH_ + $totalUnkModH_)"/>      
102         </xsl:if>
103         
104         <xsl:if test="not(BLKDSHAPES/UNKBUCKET)">0</xsl:if>
105 </xsl:variable>
106
107 <xsl:variable name="BLKD_DRAWAREA_H"    select="($max_Stack_AbvSbs_H_ + $PROC2SBS_GAP + $totalSbs_H_ + $max_Stack_BlwSbs_H_ + $SBS2IP_GAP + $totalIpBkt_H_ + $IP2UNK_GAP + $totalUnkBkt_H_ + ($BLKD_INNER_GAP * 2))"/>
108 <xsl:variable name="BLKD_H"             select="($BLKD_DRAWAREA_H + (($BLKD_PRTCHAN_H  + $BLKD_IORCHAN_H)* 2))"/>
109         
110 <!--    
111 <xsl:variable name="BLKD_TOTAL_H"       select="($BLKD_H + $BLKD2KEY_GAP + $BLKD_KEY_H)"/>
112 -->     
113 <xsl:variable name="BLKD_TOTAL_H">
114         <xsl:if test="($IN_TESTMODE = 'TRUE')">
115                 <xsl:message>Generating Blkdiagram in TestMode </xsl:message>
116        <xsl:value-of select="$BLKD_H"/>
117         </xsl:if>
118         <xsl:if test="(not($IN_TESTMODE) or ($IN_TESTMODE = 'FALSE'))">
119        <xsl:value-of select="($BLKD_H + $BLKD2KEY_GAP + $BLKD_KEY_H)"/>
120         </xsl:if>
121 </xsl:variable>
122         
123         
124         
125 <!--
126 <xsl:message>Found Blkd Total as <xsl:value-of select="$BLKD_TOTAL_H"/></xsl:message>
127 <xsl:message>Found max abv as <xsl:value-of select="$max_Stack_AbvSbs_H_"/></xsl:message>
128 <xsl:message>Found max blw as <xsl:value-of select="$max_Stack_BlwSbs_H_"/></xsl:message>
129 <xsl:message>Found Blkd DrawArea height as <xsl:value-of select="$BLKD_DRAWAREA_H"/></xsl:message>
130 <xsl:message>Found Ip Bkt as <xsl:value-of select="$totalIpBkt_H_"/></xsl:message>
131 <xsl:message>Found Sbs as <xsl:value-of select="$totalSbs_H_"/></xsl:message>
132 <xsl:message>Found Unk Bkt as <xsl:value-of select="$totalUnkBkt_H_"/></xsl:message>
133 -->
134
135
136 <!--specify a css for the file -->
137 <xsl:processing-instruction name="xml-stylesheet">href="<xsl:value-of select="$CSS_RENDER"/>" type="text/css"</xsl:processing-instruction>
138         
139 <xsl:variable name="BLKD_ZOOM_Y">
140         <xsl:choose>
141                 <xsl:when test="($ADD_VIEWBOX = 'TRUE')">
142                                 <xsl:value-of select="($BLKD_TOTAL_H * 2)"/>
143                 </xsl:when>
144                 <xsl:otherwise>0</xsl:otherwise>                
145         </xsl:choose>
146 </xsl:variable>
147         
148 <xsl:text>&#10;</xsl:text>
149 <svg width="{$BLKD_W}" height="{$BLKD_TOTAL_H}" viewBox="0 0 0 {$BLKD_ZOOM_Y}"> 
150 <!-- =============================================== -->
151 <!--        Layout All the various definitions       -->
152 <!-- =============================================== -->
153         <defs>
154                 <!-- Diagram Key Definition -->
155                 <xsl:call-template name="Define_BlkDiagram_Key"/>               
156                 
157                 <!-- Diagram Specs Definition -->
158                 <xsl:call-template name="Define_BlkDiagram_Specs">              
159                         <xsl:with-param name="blkd_arch"     select="@ARCH"/>
160                         <xsl:with-param name="blkd_part"     select="@PART"/>
161                         <xsl:with-param name="blkd_edkver"   select="@EDKVERSION"/>
162                         <xsl:with-param name="blkd_gentime"  select="@TIMESTAMP"/>
163                 </xsl:call-template>            
164                 
165                 <!-- IO Port Defs -->
166                 <xsl:call-template name="Define_IOPorts">               
167                         <xsl:with-param name="drawarea_w" select="$BLKD_DRAWAREA_W"/>
168                         <xsl:with-param name="drawarea_h" select="$BLKD_DRAWAREA_H"/>
169                 </xsl:call-template>    
170                 
171                 <!-- BIF Defs -->
172                 <xsl:call-template name="Define_BifTypes"/>             
173                 
174                 <!-- Bus Defs -->
175                 <xsl:call-template name="Define_Busses">                
176                         <xsl:with-param name="drawarea_w" select="$BLKD_DRAWAREA_W"/>
177                         <xsl:with-param name="drawarea_h" select="$BLKD_DRAWAREA_H"/>
178                 </xsl:call-template>    
179                 
180                 <!-- Shared Bus Buckets Defs -->
181                 <xsl:call-template name="Define_SBSBuckets"/>           
182                 
183                 <!-- IP Bucket Defs -->
184                 <xsl:call-template name="Define_IPBucket"/>             
185                 
186                 <!-- Stack Defs -->
187                 <xsl:call-template name="Define_AllStacks"/>            
188                 
189                 <!-- Space Defs -->
190                 <xsl:call-template name="Define_BusLaneSpaces"/>                
191                 
192                 <!-- Ext port Defs -->
193 <!--            
194                 <xsl:call-template name="Define_ExtPortsTable"/>                
195 -->     
196                         
197                         
198         </defs>
199         
200 <!-- =============================================== -->
201 <!--             Draw Outlines                       -->
202 <!-- =============================================== -->
203         
204          <!-- The surrounding black liner -->
205      <rect x="0"  
206                    y="0" 
207                    width ="{$BLKD_W}"
208                    height="{$BLKD_TOTAL_H}" style="fill:{$COL_WHITE}; stroke:{$COL_BLACK};stroke-width:4"/>
209                    
210          <!-- The outer IO channel -->
211      <rect x="{$BLKD_PRTCHAN_W}"  
212                    y="{$BLKD_PRTCHAN_H}" 
213                    width= "{$BLKD_W - ($BLKD_PRTCHAN_W * 2)}" 
214                    height="{$BLKD_H - ($BLKD_PRTCHAN_H * 2)}" style="fill:{$COL_IORING}"/>
215                    
216          <!-- The Diagram's drawing area -->
217      <rect x="{$BLKD_PRTCHAN_W + $BLKD_IORCHAN_W}"  
218                    y="{$BLKD_PRTCHAN_H + $BLKD_IORCHAN_H}" 
219                    width= "{$BLKD_DRAWAREA_W}"
220                    height="{$BLKD_DRAWAREA_H}" rx="8" ry="8" style="fill:{$COL_BG}"/>
221                    
222 <!-- =============================================== -->
223 <!--        Draw All the various components          -->
224 <!-- =============================================== -->
225         
226         <!--   Layout the IO Ports    -->       
227         <xsl:if test="(not($IN_TESTMODE) or ($IN_TESTMODE = 'FALSE'))">
228                 <xsl:call-template name="Draw_IOPorts">         
229                         <xsl:with-param name="drawarea_w" select="$BLKD_DRAWAREA_W"/>
230                         <xsl:with-param name="drawarea_h" select="$BLKD_DRAWAREA_H"/>
231                 </xsl:call-template>    
232         </xsl:if>
233         
234         <!--   Layout the Shapes      -->       
235         <xsl:call-template name="Draw_BlkDiagram_Shapes">               
236                 <xsl:with-param name="blkd_w"     select="$BLKD_W"/>
237                 <xsl:with-param name="blkd_h"     select="$BLKD_H"/>
238                 <xsl:with-param name="drawarea_w" select="$BLKD_DRAWAREA_W"/>
239                 <xsl:with-param name="drawarea_h" select="$BLKD_DRAWAREA_H"/>
240         </xsl:call-template>    
241         
242         
243 </svg>
244
245 <!-- ======================= END MAIN SVG BLOCK =============================== -->
246 </xsl:template>
247         
248 <xsl:template name="Draw_BlkDiagram_Shapes">
249         <xsl:param name="blkd_w"     select="820"/>
250         <xsl:param name="blkd_h"     select="520"/>
251         <xsl:param name="drawarea_w" select="800"/>
252         <xsl:param name="drawarea_h" select="500"/>
253         
254         
255         <xsl:variable name="max_Stack_AbvSbs_H_">
256                 <xsl:call-template name="_calc_Max_Stack_AbvSbs_Height"/>
257         </xsl:variable>
258         
259         <xsl:variable name="max_Stack_BlwSbs_H_">
260                 <xsl:call-template name="_calc_Max_Stack_BlwSbs_Height"/>
261         </xsl:variable>
262         
263         <xsl:variable name="numSbs_"    select="count(/EDKSYSTEM/BLKDSHAPES/SBSSHAPES/MODULE)"/>
264         <xsl:variable name="sbs_h_"     select="($numSbs_  * $SBS_LANE_H)"/>
265         <xsl:variable name="sbs_y_"     select="($BLKD_INNER_Y + $max_Stack_AbvSbs_H_ + $PROC2SBS_GAP)"/>
266         
267         <!-- 
268                  ===========================================================
269                                                 Draw the shared busses 
270                  ===========================================================
271         -->
272         <use   x="{$BLKD_INNER_Y}"    y="{$sbs_y_ + $PROC2SBS_GAP}"  xlink:href="#group_sharedBusses"/> 
273         
274         
275         <!-- 
276                  ===========================================================
277                                                 Draw the Bus Lane Spaces 
278                  ===========================================================
279         -->
280         <xsl:call-template name="Draw_BlkDiagram_BusLaneSpaces">
281                 <xsl:with-param name="sbs_Y"  select="$sbs_y_"/>
282         </xsl:call-template>    
283         
284         <!-- 
285                  ===========================================================
286                                                 Draw the Bridges
287                  ===========================================================
288         -->
289         <xsl:call-template name="Draw_BlkDiagram_Bridges">
290                 <xsl:with-param name="sbs_Y"    select="$sbs_y_"/>
291                 <xsl:with-param name="inner_X"  select="$BLKD_INNER_Y"/>
292         </xsl:call-template>    
293         
294         
295         <!-- 
296                  ===========================================================
297                                                 Draw the Stacks
298                  ===========================================================
299         -->
300         <xsl:call-template name="Draw_BlkDiagram_Stacks">
301                 <xsl:with-param name="sbs_Y"  select="$sbs_y_"/>
302         </xsl:call-template>    
303         
304         
305         <!-- 
306                  ===========================================================
307                                                 Draw the Ip Bucket
308                  ===========================================================
309         -->
310         
311         <xsl:call-template name="Draw_BlkDiagram_IPBucket">
312                 <xsl:with-param name="blkd_W"               select="$blkd_w"/>
313                 <xsl:with-param name="sbs_Y"                            select="$sbs_y_"/>
314                 <xsl:with-param name="sbs_H"                            select="$sbs_h_"/>
315             <xsl:with-param name="max_Stack_AbvSbs_H"   select="$max_Stack_AbvSbs_H_"/>
316             <xsl:with-param name="max_Stack_BlwSbs_H"   select="$max_Stack_BlwSbs_H_"/>
317         </xsl:call-template>    
318         
319         <!-- 
320                  ===========================================================
321                                                 Draw the shared busses 
322                  ===========================================================
323         <use   x="{$BLKD_INNER_Y}"    y="{$sbs_y_ + $PROC2SBS_GAP}"  xlink:href="#group_sharedBusses"/> 
324         -->
325         
326         <!-- 
327                  ===========================================================
328                                                 Draw the Key
329                  ===========================================================
330         -->
331         <xsl:if test="(not($IN_TESTMODE) or ($IN_TESTMODE = 'FALSE'))">
332                 <use   x="{$blkd_w - $BLKD_KEY_W - $BLKD_PRTCHAN_W}"   y="{$blkd_h + $BLKD2KEY_GAP - 8}"  xlink:href="#BlkDiagram_Key"/> 
333         </xsl:if>
334         
335         <!-- 
336                  ===========================================================
337                                                 Draw the Specs
338                  ===========================================================
339         -->
340         <xsl:if test="(not($IN_TESTMODE) or ($IN_TESTMODE = 'FALSE'))">
341                 <use   x="{$BLKD_PRTCHAN_W}"                           y="{$blkd_h + $BLKD2KEY_GAP - 8}"  xlink:href="#BlkDiagram_Specs"/> 
342         </xsl:if>
343         
344         <!-- 
345                 ************************************************************ 
346                 ***************  DONE DRAWING BLOCK DIAGRAM   ************** 
347                 ************************************************************ 
348         -->     
349         
350 </xsl:template> 
351         
352         
353 <!-- ======================================================================= -->
354 <!--                         FUNCTION TEMPLATE                               -->
355 <!--                                                                                                                                             -->
356 <!--  Draw Stacks on the Block Diagram                                                                           -->
357 <!-- ======================================================================= -->
358 <xsl:template name="Draw_BlkDiagram_Stacks">
359         
360         <xsl:param name="sbs_Y"     select="$BLKD_INNER_Y"/>
361         
362         <xsl:variable name="max_stack_AbvSbs_H_">
363                 <xsl:call-template name="_calc_Max_Stack_AbvSbs_Height"/>
364         </xsl:variable>
365         
366 <!--    
367         <xsl:variable name="inner_X_"   select="($BLKD_PRTCHAN_W  + $BLKD_IORCHAN_W + $BLKD_INNER_GAP)"/>
368         <xsl:variable name="inner_Y_"   select="($BLKD_PRTCHAN_H  + $BLKD_IORCHAN_H + $BLKD_INNER_GAP)"/>
369         <xsl:variable name="numSbs_"    select="count(BLKDSHAPES/SBSSHAPES/MODULE)"/>
370         <xsl:variable name="sbs_h_"     select="($numSbs_  * $SBS_LANE_H)"/>
371         <xsl:variable name="sbs_y_"     select="($inner_Y_ + $max_stack_AbvSbs_H_ + $PROC2SBS_GAP)"/>
372         
373         <xsl:variable name="numSbs_"    select="count(/BLKDSHAPES/SBSSHAPES/MODULE)"/>
374         <xsl:variable name="sbs_h_"     select="($numSbs_  * $SBS_LANE_H)"/>
375         <xsl:variable name="sbs_y_"     select="($BLKD_INNER_Y + $max_stack_AbvSbs_H_ + $PROC2SBS_GAP)"/>
376 -->     
377         
378         <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/BCLANESPACES/BCLANESPACE[(@EAST &lt; /EDKSYSTEM/BLKDSHAPES/@STACK_HORIZ_WIDTH)]">
379                         
380                 <xsl:variable name="stack_line_x_">
381                         <xsl:call-template name="_calc_Stack_X">
382                                 <xsl:with-param name="stackIdx"  select="@EAST"/>
383                         </xsl:call-template>
384                 </xsl:variable>
385                 
386                 <xsl:variable name="stack_abv_sbs_">
387                         <xsl:call-template name="_calc_Stack_AbvSbs_Height">
388                                 <xsl:with-param name="stackIdx"  select="@EAST"/>
389                         </xsl:call-template>
390                 </xsl:variable>
391                 
392                 <xsl:variable name="numBridges_"   select="count(/EDKSYSTEM/BLKDSHAPES/BRIDGESHAPES/MODULE)"/>
393                 <xsl:variable name="bridges_w_"    select="(($numBridges_ * ($periMOD_W + ($BUS_LANE_W * 2))) + $BRIDGE_GAP)"/>
394                 
395                 <xsl:variable name="stack_y_" select="($sbs_Y - $stack_abv_sbs_)"/>
396                 <xsl:variable name="stack_x_" select="($BLKD_INNER_X + $stack_line_x_ + $bridges_w_)"/>
397                 
398                 <xsl:variable name="stack_name_">
399                         <xsl:call-template name="_gen_Stack_Name"> 
400                                 <xsl:with-param name="horizIdx" select="@EAST"/>
401                         </xsl:call-template>            
402                 </xsl:variable> 
403                 
404                 <use   x="{$stack_x_}"    y="{$stack_y_}"  xlink:href="#{$stack_name_}"/> 
405         
406 <!--            
407                 <xsl:message>Stack Idx <xsl:value-of select="@EAST"/></xsl:message>     
408                 <xsl:message>Stack X <xsl:value-of select="$stack_x_"/></xsl:message>   
409                 <xsl:message>Stack Y <xsl:value-of select="$stack_y_"/></xsl:message>   
410 -->     
411                 
412         </xsl:for-each> 
413                         
414 </xsl:template>
415         
416 <!-- ======================================================================= -->
417 <!--                         FUNCTION TEMPLATE                               -->
418 <!--                                                                                                                                             -->
419 <!--  Draw Stacks on the Block Diagram                                                                           -->
420 <!-- ======================================================================= -->
421 <xsl:template name="Draw_BlkDiagram_BusLaneSpaces">
422         
423         <xsl:param name="sbs_Y"     select="$BLKD_INNER_Y"/>
424         
425         <xsl:variable name="lastStack_" select="(/EDKSYSTEM/BLKDSHAPES/@STACK_HORIZ_WIDTH) - 1"/>
426         
427         <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/BCLANESPACES/BCLANESPACE[@EAST]">
428                 <xsl:sort select="@EAST" data-type="number"/>
429                         
430                 <xsl:call-template name="Draw_BlkDiagram_BusLaneSpace">
431                         <xsl:with-param name="sbs_Y"        select="$sbs_Y"/>
432                         <xsl:with-param name="stackToEast"  select="@EAST"/>
433                 </xsl:call-template>
434         </xsl:for-each> 
435         
436         <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/BCLANESPACES/BCLANESPACE[(@WEST = $lastStack_)]">
437                 <xsl:call-template name="Draw_BlkDiagram_BusLaneSpace">
438                         <xsl:with-param name="sbs_Y"        select="$sbs_Y"/>
439                         <xsl:with-param name="stackToWest"  select="$lastStack_"/>
440                 </xsl:call-template>
441         </xsl:for-each> 
442                         
443 </xsl:template>
444         
445 <xsl:template name="Draw_BlkDiagram_BusLaneSpace">
446         
447         <xsl:param name="sbs_Y"       select="0"/>
448         <xsl:param name="stackToEast" select="'NONE'"/>
449         <xsl:param name="stackToWest" select="'NONE'"/>
450         
451         <xsl:variable name="spaceAbvSbs_H_">
452                 <xsl:call-template name="_calc_Space_AbvSbs_Height">
453                         <xsl:with-param name="stackToEast"  select="$stackToEast"/>
454                         <xsl:with-param name="stackToWest"  select="$stackToWest"/>
455                 </xsl:call-template>
456         </xsl:variable> 
457         
458         <xsl:variable name="spaceBlwSbs_H_">
459                 <xsl:call-template name="_calc_Space_BlwSbs_Height">
460                         <xsl:with-param name="stackToEast"  select="$stackToEast"/>
461                         <xsl:with-param name="stackToWest"  select="$stackToWest"/>
462                 </xsl:call-template>
463         </xsl:variable> 
464         
465 <!--    
466         <xsl:message>Abv Sbs  is <xsl:value-of select="$spaceAbvSbs_H_"/></xsl:message>
467         <xsl:message>Abv Blw  is <xsl:value-of select="$spaceBlwSbs_H_"/></xsl:message>
468         <xsl:variable name="inner_X_"   select="($BLKD_PRTCHAN_W  + $BLKD_IORCHAN_W + $BLKD_INNER_GAP)"/>
469         <xsl:variable name="inner_Y_"   select="($BLKD_PRTCHAN_H  + $BLKD_IORCHAN_H + $BLKD_INNER_GAP)"/>
470         <xsl:variable name="numSbs_"    select="count(BLKDSHAPES/SBSSHAPES/MODULE)"/>
471         <xsl:variable name="sbs_h_"     select="($numSbs_  * $SBS_LANE_H)"/>
472         <xsl:variable name="sbs_y_"     select="($inner_Y_ + $max_stack_AbvSbs_H_ + $PROC2SBS_GAP)"/>
473         
474         <xsl:variable name="numSbs_"    select="count(/BLKDSHAPES/SBSSHAPES/MODULE)"/>
475         <xsl:variable name="sbs_h_"     select="($numSbs_  * $SBS_LANE_H)"/>
476         <xsl:variable name="sbs_y_"     select="($BLKD_INNER_Y + $max_stack_AbvSbs_H_ + $PROC2SBS_GAP)"/>
477 -->     
478                         
479         <xsl:variable name="space_line_x_">
480                 <xsl:call-template name="_calc_Space_X">
481                         <xsl:with-param name="stackToEast"  select="$stackToEast"/>
482                         <xsl:with-param name="stackToWest"  select="$stackToWest"/>
483                 </xsl:call-template>
484         </xsl:variable>
485         
486         <xsl:variable name="numBridges_"   select="count(/EDKSYSTEM/BLKDSHAPES/BRIDGESHAPES/MODULE)"/>
487         <xsl:variable name="bridges_w_"    select="(($numBridges_ * ($periMOD_W + ($BUS_LANE_W * 2))) + $BRIDGE_GAP)"/>
488                 
489         <xsl:variable name="space_y_" select="($sbs_Y - $spaceAbvSbs_H_)"/>
490         <xsl:variable name="space_x_" select="($BLKD_INNER_X + $space_line_x_ + $bridges_w_)"/>
491                 
492         <xsl:variable name="space_Name_">
493                 <xsl:call-template name="_gen_Space_Name"> 
494                         <xsl:with-param name="stackToEast" select="$stackToEast"/>
495                         <xsl:with-param name="stackToWest" select="$stackToWest"/>
496                 </xsl:call-template>            
497         </xsl:variable> 
498                 
499         <use   x="{$space_x_}"    y="{$space_y_}"  xlink:href="#{$space_Name_}"/> 
500         
501 </xsl:template>
502         
503         
504         
505 <!-- =========================================================================== -->
506 <!--                          FUNCTION TEMPLATE                                  -->
507 <!--                                                                                                                                                     -->
508 <!--  Draw Bridges on the Block Diagram                                                                                  -->
509 <!-- =========================================================================== -->
510 <xsl:template name="Draw_BlkDiagram_Bridges">
511         
512         <xsl:param name="sbs_Y"     select="0"/>
513         <xsl:param name="inner_X"   select="0"/>
514         
515         <!-- First save all the bridge indexs in a variable      -->
516         <xsl:variable name="bridgeShapes_">
517                 
518                 <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/BRIDGESHAPES/MODULE/BUSCONNS[(@ORIENTED = 'WEST')]/BUSCONN">        
519                         <BRIDGE BUSINDEX="{@BUSINDEX}" INSTANCE="{../../@INSTANCE}" POSITION="{(position() -1)}"/>
520                         <BRIDGECONN BUSINDEX="{@BUSINDEX}" INSTANCE="{../../@INSTANCE}" ORIENTED="{../@ORIENTED}" POSITION="{(position()  - 1)}" BUSSTD="{@BUSSTD}" BIFRANK="{@BIFRANK}"/>
521                         <!-- So both bus conns have same position.... -->
522                         <xsl:if test="../../BUSCONNS[(@ORIENTED = 'EAST')]">
523                                 <BRIDGECONN BUSINDEX="{../../BUSCONNS[(@ORIENTED ='EAST')]/BUSCONN/@BUSINDEX}" INSTANCE="{../../@INSTANCE}" ORIENTED="EAST" POSITION="{(position()  - 1)}"   BUSSTD="{../../BUSCONNS[(@ORIENTED = 'EAST')]/BUSCONN/@BUSSTD}" BIFRANK="{../../BUSCONNS[(@ORIENTED = 'EAST')]/BUSCONN/@BIFRANK}"/>
524                         </xsl:if>
525                 </xsl:for-each>
526                 
527         </xsl:variable>
528         
529 <!--                            
530                         <xsl:message>Found an east connection on <xsl:value-of select="../../@INSTANCE"/></xsl:message>
531 -->                             
532         
533
534         <!-- Now layout the bridge shapes between the shared busses      -->
535         <xsl:for-each select="exsl:node-set($bridgeShapes_)/BRIDGE">
536                 <xsl:sort select="@POSITION" data-type="number"/>
537                 
538                 <xsl:variable name="brdgPosition_"  select="@POSITION"/>
539                 <xsl:variable name="brdgInstance_"  select="@INSTANCE"/>
540                 
541                 <xsl:variable name="min_bus_idx_" select="math:min(exsl:node-set($bridgeShapes_)/BRIDGECONN[(@POSITION = $brdgPosition_)]/@BUSINDEX)"/>
542 <!--            
543                 <xsl:variable name="max_bus_idx_" select="math:max(exsl:node-set($bridgeShapes_)/BRIDGECONN[(@POSITION = $brdgPosition_)]/@BUSINDEX)"/>
544                 
545         <xsl:message>Maximum index <xsl:value-of select="$max_bus_idx_"/></xsl:message>
546         <xsl:message>Minimum index <xsl:value-of select="$min_bus_idx_"/></xsl:message>
547 -->
548                 
549                 
550                 <xsl:variable name="brdg_X_"  select="($inner_X + $BRIDGE_GAP + $BUS_LANE_W + (@POSITION * ($periMOD_W + ($BUS_LANE_W * 2))))"/>        
551                 <xsl:variable name="brdg_Y_"  select="($sbs_Y   + $PROC2SBS_GAP + ($min_bus_idx_ * $SBS_LANE_H) + ceiling($SBS_LANE_H div 2) - ceiling($periMOD_H div 2))"/>
552                 
553                 <use  x="{$brdg_X_}"  y="{$brdg_Y_}"  xlink:href="#symbol_{$brdgInstance_}"/>   
554         </xsl:for-each> 
555         
556                 
557         
558 <!--    
559         <xsl:message>Found <xsl:value-of select="count(exsl:node-set($bridgeShapes_)/BRIDGECONN)"/> busconns </xsl:message>
560                 <xsl:message>Drawing connection for bridge <xsl:value-of select="$brdgInstance_"/> at <xsl:value-of select="@POSITION"/> </xsl:message>
561 -->     
562         
563         <xsl:for-each select="exsl:node-set($bridgeShapes_)/BRIDGECONN">
564                 <xsl:sort select="@POSITION" data-type="number"/>
565                 
566                 <xsl:variable name="brdgInstance_"  select="@INSTANCE"/>
567                 <xsl:variable name="brdgPosition_"  select="@POSITION"/>
568                 
569                 <xsl:variable name="bus_col_">
570                         <xsl:call-template name="BusType2Color">
571                                 <xsl:with-param name="busType" select="@BUSSTD"/>
572                         </xsl:call-template>    
573                 </xsl:variable>
574                 
575                 <xsl:variable name="min_bus_idx_" select="math:min(exsl:node-set($bridgeShapes_)/BRIDGECONN[(@POSITION = $brdgPosition_)]/@BUSINDEX)"/>
576                 <xsl:variable name="brdg_Y1_"     select="($sbs_Y   + $PROC2SBS_GAP + ($min_bus_idx_ * $SBS_LANE_H) + ceiling($SBS_LANE_H div 2) - ceiling($periMOD_H div 2))"/>
577                 <xsl:variable name="brdg_X_"      select="($inner_X + $BRIDGE_GAP + $BUS_LANE_W + (@POSITION * ($periMOD_W + ($BUS_LANE_W * 2))))"/>    
578 <!--            
579                 <xsl:variable name="bc_Y_"        select="($sbs_Y + $PROC2SBS_GAP  + (@BUSINDEX * $SBS_LANE_H)) - ceiling($BIFC_H div 4)"/>
580 -->     
581                 <xsl:variable name="bc_Y_"        select="$brdg_Y1_ + $MOD_LANE_H + $MOD_LABEL_H + $MOD_BIF_GAP_V + ceiling($BIF_H div 2) - ceiling($BIFC_H div 2)"/>   
582                 <xsl:variable name="bc_X_">
583                         <xsl:choose>
584                                 <xsl:when test="@ORIENTED='WEST'">
585                                         <xsl:value-of select="($brdg_X_ - $BIFC_W)"/>
586                                 </xsl:when>
587                                 <xsl:when test="@ORIENTED='EAST'">
588                                         <xsl:value-of select="($brdg_X_ + $periMOD_W)"/>
589                                 </xsl:when>
590                         </xsl:choose>
591                 </xsl:variable> 
592                 
593                 <!-- Layout the bus conn -->
594                 <use   x="{$bc_X_}"   y="{$bc_Y_}"  xlink:href="#{@BUSSTD}_busconn_{@BIFRANK}"/>
595                 
596                 <!-- Figure out the positions of the lines -->
597                 
598 <!--            
599                 <xsl:variable name="vert_line_x_"  select="$bc_X_    + ceiling($BIFC_W div 2)"/>
600                 <xsl:message>vert line x <xsl:value-of select="$vert_line_x_"/></xsl:message>
601                 <xsl:message>bus index <xsl:value-of select="@BUSINDEX"/></xsl:message>
602 -->             
603                 
604                 <xsl:variable name="vert_line_x_">
605                         <xsl:choose>
606                                 <xsl:when test="@ORIENTED='WEST'">
607                                         <xsl:value-of select="($bc_X_ - ($BUS_LANE_W - $BIFC_W))"/>
608                                 </xsl:when>
609                                 <xsl:when test="@ORIENTED='EAST'">
610                                         <xsl:value-of select="($bc_X_ + ($BUS_LANE_W - $P2P_BUS_W))"/>
611                                 </xsl:when>
612                         </xsl:choose>
613                 </xsl:variable> 
614                 
615                 <!-- At least one of the points is going to be the bus -->
616                 <xsl:variable name="vert_line_y1_" select="($sbs_Y  + $PROC2SBS_GAP + (@BUSINDEX * $SBS_LANE_H))"/>
617                 <xsl:variable name="vert_line_y2_" select="$bc_Y_ + ceiling($BIFC_H div 2)"/>
618                 
619                 <xsl:variable name="v_bus_ul_y_">
620                         <xsl:choose>
621                                 <xsl:when test="$vert_line_y1_ &gt; $vert_line_y2_">
622                                         <xsl:value-of select="$vert_line_y2_"/>
623                                 </xsl:when>
624                                 <xsl:when test="$vert_line_y2_ &gt; $vert_line_y1_">
625                                         <xsl:value-of select="$vert_line_y1_"/>
626                                 </xsl:when>
627                         </xsl:choose>
628                 </xsl:variable> 
629 <!--            
630                 <xsl:variable name="v_bus_ul_x_" select="$vert_line_x_"/>
631 -->     
632                 <xsl:variable name="v_bus_ul_x_">
633                         <xsl:choose>
634                                 <xsl:when test="@ORIENTED='WEST'">
635                                         <xsl:value-of select="($vert_line_x_ + $MOD_BIF_GAP_H)"/>
636                                 </xsl:when>
637                                 <xsl:when test="@ORIENTED='EAST'">
638                                         <xsl:value-of select="($vert_line_x_ - $MOD_BIF_GAP_H)"/>
639                                 </xsl:when>
640                         </xsl:choose>
641                 </xsl:variable> 
642                 
643                 
644                 <xsl:variable name="v_bus_width_" select="$P2P_BUS_W"/>
645                 <xsl:variable name="v_bus_height_">
646                         <xsl:choose>
647                                 <xsl:when test="$vert_line_y1_ &gt; $vert_line_y2_">
648                                         <xsl:value-of select="($vert_line_y1_ - $vert_line_y2_)"/>
649                                 </xsl:when>
650                                 <xsl:when test="$vert_line_y2_ &gt; $vert_line_y1_">
651                                         <xsl:value-of select="($vert_line_y2_ - $vert_line_y1_)"/>
652                                 </xsl:when>
653                         </xsl:choose>
654                 </xsl:variable> 
655                 
656                 <xsl:variable name="h_bus_ul_x_">
657                         <xsl:choose>
658                                 <xsl:when test="@ORIENTED='WEST'">
659                                         <xsl:value-of select="($bc_X_ - ($BUS_LANE_W - $BIFC_W) + $MOD_BIF_GAP_H)"/>
660                                 </xsl:when>
661                                 <xsl:when test="@ORIENTED='EAST'">
662                                         <xsl:value-of select="($bc_X_ + $BIFC_W - ceiling(($BIFC_W - $BIFC_Wi) div 2))"/>
663                                 </xsl:when>
664                         </xsl:choose>
665                 </xsl:variable> 
666                 
667                 <xsl:variable name="h_bus_ul_y_" select="$bc_Y_ + ceiling($BIFC_H div 2) - ceiling($P2P_BUS_W div 2)"/>
668                 <xsl:variable name="h_bus_height_" select="$P2P_BUS_W"/>
669                 
670                 <xsl:variable name="h_bus_width_">
671                         <xsl:choose>
672                                 <xsl:when test="@ORIENTED='WEST'">
673                                         <xsl:value-of select="(($bc_X_ + ceiling(($BIFC_W - $BIFC_Wi) div 2)) - $h_bus_ul_x_ + 1)"/>
674                                 </xsl:when>
675                                 <xsl:when test="@ORIENTED='EAST'">
676                                         <xsl:value-of select="(($v_bus_ul_x_ + $P2P_BUS_W) - $h_bus_ul_x_)"/>
677                                 </xsl:when>
678                         </xsl:choose>
679                 </xsl:variable> 
680                 
681                 
682 <!--            
683                 <xsl:message>vert line y1 <xsl:value-of select="$vert_line_y1_"/></xsl:message>
684 -->             
685                 
686                 <rect x="{$v_bus_ul_x_}" 
687                           y="{$v_bus_ul_y_ + 2}"  
688                           width= "{$v_bus_width_}" 
689                           height="{$v_bus_height_}" 
690                           style="stroke:none; fill:{$bus_col_}"/>
691                 
692                 <rect x="{$h_bus_ul_x_}" 
693                           y="{$h_bus_ul_y_}"  
694                           width= "{$h_bus_width_}" 
695                           height="{$h_bus_height_}" 
696                           style="stroke:none; fill:{$bus_col_}"/>
697                 
698         </xsl:for-each> 
699         
700 </xsl:template>
701         
702         
703 <!-- =========================================================================== -->
704 <!--                          FUNCTION TEMPLATE                                  -->
705 <!--                                                                                                                                                     -->
706 <!--  Draw Processors on the Block Diagram                                                                               -->
707 <!-- =========================================================================== -->
708 <xsl:template name="Draw_BlkDiagram_Processors">
709         
710         <xsl:param name="Inner_X"                select="0"/>
711         <xsl:param name="SharedBus_Y"            select="0"/>
712         <xsl:param name="Max_Proc_H"             select="0"/>
713         <xsl:param name="Max_Proc_PerisAbvSbs_H" select="0"/>
714         <xsl:param name="Max_Proc_PerisBlwSbs_H" select="0"/>
715         
716         
717         <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE">                 
718                 
719                 <xsl:variable name="procInst_"    select="@INSTANCE"/>
720                 <xsl:variable name="proc_bifs_h_" select="@BIFS_H"/>
721 <!--            
722                 <xsl:message>Shared Bus Y <xsl:value-of select="$SharedBus_Y"/></xsl:message>
723                 <xsl:variable name="numMemUs_"    select="count(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[((@PROCESSOR = $procInst_) and (@MODCLASS = 'MEMORY_UNIT'))])"/>   
724                 <xsl:variable name="numPerisBlw_" select="count(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[((@PROCESSOR = $procInst_) and (@MODCLASS = 'PERIPHERAL') and    (@IS_BLWSBS))])"/>        
725                 <xsl:variable name="numPerisAbv_" select="count(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[((@PROCESSOR = $procInst_) and (@MODCLASS = 'PERIPHERAL') and not(@IS_BLWSBS))])"/>        
726                 <xsl:variable name="gapsAbv_h_"   select="(($numMemUs_ + $numPerisAbv_) * $BIF_H)"/>
727 -->             
728                 
729                 <xsl:variable name="proc_h_">
730                         <xsl:call-template name="_calc_Proc_Height">
731                                 <xsl:with-param name="procInst"  select="$procInst_"/>
732                         </xsl:call-template>    
733                 </xsl:variable>
734                 
735 <!--            
736                 <xsl:variable name="max_Proc_h_">
737                         <xsl:call-template name="_calc_Max_Proc_Height"/>
738                 </xsl:variable>
739 -->     
740                 
741                 <xsl:variable name="perisAbv_h_">
742                         <xsl:call-template name="_calc_Proc_PerisAbvSbs_Height">
743                                 <xsl:with-param name="procInst"  select="$procInst_"/>
744                         </xsl:call-template>    
745                 </xsl:variable>
746                 
747                 <xsl:variable name="perisBlw_h_">
748                         <xsl:call-template name="_calc_Proc_PerisBlwSbs_Height">
749                                 <xsl:with-param name="procInst"  select="$procInst_"/>
750                         </xsl:call-template>    
751                 </xsl:variable>
752                 
753                 <xsl:variable name="memUs_h_">
754                         <xsl:call-template name="_calc_Proc_MemoryUnits_Height">
755                                 <xsl:with-param name="procInst" select="$procInst_"/>
756                         </xsl:call-template>    
757                 </xsl:variable>
758                 
759                 <xsl:variable name="proc_y_"          select="($SharedBus_Y  - ($PROC2SBS_GAP   + $proc_h_ + $perisAbv_h_ + $memUs_h_))"/>
760                 <xsl:variable name="gaps_right_"      select="(@GAPS_X      * $MOD_SHAPES_G)"/>
761                 <xsl:variable name="mods_right_"      select="(@MODS_X      * $periMOD_W)"/>
762                 <xsl:variable name="lanes_right_"     select="(@BUS_LANES_X * $BUS_LANE_W)"/>
763                 
764                 <xsl:variable name="bkt_lanes_right_" select="(@BKT_LANES_X * $MOD_BKTLANE_W)"/>
765                 <xsl:variable name="bkt_gaps_right_"  select="(@BKT_GAPS_X  * $MOD_BUCKET_G)"/>
766                 
767                 <xsl:variable name="proc_x_"          select="($Inner_X + $gaps_right_ +  $mods_right_ + $bkt_lanes_right_ + $bkt_gaps_right_ + $lanes_right_)"/>
768                 
769                 <xsl:variable name="procGroupName_">
770                         <xsl:call-template name="_gen_Proc_GroupName"> 
771                                 <xsl:with-param name="procInst"  select="$procInst_"/>
772                         </xsl:call-template>            
773                 </xsl:variable>
774         
775                 <use   x="{$proc_x_}"  
776                        y="{$proc_y_}" 
777                        xlink:href="#{$procGroupName_}"/> 
778                 
779                 <xsl:variable name="numProcMods_" select="($perisAbv_h_ + $perisBlw_h_ + $memUs_h_)"/>
780                 
781                 <xsl:if test="$numProcMods_ = 0">
782                         
783                         <xsl:variable name="pbktW_"       select="@PSTACK_BKT_W"/>
784                         <xsl:variable name="pmodW_"       select="@PSTACK_MOD_W"/>
785                         <xsl:variable name="numSbsBkts_"  select="count(/EDKSYSTEM/BLKDSHAPES/SBSBUCKETS/SBSBUCKET[(@PROCESSOR = $procInst_)])"/>               
786                         
787                         <xsl:variable name="bktModsW_">
788                                 <xsl:if test="($numSbsBkts_ &gt; 0)">
789                                         <xsl:value-of select="(($MOD_BKTLANE_W * 2) + ($periMOD_W * $pbktW_) + ($MOD_BUCKET_G * ($pbktW_ - 1)))"/>      
790                                 </xsl:if>
791                                 <xsl:if test="not($numSbsBkts_ &gt; 0)">0</xsl:if>
792                         </xsl:variable> 
793                 
794                         <xsl:variable name="pstkModsW_" select="$periMOD_W"/>   
795                         
796                         <xsl:variable name="pstackW_">
797                                 <xsl:if test="$bktModsW_ &gt; $pstkModsW_">
798                                         <xsl:value-of select="$bktModsW_"/>
799                                 </xsl:if>
800                                 <xsl:if test="not($bktModsW_ &gt; $pstkModsW_)">
801                                         <xsl:value-of select="$pstkModsW_"/>
802                                 </xsl:if>
803                         </xsl:variable>
804                         
805                         <xsl:variable name="busLaneWestW_">
806                                 <xsl:if test="(BUSCONNS[(@ORIENTED = 'WEST' and @BUSLANE_W)])">
807                                         <xsl:value-of select="((BUSCONNS[(@ORIENTED ='WEST')]/@BUSLANE_W) * $BUS_LANE_W)"/>
808                                 </xsl:if>
809                                 <xsl:if test="not(BUSCONNS[(@ORIENTED = 'WEST') and @BUSLANE_W])">0</xsl:if>
810                         </xsl:variable>
811                         
812                 
813                         <xsl:if test="not(@IS_LIKEPROC = 'TRUE')">        
814                                 <text class="procclass"
815                                                 x="{($proc_x_  + $busLaneWestW_ + ceiling($pstackW_ div 2))}" 
816                                                 y="{$proc_y_ - 4}">PROCESSOR</text>                     
817                         </xsl:if>
818                 
819                         <xsl:if test="@IS_LIKEPROC = 'TRUE'">     
820                                 <text class="procclass"
821                                                 x="{($proc_x_  + $busLaneWestW_ + ceiling($pstackW_ div 2))}" 
822                                                 y="{$proc_y_ - 4}">USER</text>                  
823                         </xsl:if>
824                 </xsl:if>               
825                 
826                         
827                 <!-- Draw the multiproc stacks for this processor, if any-->    
828                 <xsl:if test="@PSTACK_BLKD_X">
829                         <xsl:variable name="stackBlkd_X_" select="(@PSTACK_BLKD_X + 1)"/>       
830                         
831                         <xsl:variable name="numPerisInStack_" select="count(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[((@PSTACK_BLKD_X = $stackBlkd_X_) and (@MODCLASS = 'PERIPHERAL'))])"/> 
832                         <xsl:variable name="numMemusInStack_" select="count(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[((@PSTACK_BLKD_X = $stackBlkd_X_) and (@MODCLASS = 'MEMORY_UNIT'))])"/>        
833                         
834                         <xsl:if test="(($numPerisInStack_ + $numMemusInStack_) &gt; 0)">
835 <!--                            
836                                 <xsl:message>Peris are <xsl:value-of select="$numPerisInStack_"/></xsl:message>
837                                 <xsl:message>Memus are <xsl:value-of select="$numMemusInStack_"/></xsl:message>
838 -->                             
839                                 
840 <!--                            
841                                 <xsl:variable name="mp_peris_h_"         select="($numPerisInStack_  * ($periMOD_H + $BIF_H))"/>
842                                 <xsl:variable name="mp_memus_h_"         select="($numMemusInStack_  * (($periMOD_H * 2) + $BIF_H))"/>
843                                 <xsl:variable name="mp_stack_h_"         select="($mp_peris_h_ + $mp_memus_h_)"/>
844 -->                             
845                                 <xsl:variable name="mp_stack_h_">
846                                         <xsl:call-template name="_calc_MultiProc_Stack_Height">
847                                                 <xsl:with-param name="mpstack_blkd_x" select="(@PSTACK_BLKD_X + 1)"/>
848                                         </xsl:call-template>
849                                 </xsl:variable>
850                                 
851                                 <xsl:variable name="mp_StackName_">
852                                         <xsl:call-template name="_gen_CStack_StackName"> 
853                                                 <xsl:with-param name="cstkIndex" select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@PSTACK_BLKD_X = $stackBlkd_X_)]/@CSTACK_INDEX"/>
854                                         </xsl:call-template>            
855                                 </xsl:variable>
856                                 
857 <!--                            
858                                 <xsl:message>Multi Stack Name is <xsl:value-of select="$mp_StackName_"/></xsl:message>
859 -->                             
860         
861                                 
862                                 <xsl:variable name="mp_gaps_right_"      select="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@PSTACK_BLKD_X = $stackBlkd_X_)]/@GAPS_X           * $MOD_SHAPES_G)"/>
863                                 <xsl:variable name="mp_mods_right_"      select="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@PSTACK_BLKD_X = $stackBlkd_X_)]/@MODS_X      * $periMOD_W)"/>
864                                 <xsl:variable name="mp_lanes_right_"     select="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@PSTACK_BLKD_X = $stackBlkd_X_)]/@BUS_LANES_X * $BUS_LANE_W)"/>
865                                 <xsl:variable name="mp_bkt_lanes_right_" select="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@PSTACK_BLKD_X = $stackBlkd_X_)]/@BKT_LANES_X * $MOD_BKTLANE_W)"/>
866                                 <xsl:variable name="mp_bkt_gaps_right_"  select="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@PSTACK_BLKD_X = $stackBlkd_X_)]/@BKT_GAPS_X  * $MOD_BUCKET_G)"/>
867                                 
868                                 <xsl:variable name="mpstack_x_"  select="($Inner_X + $mp_gaps_right_ +  $mp_mods_right_ + $mp_bkt_lanes_right_ + $mp_bkt_gaps_right_ + $mp_lanes_right_)"/>
869                                 <xsl:variable name="mpstack_y_"  select="($SharedBus_Y - ($PROC2SBS_GAP + $Max_Proc_H + $Max_Proc_PerisAbvSbs_H + $mp_stack_h_))"/>
870                                 
871                                 <use   x="{$mpstack_x_}"  y="{$mpstack_y_}" xlink:href="#{$mp_StackName_}"/> 
872                                 
873                                 
874                         </xsl:if>
875                 </xsl:if>       
876                 
877         </xsl:for-each>         
878
879 </xsl:template>
880         
881 <!-- =========================================================================== -->
882 <!--                          FUNCTION TEMPLATE                                  -->
883 <!--                                                                                                                                                     -->
884 <!-- Draw the Complex stacks, (collections of more than one module that              -->
885 <!-- are not memory and not connected to a processor)                                                    -->    
886 <!-- =========================================================================== -->
887 <xsl:template name="Draw_BlkDiagram_ComplexStacks">
888         
889         <xsl:param name="Inner_X"                select="0"/>
890         <xsl:param name="SharedBus_Y"            select="0"/>
891         
892         <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@IS_PROMOTED and not(@IS_PENALIZED) and @CSTACK_INDEX and @BUS_LANES_X and @BKT_LANES_X  and @GAPS_X and @MODS_X and @BKT_GAPS_X)]">
893                 
894         
895                 <xsl:variable name="gaps_right_"      select="(@GAPS_X      * $MOD_SHAPES_G)"/>
896                 <xsl:variable name="mods_right_"      select="(@MODS_X      * $periMOD_W)"/>
897                 <xsl:variable name="lanes_right_"     select="(@BUS_LANES_X * $BUS_LANE_W)"/>
898                 
899                 <xsl:variable name="bkt_lanes_right_" select="(@BKT_LANES_X * $MOD_BKTLANE_W)"/>
900                 <xsl:variable name="bkt_gaps_right_"  select="(@BKT_GAPS_X  * $MOD_BUCKET_G)"/>
901                 
902                 <xsl:variable name="cstack_x_"          select="($Inner_X + $gaps_right_ +  $mods_right_ + $bkt_lanes_right_ + $bkt_gaps_right_ + $lanes_right_)"/>
903                 <xsl:variable name="cstack_y_"          select="($SharedBus_Y)"/>
904         
905                 <use   x="{$cstack_x_}"  
906                        y="{$cstack_y_}" 
907                        xlink:href="#cgroup_{@CSTACK_INDEX}"/> 
908                        
909         </xsl:for-each>         
910                 
911 </xsl:template>
912         
913 <!-- =========================================================================== -->
914 <!--                          FUNCTION TEMPLATE                                  -->
915 <!--                                                                                                                                                     -->
916 <!-- Draw the Complex Modules, (Modules that are not memory and not              -->
917 <!--    connected to a processor)                                                -->    
918 <!-- =========================================================================== -->
919 <xsl:template name="Draw_BlkDiagram_ComplexModules">
920         
921         <xsl:param name="Inner_X"                select="0"/>
922         <xsl:param name="SharedBus_Y"            select="0"/>
923         <xsl:param name="SharedBus_H"            select="0"/>
924         
925         <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@IS_PROMOTED and not(@IS_PENALIZED) and not(@CSTACK_INDEX) and @GAPS_X and @MODS_X and @BUS_LANES_X and @BKT_LANES_X and @BKT_GAPS_X)]">
926                 
927                 <xsl:variable name="gaps_right_"      select="(@GAPS_X      * $MOD_SHAPES_G)"/>
928                 <xsl:variable name="mods_right_"      select="(@MODS_X      * $periMOD_W)"/>
929                 <xsl:variable name="lanes_right_"     select="(@BUS_LANES_X * $BUS_LANE_W)"/>
930                 <xsl:variable name="bkt_lanes_right_" select="(@BKT_LANES_X * $MOD_BKTLANE_W)"/>
931                 <xsl:variable name="bkt_gaps_right_"  select="(@BKT_GAPS_X  * $MOD_BUCKET_G)"/>
932         
933                 <xsl:variable name="cmplxBusLaneWest_w_">
934                         <xsl:if test="BUSCONNS[(@ORIENTED = 'WEST') and @BUSLANE_W]">
935                                  <xsl:value-of select="((BUSCONNS[@ORIENTED = 'WEST']/@BUSLANE_W) * $BUS_LANE_W)"/>
936                         </xsl:if>
937                         <xsl:if test="not(BUSCONNS[@ORIENTED = 'WEST'])">0</xsl:if>
938                 </xsl:variable>
939                 
940                 <xsl:variable name="cmplxBusLaneEast_w_">
941                         <xsl:if test="BUSCONNS[(@ORIENTED = 'EAST')and @BUSLANE_W]">
942                                  <xsl:value-of select="((BUSCONNS[@ORIENTED = 'EAST']/@BUSLANE_W) * $BUS_LANE_W)"/>
943                         </xsl:if>
944                         <xsl:if test="not(BUSCONNS[@ORIENTED = 'EAST'])">0</xsl:if>
945                 </xsl:variable>
946                 
947                 <xsl:variable name="cmplx_x_"  select="($Inner_X + $gaps_right_ + $mods_right_ + $lanes_right_ + $bkt_lanes_right_ + $bkt_gaps_right_)"/>
948                 
949                 <xsl:variable name="cmplx_y_">
950                         <xsl:choose>
951                                 <xsl:when test="((@MODCLASS = 'MASTER_SLAVE') or (@MODCLASS = 'MONITOR'))">
952                                         <xsl:value-of select="($SharedBus_Y - ($PROC2SBS_GAP + $periMOD_H))"/>
953                                 </xsl:when>
954                                 <xsl:otherwise>
955                                         <xsl:value-of select="($SharedBus_Y + $SharedBus_H)"/>
956                                 </xsl:otherwise>                
957                         </xsl:choose>
958                 </xsl:variable>  
959                 
960             <xsl:if test="(@MODCLASS)">
961                         <text class="ipclass"
962                                 x="{$cmplx_x_ + $cmplxBusLaneWest_w_}" 
963                                 y="{$cmplx_y_ - 4}">
964                                         <xsl:value-of select="@MODCLASS"/>
965                         </text> 
966             </xsl:if>
967                 
968                 <xsl:choose>
969                         <xsl:when test="((@MODCLASS = 'MASTER_SLAVE') or (@MODCLASS = 'MONITOR'))">
970                                 <use   x="{$cmplx_x_ + $cmplxBusLaneWest_w_}"  y="{$cmplx_y_}" xlink:href="#symbol_{MODULE/@INSTANCE}"/> 
971                         </xsl:when>     
972                         <xsl:otherwise> 
973                                 <use   x="{$cmplx_x_ + $cmplxBusLaneWest_w_}"  y="{$cmplx_y_}" xlink:href="#symbol_peripheral_{position()}"/> 
974                         </xsl:otherwise>
975                 </xsl:choose>           
976                 
977                 <xsl:variable name="cmplx_Dy_"      select="$MOD_LANE_H + $MOD_LABEL_H + $MOD_BIF_GAP_V + ceiling($BIF_H div 2)"/>      
978                 
979                 <xsl:for-each select="BUSCONNS[@ORIENTED = 'WEST']/BUSCONN[@IS_SBSBIF and @BUSLANE_X and @BUSINDEX]">
980                         
981                         <xsl:variable name="westSbsCX_"    select="($cmplx_x_ + $cmplxBusLaneWest_w_) - ((@BUSLANE_X + 1) * $BUS_LANE_W)"/>
982                         <xsl:variable name="westSbsBusY_"  select="($SharedBus_Y    + (@BUSINDEX * $SBS_LANE_H))"/>
983                         <xsl:variable name="westSbsBifY_"  select="($cmplx_y_ + $cmplx_Dy_)"/>
984                         
985                         <xsl:variable name="cmplxBif_Dx_">
986                                 <xsl:choose>
987                                         <xsl:when test="(@IS_CENTERED = 'TRUE')">
988                                                 <xsl:value-of select="(ceiling($periMOD_W div 2) - ceiling($BIF_W div 2))"/>
989                                         </xsl:when>     
990                                         <xsl:otherwise> 
991                                                 <xsl:value-of select="$MOD_LANE_W"/>
992                                         </xsl:otherwise>
993                                 </xsl:choose>           
994                         </xsl:variable>
995                         
996                         
997                         <xsl:variable name="westSbsCColor_">
998                                 <xsl:call-template name="BusType2Color">
999                                         <xsl:with-param name="busType" select="@BUSSTD"/>
1000                                 </xsl:call-template>    
1001                         </xsl:variable>
1002                         
1003                         <line x1="{$westSbsCX_   + ceiling($BIFC_W div 2)}" 
1004                                   y1="{$westSbsBifY_}" 
1005                                   x2="{$westSbsCX_   + ceiling($BIFC_W div 2)}" 
1006                                   y2="{$westSbsBusY_}" 
1007                                   style="stroke:{$westSbsCColor_};stroke-width:1"/>
1008                                   
1009                         <line x1="{$westSbsCX_   + ceiling($BIFC_W div 2)}" 
1010                                   y1="{$westSbsBifY_ }" 
1011                                   x2="{$cmplx_x_     + $cmplxBusLaneWest_w_ + $cmplxBif_Dx_}" 
1012                                   y2="{$westSbsBifY_}" 
1013                                   style="stroke:{$westSbsCColor_};stroke-width:1"/>
1014                                   
1015                         <use   x="{$westSbsCX_}"   y="{$westSbsBusY_ - ceiling($BIFC_H div 2) + ($BUS_ARROW_G * 2)}"  xlink:href="#{@BUSSTD}_busconn_{@BIFRANK}"/>0
1016                 </xsl:for-each>
1017                 
1018                 <xsl:for-each select="BUSCONNS[(@ORIENTED = 'EAST')]/BUSCONN[@IS_SBSBIF and @BUSLANE_X and @BUSINDEX]">
1019                         
1020                         <xsl:variable name="eastSbsCX_"    select="($cmplx_x_ + $cmplxBusLaneWest_w_ + $periMOD_W +  ((@BUSLANE_X + 1) * $BUS_LANE_W) - $BIFC_W)"/>
1021                         <xsl:variable name="eastSbsBusY_"  select="($SharedBus_Y    + (@BUSINDEX * $SBS_LANE_H))"/>
1022                         <xsl:variable name="eastSbsBifY_"  select="($cmplx_y_ + $cmplx_Dy_)"/>
1023                         
1024                         <xsl:variable name="eastSbsCColor_">
1025                                 <xsl:call-template name="BusType2Color">
1026                                         <xsl:with-param name="busType" select="@BUSSTD"/>
1027                                 </xsl:call-template>    
1028                         </xsl:variable>
1029                         
1030                         <xsl:variable name="cmplxBif_Dx_">
1031                                 <xsl:choose>
1032                                         <xsl:when test="(@IS_CENTERED = 'TRUE')">
1033                                                 <xsl:value-of select="(ceiling($periMOD_W div 2) - ceiling($BIF_W div 2))"/>
1034                                         </xsl:when>     
1035                                         <xsl:otherwise> 
1036                                                 <xsl:value-of select="$MOD_LANE_W"/>
1037                                         </xsl:otherwise>
1038                                 </xsl:choose>           
1039                         </xsl:variable>
1040                         
1041                         <line x1="{$eastSbsCX_   + ceiling($BIFC_W div 2)}" 
1042                                   y1="{$eastSbsBifY_}" 
1043                                   x2="{$eastSbsCX_   + ceiling($BIFC_W div 2)}" 
1044                                   y2="{$eastSbsBusY_}" 
1045                                   style="stroke:{$eastSbsCColor_};stroke-width:1"/>
1046                                   
1047                         <line x1="{$eastSbsCX_   + ceiling($BIFC_W div 2)}" 
1048                                   y1="{$eastSbsBifY_ }" 
1049                                   x2="{$cmplx_x_     + $cmplxBusLaneWest_w_ + $periMOD_W - $cmplxBif_Dx_}" 
1050                                   y2="{$eastSbsBifY_}" 
1051                                   style="stroke:{$eastSbsCColor_};stroke-width:1"/>
1052                                   
1053                         <use   x="{$eastSbsCX_}"   y="{$eastSbsBusY_ - ceiling($BIFC_H div 2) + ($BUS_ARROW_G * 2)}"  xlink:href="#{@BUSSTD}_busconn_{@BIFRANK}"/>
1054                         
1055                 </xsl:for-each>
1056                 
1057         </xsl:for-each>         
1058         
1059 </xsl:template>
1060         
1061 <!-- =========================================================================== -->
1062 <!--                          FUNCTION TEMPLATE                                  -->
1063 <!--                                                                                                                                                     -->
1064 <!-- Draw the Shared Bus Buckets                                                                                                 -->
1065 <!-- =========================================================================== -->
1066 <xsl:template name="Draw_BlkDiagram_SharedBusBuckets">
1067         
1068         <xsl:param name="Inner_X"                select="0"/>
1069         <xsl:param name="SharedBus_Y"            select="0"/>
1070         <xsl:param name="SharedBus_H"            select="0"/>
1071         
1072         <xsl:for-each select="/EDKSYSTSEM/BLKDSHAPES/SBSBUCKETS/SBSBUCKET[not(@PROCESSOR) and @BUS_LANES_X and @GAPS_X and @MODS_X ]">                  
1073                 
1074                 <xsl:variable name="ownerBus_"   select="@BUSNAME"/>
1075         
1076                 <xsl:variable name="bkt_y_"  select="($SharedBus_Y + $SharedBus_H)"/>
1077                 
1078                 <xsl:variable name="gaps_right_"  select="(@GAPS_X      * $MOD_SHAPES_G)"/>
1079                 <xsl:variable name="mods_right_"  select="(@MODS_X      * $periMOD_W)"/>
1080                 <xsl:variable name="lanes_right_" select="(@BUS_LANES_X * $BUS_LANE_W)"/>
1081         
1082                 <xsl:variable name="bktBusLane_w_"  select="((BUSCONNS/@BUSLANE_W) * $BUS_LANE_W)"/>
1083                 
1084                 <xsl:variable name="bkt_x_"  select="($bktBusLane_w_ + $Inner_X + $gaps_right_ +  $mods_right_ + $lanes_right_)"/>
1085                 
1086                 <text class="ipclass"
1087                         x="{$bkt_x_}" 
1088                         y="{$bkt_y_ - 4}">
1089                                 SLAVES of <xsl:value-of select="ownerBus_"/>
1090                 </text> 
1091                 
1092                 <use   x="{$bkt_x_}"  y="{$bkt_y_}" xlink:href="#sbsbucket_{$ownerBus_}"/> 
1093                 
1094                 <!-- next draw connections to the shared busses from the slave buckets-->                 
1095                 <xsl:for-each select="BUSCONNS/BUSCONN[(@IS_BKTCONN and @BUSSTD and @BUSLANE_X and @BUSINDEX)]">        
1096                         
1097                         <xsl:variable name="bktSbsCColor_">
1098                                 <xsl:call-template name="BusType2Color">
1099                                         <xsl:with-param name="busType" select="@BUSSTD"/>
1100                                 </xsl:call-template>    
1101                         </xsl:variable>
1102                         
1103                         <xsl:variable name="bktSbsCX_" >
1104                                 <xsl:value-of select="($bkt_x_ - ((@BUSLANE_X + 1) * $BUS_LANE_W))"/>
1105                         </xsl:variable>
1106                         
1107                         <xsl:variable name="bktSbsCTop_"  select="($SharedBus_Y + (@BUSINDEX * $SBS_LANE_H) - ceiling($BIFC_H div 2) + ($BUS_ARROW_G * 2))"/>
1108                         <xsl:variable name="bktSbsCBot_"  select="($bkt_y_ + $MOD_BKTLANE_H + ceiling($periMOD_H div 2))"/>
1109                         
1110                         <line x1="{$bktSbsCX_   + ceiling($BIFC_W div 2)}" 
1111                                   y1="{$bktSbsCTop_ + ceiling($BIFC_H div 2)}" 
1112                                   x2="{$bktSbsCX_   + ceiling($BIFC_W div 2)}" 
1113                                   y2="{$bktSbsCBot_ + ceiling($BIFC_H div 2)}" 
1114                                   style="stroke:{$bktSbsCColor_};stroke-width:1"/>
1115                                   
1116                         <line x1="{$bktSbsCX_   + ceiling($BIFC_W div 2)}" 
1117                                   y1="{$bktSbsCBot_ + ceiling($BIFC_H div 2)}" 
1118                                   x2="{$bkt_x_}" 
1119                                   y2="{$bktSbsCBot_ + ceiling($BIFC_H div 2)}" 
1120                                   style="stroke:{$bktSbsCColor_};stroke-width:1"/>
1121                                   
1122                                   
1123                         <use   x="{$bktSbsCX_}"   y="{$bktSbsCTop_}"  xlink:href="#{@BUSSTD}_busconn_SLAVE"/>
1124                         
1125                 </xsl:for-each>           
1126                 
1127         </xsl:for-each>         
1128         
1129 </xsl:template>
1130         
1131         
1132 <!-- =========================================================================== -->
1133 <!--                          FUNCTION TEMPLATE                                  -->
1134 <!--                                                                                                                                                     -->
1135 <!-- Draw the IP Bucket                                                                                                          -->
1136 <!-- =========================================================================== -->
1137 <xsl:template name="Draw_BlkDiagram_IPBucket">
1138         
1139         <xsl:param name="blkd_W"               select="0"/>
1140         <xsl:param name="sbs_Y"                            select="$BLKD_INNER_Y"/>
1141         <xsl:param name="sbs_H"                            select="0"/>
1142     <xsl:param name="max_Stack_BlwSbs_H"   select="0"/>
1143     <xsl:param name="max_Stack_BlwSbs_H"   select="0"/>
1144         
1145 <!--    
1146         <xsl:message>SBS Y <xsl:value-of select="$sbs_Y"/></xsl:message>
1147         <xsl:message>SBS H <xsl:value-of select="$sbs_H"/></xsl:message>
1148         <xsl:message>Max below Sbs  <xsl:value-of select="$max_Stack_BlwSbs_H"/></xsl:message>
1149     <xsl:with-param name="max_Stack_AbvSbs_H"   select="$max_Stack_AbvSbs_H_"/>
1150     <xsl:with-param name="max_Stack_BlwSbs_H"   select="$max_Stack_BlwSbs_H_"/>
1151     <xsl:param name="max_SbsBuckets_H"     select="0"/>
1152 -->     
1153         
1154         <!-- Draw IP Bucket --> 
1155         <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/IPBUCKET">
1156         
1157         
1158                 <xsl:variable name="bucket_w_"  select="(($MOD_BKTLANE_W * 2) + (($periMOD_W * @MODS_W) + ($MOD_BUCKET_G * (@MODS_W - 1))))"/>
1159                 <xsl:variable name="bucket_h_"  select="(($MOD_BKTLANE_H * 2) + (($periMOD_H * @MODS_H) + ($MOD_BUCKET_G * (@MODS_H - 1))))"/>
1160                 
1161                 <xsl:variable name="bucket_x_"  select="(ceiling($blkd_W div 2) - ceiling($bucket_w_ div 2))"/>
1162                 <xsl:variable name="bucket_y_"  select="($sbs_Y + $sbs_H + $max_Stack_BlwSbs_H + $SBS2IP_GAP)"/>
1163                 
1164                 <text class="ipclass"
1165                         x="{$bucket_x_}" 
1166                         y="{$bucket_y_ - 4}">
1167                                 IP
1168                 </text>
1169                 
1170                 <use   x="{$bucket_x_}"   y="{$bucket_y_}"  xlink:href="#ipbucket"/>
1171                 
1172         </xsl:for-each>
1173         
1174 </xsl:template>
1175         
1176 <!--
1177         ====================================================================================
1178                                   FUNCTION TEMPLATE                                 
1179         
1180                  Draw the Floating Modules Bucket                                                                               
1181         ====================================================================================
1182 -->
1183 <xsl:template name="Draw_BlkDiagram_FloatingModsBucket">
1184         <xsl:param name="Blkd_W"                 select="0"/>
1185         <xsl:param name="DrawArea_W"             select="0"/>
1186         <xsl:param name="Inner_X"                select="0"/>
1187         <xsl:param name="SharedBus_Y"            select="0"/>
1188         <xsl:param name="SharedBus_H"            select="0"/>
1189         <xsl:param name="Max_Proc_H"             select="0"/>
1190         <xsl:param name="Max_Proc_PerisAbvSbs_H" select="0"/>
1191         <xsl:param name="Max_Proc_PerisBlwSbs_H" select="0"/>
1192         <xsl:param name="Max_SbsBuckets_H"       select="0"/>
1193         
1194         <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/UNKBUCKET">
1195                 
1196 <!--            
1197                 <xsl:variable name="sbsBktModsH_"    select="../@LIMIT_SBSBKTMODS_H"/>
1198                 <xsl:variable name="sbsNumBktsH_"    select="../@LIMIT_SBSNUMBKTS_H"/>
1199                 <xsl:variable name="modsBlwH_"       select="../@LIMIT_PMODS_BELOW_SBS_H"/>
1200                 
1201                 <xsl:variable name="totalSbsBktsH_">
1202                         <xsl:if test="$sbsBktModsH_ &gt; 0">
1203                                 <xsl:value-of select="((($MOD_BKTLANE_H * 2) *  $sbsNumBktsH_) + ($periMOD_H * $sbsBktModsH_) + (($sbsNumBktsH_ - 1) * $BIF_H) + ($MOD_BUCKET_G * ($sbsBktModsH_ - 1)))"/>
1204                         </xsl:if> 
1205                         <xsl:if test="not($sbsBktModsH_ &gt; 0)">0</xsl:if> 
1206                 </xsl:variable>  
1207 -->             
1208                 
1209                 <xsl:variable name="totalIpBktsH_">
1210                         <xsl:if test="/EDKSYSTEM/BLKDSHAPES/IPBUCKET">
1211                                 <xsl:value-of select="(($MOD_BKTLANE_H * 2) + (($periMOD_H * /EDKSYSTEM/BLKDSHAPES/IPBUCKET/@MODS_H) + ($MOD_BUCKET_G * (/EDKSYSTEM/BLKDSHAPES/IPBUCKET/@MODS_H - 1))) + $IP2UNK_GAP)"/>
1212                         </xsl:if> 
1213                         <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/IPBUCKET)"></xsl:if> 
1214                 </xsl:variable>  
1215                 
1216 <!--            
1217                 <xsl:variable name="totalModsBlwH_"        select="($modsBlwH_  * ($periMOD_H + $BIF_H))"/>
1218 -->             
1219         
1220                 <xsl:variable name="bucket_w_"  select="(($MOD_BKTLANE_W * 2) + (($periMOD_W * @MODS_W) + ($MOD_BUCKET_G * (@MODS_W - 1))))"/>
1221                 <xsl:variable name="bucket_h_"  select="(($MOD_BKTLANE_H * 2) + (($periMOD_H * @MODS_H) + ($MOD_BUCKET_G * (@MODS_H - 1))))"/>
1222                 
1223                 <xsl:variable name="bucket_y_"  select="($SharedBus_Y + $SharedBus_H + $Max_SbsBuckets_H + $Max_Proc_PerisBlwSbs_H + $totalIpBktsH_ + $IP2UNK_GAP)"/>
1224                 <xsl:variable name="bucket_x_"  select="(ceiling($DrawArea_W div 2) - ceiling($bucket_w_ div 2))"/>
1225                 
1226                 <text class="ipclass"
1227                         x="{$bucket_x_}" 
1228                         y="{$bucket_y_ - 4}">
1229                                 UNASSOCIATED
1230                 </text>
1231                 
1232                 <use   x="{$bucket_x_}"   y="{$bucket_y_}"  xlink:href="#unkbucket"/>
1233                 
1234         </xsl:for-each>
1235         
1236 </xsl:template>
1237         
1238 <!--
1239         ====================================================================================
1240                            FUNCTION TEMPLATE      
1241                                                                                                                                                  
1242          Draw  Processor to Processor) BUS Connections between the modules.     
1243         ====================================================================================
1244 -->
1245 <xsl:template name="Draw_BlkDiagram_Proc2ProcConnections">
1246         
1247         <xsl:param name="Inner_X"                select="0"/>
1248         <xsl:param name="SharedBus_Y"            select="0"/>
1249         <xsl:param name="SharedBus_H"            select="0"/>
1250         <xsl:param name="Max_Proc_H"             select="0"/>
1251         <xsl:param name="Max_Proc_PerisAbvSbs_H" select="0"/>
1252         <xsl:param name="Max_Proc_PerisBlwSbs_H" select="0"/>
1253         <xsl:param name="Max_SbsBuckets_H"       select="0"/>
1254         
1255         
1256         <!-- Draw the processor to processor connections with SPLIT connections -->     
1257         <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE/BUSCONNS/BUSCONN[(@IS_PROC2PROC = 'TRUE') and (@IS_SPLITCONN = 'TRUE')]">
1258                         
1259                 <xsl:variable name="oriented_"        select="../@ORIENTED"/>
1260                 <xsl:variable name="procInst_"        select="../../@INSTANCE"/>
1261                 
1262                 <xsl:variable name="pbifsH_"          select="../../@BIFS_H"/>
1263                 <xsl:variable name="pbifsW_"          select="../../@BIFS_W"/>
1264                 <xsl:variable name="pbktW_"           select="../../@PSTACK_BKT_W"/>
1265                 <xsl:variable name="pmodW_"           select="../../@PSTACK_MOD_W"/>
1266                 
1267                 <xsl:variable name="gaps_right_"      select="(../../@GAPS_X      * $MOD_SHAPES_G)"/>
1268                 <xsl:variable name="mods_right_"      select="(../../@MODS_X      * $periMOD_W)"/>
1269                 <xsl:variable name="lanes_right_"     select="(../../@BUS_LANES_X * $BUS_LANE_W)"/>
1270                 <xsl:variable name="bkt_lanes_right_" select="(../../@BKT_LANES_X * $MOD_BKTLANE_W)"/>
1271                 <xsl:variable name="bkt_gaps_right_"  select="(../../@BKT_GAPS_X  * $MOD_BUCKET_G)"/>
1272                 
1273                 <xsl:variable name="numSbsBkts_"      select="count(/EDKSYSTEM/BLKDSHAPES/SBSBUCKETS/SBSBUCKET[(@PROCESSOR = $procInst_)])"/>   
1274                 
1275                 <xsl:variable name="proc_h_"          select="(($MOD_LANE_H * 2) + (($BIF_H + $MOD_BIF_GAP_V) * $pbifsH_) + ($MOD_LABEL_H + $MOD_BIF_GAP_V))"/> 
1276                 
1277                 <xsl:variable name="proc_y_"          select="($SharedBus_Y - ($PROC2SBS_GAP + $proc_h_))"/>
1278                 <xsl:variable name="proc_x_"          select="($Inner_X + $gaps_right_ +  $mods_right_ + $bkt_lanes_right_ + $bkt_gaps_right_ + $lanes_right_)"/>
1279                 
1280                 <xsl:variable name="busLaneWestW_">
1281                         <xsl:if test="(../../BUSCONNS[(@ORIENTED = 'WEST')])">
1282                                 <xsl:value-of select="((../../BUSCONNS[(@ORIENTED ='WEST')]/@BUSLANE_W) * $BUS_LANE_W)"/>
1283                         </xsl:if>
1284                         <xsl:if test="not(../../BUSCONNS[(@ORIENTED = 'WEST')])">0</xsl:if>
1285                 </xsl:variable>
1286                 
1287                         
1288                 <xsl:variable name="busLaneEastW_">
1289                         <xsl:if test="(../../BUSCONNS[(@ORIENTED = 'EAST')])">
1290                                 <xsl:value-of select="((../../BUSCONNS[(@ORIENTED ='EAST')]/@BUSLANE_W) * $BUS_LANE_W)"/>
1291                         </xsl:if>
1292                         <xsl:if test="not(../../BUSCONNS[(@ORIENTED = 'EAST')])">0</xsl:if>
1293                 </xsl:variable>
1294                 
1295 <!--            
1296                 <xsl:message>West width is <xsl:value-of select="$busLaneWestW_"/></xsl:message>
1297                 <xsl:message>proc x <xsl:value-of select="$proc_x_"/></xsl:message>
1298                 <xsl:message>Bus lane west <xsl:value-of select="$busLaneWestW_"/></xsl:message>
1299                 <xsl:message>Bus lane east <xsl:value-of select="$busLaneEastW_"/></xsl:message>
1300                 <xsl:message>Num shared buckets <xsl:value-of select="$numSbsBkts_"/></xsl:message>
1301 -->             
1302                 
1303                 
1304                 <xsl:variable name="bktModsW_">
1305                         <xsl:if test="($numSbsBkts_ &gt; 0)">
1306                                 <xsl:value-of select="(($MOD_BKTLANE_W * 2) + ($periMOD_W * $pbktW_) + ($MOD_BUCKET_G * ($pbktW_ - 1)))"/>      
1307                         </xsl:if>
1308                         <xsl:if test="not($numSbsBkts_ &gt; 0)">0</xsl:if>
1309                 </xsl:variable> 
1310                 <xsl:variable name="pstkModsW_" select="($pmodW_ * $periMOD_W)"/>
1311                 
1312                 <xsl:variable name="pstackW_">
1313                         <xsl:if test="$bktModsW_ &gt; $pstkModsW_">
1314                                 <xsl:value-of select="$bktModsW_"/>
1315                         </xsl:if>
1316                         <xsl:if test="not($bktModsW_ &gt; $pstkModsW_)">
1317                                 <xsl:value-of select="$pstkModsW_"/>
1318                         </xsl:if>
1319                 </xsl:variable>
1320                 
1321                 <xsl:variable name="splbus_w_" select="$BUS_ARROW_W + $BIFC_W + $BIFC_Wi"/>
1322                 
1323                 <xsl:variable name="proc2procX_" >
1324                         <xsl:if test="$oriented_= 'WEST'"><xsl:value-of select="$proc_x_ + $busLaneWestW_  + ceiling($pstackW_ div 2) - (ceiling($periMOD_W div 2) + $BIFC_W + $splbus_w_)"/></xsl:if>  
1325                         <xsl:if test="$oriented_= 'EAST'"><xsl:value-of select="$proc_x_ + $busLaneEastW_  + ceiling($pstackW_ div 2) + ceiling($periMOD_W div 2) + $BIFC_W"/></xsl:if> 
1326                 </xsl:variable>  
1327                 
1328                 <xsl:variable name="pr2prNumX_" >
1329                         <xsl:if test="$oriented_= 'WEST'"><xsl:value-of select="$proc2procX_ + ceiling($BIFC_W div 4)"/></xsl:if>       
1330                         <xsl:if test="$oriented_= 'EAST'"><xsl:value-of select="$proc2procX_ + ($BUS_ARROW_W * 2) + ceiling($BIFC_W div 4)"/></xsl:if>  
1331 <!--                    
1332                         <xsl:if test="$oriented_= 'EAST'"><xsl:value-of select="$proc2procX_ + ceiling($BIFC_W div 4)"/></xsl:if>       
1333                         <xsl:if test="$oriented_= 'EAST'"><xsl:value-of select="$proc2procX_ + $BUS_ARROW_W + $BIFC_W + ceiling($BIFC_Wi div 2)"/></xsl:if>     
1334                         <xsl:if test="$oriented_= 'EAST'"><xsl:value-of select="$proc2procX_ + $BUS_ARROW_W + $BIFC_W + ceiling($BIFC_Wi div 2) - 4"/></xsl:if> 
1335                 <xsl:message>The Split count is <xsl:value-of select="@SPLITCNT"/></xsl:message>
1336 -->     
1337                 </xsl:variable>  
1338                 
1339                 
1340                 <xsl:variable name="pr2prLabelX_" >
1341                         <xsl:if test="$oriented_= 'WEST'"><xsl:value-of select="$proc2procX_ - (string-length(@BUSNAME) * 6)"/></xsl:if>        
1342                         <xsl:if test="$oriented_= 'EAST'"><xsl:value-of select="$proc2procX_ + $splbus_w_"/></xsl:if>   
1343                 </xsl:variable>  
1344                 
1345                 <xsl:variable name="proc2procY_"   select="(($proc_y_ + ($MOD_LANE_H + $MOD_LABEL_H + $MOD_BIF_GAP_V) + (($BIF_H + $BIF_GAP) * @PBIF_Y) + ceiling($BIF_H div 2)) - ceiling($BIFC_H div 2))"/>
1346                 <xsl:variable name="proc2procDy_"  select="(ceiling($BIF_H div 2) - ceiling($BUS_ARROW_G div 2))"/>
1347                 
1348                 
1349                 <!-- For unidirectional orientations, when its a master draw this end one way -->               
1350                 <xsl:variable name="draw_oriented_">
1351                         <xsl:choose>
1352                                 <xsl:when test="(@BIFRANK = 'MASTER')"><xsl:value-of select="$BIF_TYPE_ONEWAY"/></xsl:when>
1353                                 <xsl:otherwise><xsl:value-of select="$oriented_"/></xsl:otherwise>      
1354                         </xsl:choose>           
1355                 </xsl:variable>
1356                 
1357                 <use   x="{$proc2procX_}"   y="{$proc2procY_ + $proc2procDy_}"  xlink:href="#{@BUSSTD}_SplitBus_{$draw_oriented_}"/>
1358                 
1359                 
1360 <!--            
1361                 <text class="splitbustxt"
1362               x="{$pr2prNumX_} "
1363                           y="{$proc2procY_ + $proc2procDy_ + 8}">
1364                          <xsl:value-of select="@SPLITCNT"/> 
1365                 </text>           
1366 -->             
1367                 
1368                 <text class="splitbustxt"
1369               x="{$pr2prNumX_} "
1370                           y="{$proc2procY_ + $proc2procDy_ + 7}">
1371                          <xsl:value-of select="@SPLITCNT"/> 
1372                 </text>           
1373                 
1374                 <text class="horizp2pbuslabel"
1375               x="{$pr2prLabelX_} "
1376                           y="{$proc2procY_ + $proc2procDy_ + 8}">
1377                          <xsl:value-of select="@BUSNAME"/> 
1378                 </text>           
1379         </xsl:for-each>         
1380
1381                 
1382         
1383         <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE/BUSCONNS/BUSCONN[(@IS_PROC2PROC = 'TRUE') and (@BIFRANK = 'MASTER') and not(@IS_SPLITCONN = 'TRUE')]">
1384                         
1385 <!--  MASTER VALUES -->         
1386                 <xsl:variable name="mst_oriented_"        select="../@ORIENTED"/>
1387                 <xsl:variable name="mst_procInst_"        select="../../@INSTANCE"/>
1388                 <xsl:variable name="busName_"             select="@BUSNAME"/>
1389                 
1390                 <xsl:variable name="mst_numMemCs_"        select="count(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[((@PROCESSOR = $mst_procInst_) and (@MODCLASS='MEMORY_UNIT'))])"/> 
1391                 <xsl:variable name="mst_numSbsBkts_"      select="count(/EDKSYSTEM/BLKDSHAPES/SBSBUCKETS/SBSBUCKET[   (@PROCESSOR = $mst_procInst_)])"/>        
1392                 
1393                 <xsl:variable name="mst_proc_bifs_h_"     select="../../@BIFS_H"/>
1394                 <xsl:variable name="mst_numSlvsAbv_"      select="../../@PMODS_ABOVE_SBS_H"/>
1395                 <xsl:variable name="mst_numSlvsBlw_"      select="../../@PMODS_BELOW_SBS_H"/>
1396                 
1397                 <xsl:variable name="mst_gaps_right_"      select="(../../@GAPS_X      * $MOD_SHAPES_G)"/>
1398                 <xsl:variable name="mst_mods_right_"      select="(../../@MODS_X      * $periMOD_W)"/>
1399                 <xsl:variable name="mst_lanes_right_"     select="(../../@BUS_LANES_X * $BUS_LANE_W)"/>
1400                 <xsl:variable name="mst_bkt_lanes_right_" select="(../../@BKT_LANES_X * $MOD_BKTLANE_W)"/>
1401                 <xsl:variable name="mst_bkt_gaps_right_"  select="(../../@BKT_GAPS_X  * $MOD_BUCKET_G)"/>
1402                 
1403                 <xsl:variable name="mst_pbifsW_"          select="../../@BIFS_W"/>
1404                 <xsl:variable name="mst_pbktW_"           select="../../@PSTACK_BKT_W"/>
1405                 <xsl:variable name="mst_pmodW_"           select="../../@PSTACK_MOD_W"/>
1406                 
1407                 <xsl:variable name="mst_pbifsH_"          select="../../@BIFS_H"/>
1408                 <xsl:variable name="mst_pbktH_"           select="../../@PSTACK_BKT_H"/>
1409                 <xsl:variable name="mst_pmodH_"           select="../../@PSTACK_MOD_H"/>
1410                 
1411                 <xsl:variable name="mst_memCH_"           select="($mst_numMemCs_   * (($periMOD_H * 2) + $BIF_H))"/>
1412                 <xsl:variable name="mst_slavesH_"         select="($mst_numSlvsAbv_ * ( $periMOD_H      + $BIF_H))"/>
1413                 <xsl:variable name="mst_proc_h_"          select="(($MOD_LANE_H * 2) + (($BIF_H + $MOD_BIF_GAP_V) * $mst_proc_bifs_h_) + ($MOD_LABEL_H + $MOD_BIF_GAP_V))"/>    
1414                 <xsl:variable name="mst_pabv_h_"          select="($mst_proc_h_ + $mst_memCH_ + $mst_slavesH_)"/>
1415                 
1416                 <xsl:variable name="mst_proc_y_"          select="($SharedBus_Y - ($PROC2SBS_GAP + $mst_proc_h_))"/>
1417                 <xsl:variable name="mst_proc_x_"          select="($Inner_X + $mst_gaps_right_ +  $mst_mods_right_ + $mst_bkt_lanes_right_ + $mst_bkt_gaps_right_ + $mst_lanes_right_)"/>
1418                 
1419                 <xsl:variable name="mst_busLaneWestW_">
1420                         <xsl:if test="(../../BUSCONNS[@ORIENTED = 'WEST'])">
1421                                 <xsl:value-of select="((../../BUSCONNS[@ORIENTED ='WEST']/@BUSLANE_W) * $BUS_LANE_W)"/>
1422                         </xsl:if>
1423                         <xsl:if test="not(../../BUSCONNS[@ORIENTED = 'WEST'])">0</xsl:if>
1424                 </xsl:variable>
1425                         
1426                 <xsl:variable name="mst_busLaneEastW_">
1427                         <xsl:if test="(../../BUSCONNS[@ORIENTED = 'EAST'])">
1428                                 <xsl:value-of select="((../../BUSCONNS[@ORIENTED ='EAST']/@BUSLANE_W) * $BUS_LANE_W)"/>
1429                         </xsl:if>
1430                         <xsl:if test="not(../../BUSCONNS[@ORIENTED = 'EAST'])">0</xsl:if>
1431                 </xsl:variable>
1432                 
1433                 <xsl:variable name="mst_bktModsW_">
1434                         <xsl:if test="($mst_numSbsBkts_ &gt; 0)">
1435                                 <xsl:value-of select="(($MOD_BKTLANE_W * 2) + ($periMOD_W * $mst_pbktW_) + ($MOD_BUCKET_G * ($mst_pbktW_ - 1)))"/>      
1436                         </xsl:if>
1437                         <xsl:if test="not($mst_numSbsBkts_ &gt; 0)">0</xsl:if>
1438                 </xsl:variable> 
1439                 
1440                 <xsl:variable name="mst_pstkModsW_" select="($mst_pmodW_ * $periMOD_W)"/>
1441                 
1442                 <xsl:variable name="mst_pstackW_">
1443                         <xsl:if test="$mst_bktModsW_ &gt; $mst_pstkModsW_">
1444                                 <xsl:value-of select="$mst_bktModsW_"/>
1445                         </xsl:if>
1446                         <xsl:if test="not($mst_bktModsW_ &gt; $mst_pstkModsW_)">
1447                                 <xsl:value-of select="$mst_pstkModsW_"/>
1448                         </xsl:if>
1449                 </xsl:variable>
1450                 
1451 <!--  SLAVE VALUES -->          
1452                 <xsl:variable name="slaveInst_"           select="/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[not(@INSTANCE = $mst_procInst_) and BUSCONNS/BUSCONN[@BUSNAME = $busName_]]/@INSTANCE"/>      
1453                 <xsl:variable name="slv_numMemCs_"        select="count(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[((@PROCESSOR = $slaveInst_) and (@MODCLASS='MEMORY_UNIT'))])"/>
1454                 <xsl:variable name="slv_numSbsBkts_"      select="count(/EDKSYSTEM/BLKDSHAPES/SBSBUCKETS/SBSBUCKET[   (@PROCESSOR = $slaveInst_)])"/>
1455                 
1456                 <xsl:variable name="slv_proc_bifs_h_"     select="/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[@INSTANCE = $slaveInst_]/@BIFS_H"/>
1457                 <xsl:variable name="slv_numSlvsAbv_"      select="/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[@INSTANCE = $slaveInst_]/@PMODS_ABOVE_SBS_H"/>
1458                 <xsl:variable name="slv_numSlvsBlw_"      select="/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[@INSTANCE = $slaveInst_]/@PMODS_BELOW_SBS_H"/>
1459                 
1460                 <xsl:variable name="slv_gaps_right_"      select="(/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[@INSTANCE = $slaveInst_]/@GAPS_X      * $MOD_SHAPES_G)"/>
1461                 <xsl:variable name="slv_mods_right_"      select="(/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[@INSTANCE = $slaveInst_]/@MODS_X      * $periMOD_W)"/>
1462                 <xsl:variable name="slv_lanes_right_"     select="(/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[@INSTANCE = $slaveInst_]/@BUS_LANES_X * $BUS_LANE_W)"/>
1463                 <xsl:variable name="slv_bkt_lanes_right_" select="(/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[@INSTANCE = $slaveInst_]/@BKT_LANES_X * $MOD_BKTLANE_W)"/>
1464                 <xsl:variable name="slv_bkt_gaps_right_"  select="(/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[@INSTANCE = $slaveInst_]/@BKT_GAPS_X  * $MOD_BUCKET_G)"/>
1465                 
1466                 <xsl:variable name="slv_pbifsW_"          select="/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[@INSTANCE = $slaveInst_]/@BIFS_W"/>
1467                 <xsl:variable name="slv_pbktW_"           select="/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[@INSTANCE = $slaveInst_]/@PSTACK_BKT_W"/>
1468                 <xsl:variable name="slv_pmodW_"           select="/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[@INSTANCE = $slaveInst_]/@PSTACK_MOD_W"/>
1469                 
1470                 <xsl:variable name="slv_pbifsH_"          select="/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[@INSTANCE = $slaveInst_]/@BIFS_H"/>
1471                 <xsl:variable name="slv_pbktH_"           select="/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[@INSTANCE = $slaveInst_]/@PSTACK_BKT_H"/>
1472                 <xsl:variable name="slv_pmodH_"           select="/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[@INSTANCE = $slaveInst_]/@PSTACK_MOD_H"/>
1473                 
1474                 <xsl:variable name="slv_memCH_"           select="($slv_numMemCs_   * (($periMOD_H * 2) + $BIF_H))"/>
1475                 <xsl:variable name="slv_slavesH_"         select="($slv_numSlvsAbv_ * ( $periMOD_H      + $BIF_H))"/>
1476                 <xsl:variable name="slv_proc_h_"          select="(($MOD_LANE_H * 2) + (($BIF_H + $MOD_BIF_GAP_V) * $slv_proc_bifs_h_) + ($MOD_LABEL_H + $MOD_BIF_GAP_V))"/>    
1477                 <xsl:variable name="slv_pabv_h_"          select="($slv_proc_h_ + $slv_memCH_ + $slv_slavesH_)"/>
1478                 
1479                 <xsl:variable name="slv_proc_y_"          select="($SharedBus_Y - ($PROC2SBS_GAP + $slv_proc_h_))"/>
1480                 <xsl:variable name="slv_proc_x_"          select="($Inner_X + $slv_gaps_right_ +  $slv_mods_right_ + $slv_bkt_lanes_right_ + $slv_bkt_gaps_right_ + $slv_lanes_right_)"/>
1481                 
1482                 <xsl:variable name="slv_busLaneWestW_">
1483                         <xsl:if test="(/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[@INSTANCE = $slaveInst_]/BUSCONNS[@ORIENTED = 'WEST'])">
1484                                 <xsl:value-of select="((/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[@INSTANCE = $slaveInst_]/BUSCONNS[@ORIENTED ='WEST']/@BUSLANE_W) * $BUS_LANE_W)"/>
1485                         </xsl:if>
1486                         <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[@INSTANCE = $slaveInst_]/BUSCONNS[@ORIENTED = 'WEST'])">0</xsl:if>
1487                 </xsl:variable>
1488                 
1489                 <xsl:variable name="mstArrow_">
1490                         <xsl:choose>
1491                                 <xsl:when test="(@BUSSSTD = 'FSL')">BusArrowHInitiator</xsl:when>
1492                                 <xsl:otherwise>BusArrowWest</xsl:otherwise> 
1493                         </xsl:choose>           
1494                 </xsl:variable>
1495                 
1496                         
1497                 <xsl:variable name="slv_busLaneEastW_">
1498                         <xsl:if test="(/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[(@INSTANCE = $slaveInst_)]/BUSCONNS[(@ORIENTED = 'EAST')])">
1499                                 <xsl:value-of select="((/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[(@INSTANCE = $slaveInst_)]/BUSCONNS[(@ORIENTED ='EAST')]/@BUSLANE_W) * $BUS_LANE_W)"/>
1500                         </xsl:if>
1501                         <xsl:if test="not(/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE[(@INSTANCE = $slaveInst_)]/BUSCONNS[(@ORIENTED = 'EAST')])">0</xsl:if>
1502                 </xsl:variable>
1503                 
1504                 <xsl:variable name="slv_bktModsW_">
1505                         <xsl:if test="($slv_numSbsBkts_ &gt; 0)">
1506                                 <xsl:value-of select="(($MOD_BKTLANE_W * 2) + ($periMOD_W * $slv_pbktW_) + ($MOD_BUCKET_G * ($slv_pbktW_ - 1)))"/>      
1507                         </xsl:if>
1508                         <xsl:if test="not($slv_numSbsBkts_ &gt; 0)">0</xsl:if>
1509                 </xsl:variable> 
1510                 
1511                 <xsl:variable name="slv_pstkModsW_" select="($slv_pmodW_ * $periMOD_W)"/>
1512                 
1513                 <xsl:variable name="slv_pstackW_">
1514                         <xsl:if test="$slv_bktModsW_ &gt; $slv_pstkModsW_">
1515                                 <xsl:value-of select="$slv_bktModsW_"/>
1516                         </xsl:if>
1517                         <xsl:if test="not($slv_bktModsW_ &gt; $slv_pstkModsW_)">
1518                                 <xsl:value-of select="$slv_pstkModsW_"/>
1519                         </xsl:if>
1520                 </xsl:variable>
1521                 
1522 <!--            
1523                 <xsl:message>Slave bus lane west <xsl:value-of select="$slv_busLaneWestW_"/></xsl:message>
1524                 <xsl:message>Slave bus lane east <xsl:value-of select="$slv_busLaneEastW_"/></xsl:message>
1525 -->             
1526                 
1527                 <xsl:variable name="proc2procBegX_" select="$mst_proc_x_ + $mst_busLaneWestW_  + ceiling($mst_pstackW_ div 2) + ceiling($periMOD_W div 2) + $BIFC_W"/>
1528                 <xsl:variable name="proc2procEndX_" select="$slv_proc_x_ + $slv_busLaneWestW_  + ceiling($slv_pstackW_ div 2) - (ceiling($periMOD_W div 2) + $BIFC_W + $BUS_ARROW_W)"/>
1529                 
1530                 <xsl:variable name="proc2procBegY_" select="(($mst_proc_y_ + ($MOD_LANE_H + $MOD_LABEL_H + $MOD_BIF_GAP_V) + (($BIF_H + $MOD_BIF_GAP_V) * @PBIF_Y) + ceiling($BIF_H div 2)) - ceiling($BIFC_H div 2))"/>
1531                 <xsl:variable name="proc2procDy_"   select="(ceiling($BIF_H div 2) - ceiling($BUS_ARROW_G div 2))"/>
1532                 <xsl:variable name="proc2procY_"    select="($proc2procBegY_ + $proc2procDy_)"/>
1533                 <xsl:variable name="bus_col_">
1534                         <xsl:call-template name="BusType2Color">
1535                                 <xsl:with-param name="busType" select="@BUSSTD"/>
1536                         </xsl:call-template>    
1537                 </xsl:variable>
1538                 
1539                 <use  x="{$proc2procBegX_}" y="{$proc2procY_}"  xlink:href="#{@BUSSTD}_{$mstArrow_}"/>
1540                 <use  x="{$proc2procEndX_}" y="{$proc2procY_}"  xlink:href="#{@BUSSTD}_BusArrowEast"/>  
1541                 <rect x="{$proc2procBegX_ + $BUS_ARROW_W}" 
1542                           y="{$proc2procY_ + $BUS_ARROW_G}"  
1543                           width= "{($proc2procEndX_  - $proc2procBegX_ - $BUS_ARROW_W)}" 
1544                           height="{$BUS_ARROW_H - (2 * $BUS_ARROW_G)}" style="stroke:none; fill:{$bus_col_}"/>
1545                           
1546                 <text class="horizp2pbuslabel"
1547               x="{$proc2procBegX_ + 8} "
1548                           y="{$proc2procY_    - 2}">
1549                          <xsl:value-of select="@BUSNAME"/> 
1550                 </text>           
1551                 
1552                 <text class="horizp2pbuslabel"
1553               x="{$proc2procEndX_ - (string-length(@BUSNAME) * 6)} "
1554                           y="{$proc2procY_    - 2}">
1555                          <xsl:value-of select="@BUSNAME"/> 
1556                 </text>           
1557                 
1558 <!--            
1559                 <xsl:variable name="pr2prLabelX_" >
1560                         <xsl:if test="$oriented_= 'WEST'"><xsl:value-of select="$proc2procX_ - (string-length(@BUSNAME) * 6)"/></xsl:if>        
1561                         <xsl:if test="$oriented_= 'EAST'"><xsl:value-of select="$proc2procX_ + $splbus_w_"/></xsl:if>   
1562                 </xsl:variable>  
1563                 
1564                 <use   x="{$proc2procX_}"   y="{$proc2procY_ + $proc2procDy_}"  xlink:href="#{@BUSSTD}_SplitBus_{$oriented_}"/>
1565                 
1566                 <text class="splitp2pbuslabel"
1567               x="{$pr2prLabelX_} "
1568                           y="{$proc2procY_ + $proc2procDy_ + 8}">
1569                          <xsl:value-of select="@BUSNAME"/> 
1570                 </text>           
1571 -->             
1572         </xsl:for-each>         
1573         
1574 </xsl:template>
1575         
1576 <!--
1577         ====================================================================================
1578                            FUNCTION TEMPLATE      
1579                                                                                                                                                  
1580          Draw Bus connections on modules that are connected to more than one module
1581         ====================================================================================
1582 -->
1583 <xsl:template name="Draw_BlkDiagram_MultiProcConnections">
1584         
1585         <xsl:param name="Inner_X"                select="0"/>
1586         <xsl:param name="SharedBus_Y"            select="0"/>
1587         <xsl:param name="SharedBus_H"            select="0"/>
1588         <xsl:param name="Max_Proc_H"             select="0"/>
1589         <xsl:param name="Max_Proc_PerisAbvSbs_H" select="0"/>
1590         <xsl:param name="Max_Proc_PerisBlwSbs_H" select="0"/>
1591         <xsl:param name="Max_SbsBuckets_H"       select="0"/>
1592         
1593 <!--    
1594         <xsl:message>Reached Multi Processor connections</xsl:message>
1595 -->     
1596         
1597         <!--
1598                  ============================================================ 
1599                 Draw Multiproc Bus connection lanes, (two or more connections on the same bus lane)
1600                  ============================================================ 
1601          -->    
1602         
1603         <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE/BUSCONNS/BUSCONNLANE[((@IS_MULTIPROC = 'TRUE') and not(@IS_SPLITCONN = 'TRUE') and @BUSNAME and @BUSSTD and @BUSLANE_X)]">
1604                 
1605 <!--            
1606                 <xsl:message>Found a Multi Processor Busconn Group  </xsl:message>
1607 -->             
1608                 
1609                 <xsl:variable name="oriented_"         select="../@ORIENTED"/>
1610                 <xsl:variable name="busName_"          select="@BUSNAME"/>
1611                 
1612                 <xsl:variable name="busColor_">
1613                         <xsl:call-template name="BusType2Color">
1614                                 <xsl:with-param name="busType" select="@BUSSTD"/>
1615                         </xsl:call-template>    
1616                 </xsl:variable>
1617                 
1618                 <xsl:variable name="mp_proc_inst_"    select="../../@INSTANCE"/>
1619                 <xsl:variable name="mp_proc_bifs_h_"  select="../../@BIFS_H"/>
1620                 <xsl:variable name="mp_proc_bifs_w_"  select="../../@BIFS_W"/>
1621                 <xsl:variable name="mp_proc_pbktW_"   select="../../@PSTACK_BKT_W"/>
1622                 <xsl:variable name="mp_proc_pbktH_"   select="../../@PSTACK_BKT_H"/>
1623                 <xsl:variable name="mp_proc_pmodW_"   select="../../@PSTACK_MOD_W"/>
1624                 <xsl:variable name="mp_proc_pmodH_"   select="../../@PSTACK_MOD_H"/>
1625                 
1626                 <xsl:variable name="mp_proc_gaps_right_"      select="(../../@GAPS_X      * $MOD_SHAPES_G)"/>
1627                 <xsl:variable name="mp_proc_mods_right_"      select="(../../@MODS_X      * $periMOD_W)"/>
1628                 <xsl:variable name="mp_proc_lanes_right_"     select="(../../@BUS_LANES_X * $BUS_LANE_W)"/>
1629                 <xsl:variable name="mp_proc_bkt_lanes_right_" select="(../../@BKT_LANES_X * $MOD_BKTLANE_W)"/>
1630                 <xsl:variable name="mp_proc_bkt_gaps_right_"  select="(../../@BKT_GAPS_X  * $MOD_BUCKET_G)"/>
1631                 
1632                 <xsl:variable name="mp_proc_h_"  select="(($MOD_LANE_H * 2) + (($BIF_H + $MOD_BIF_GAP_V) * $mp_proc_bifs_h_) + ($MOD_LABEL_H + $MOD_BIF_GAP_V))"/>      
1633                 <xsl:variable name="mp_proc_y_"  select="($SharedBus_Y - ($PROC2SBS_GAP + $mp_proc_h_))"/>
1634                 <xsl:variable name="mp_proc_x_"  select="($Inner_X + $mp_proc_gaps_right_ +  $mp_proc_mods_right_ + $mp_proc_bkt_lanes_right_ + $mp_proc_bkt_gaps_right_ + $mp_proc_lanes_right_)"/>
1635                 
1636                 <xsl:variable name="mp_proc_numSbsBkts_"  select="count(/EDKSYSTEM/BLKDSHAPES/SBSBUCKETS/SBSBUCKET[   (@PROCESSOR = $mp_proc_inst_)])"/>        
1637                 
1638                 <xsl:variable name="mp_proc_bktModsW_">
1639                         <xsl:if test="($mp_proc_numSbsBkts_ &gt; 0)">
1640                                 <xsl:value-of select="(($MOD_BKTLANE_W * 2) + ($periMOD_W * $mp_proc_pbktW_) + ($MOD_BUCKET_G * ($mp_proc_pbktW_ - 1)))"/>      
1641                         </xsl:if>
1642                         <xsl:if test="not($mp_proc_numSbsBkts_ &gt; 0)">0</xsl:if>
1643                 </xsl:variable> 
1644                 
1645                 <xsl:variable name="mp_proc_pstkModsW_" select="($mp_proc_pmodW_ * $periMOD_W)"/>
1646                 
1647                 <xsl:variable name="mp_proc_stack_w_">
1648                         <xsl:if test="$mp_proc_bktModsW_ &gt; $mp_proc_pstkModsW_">
1649                                 <xsl:value-of select="$mp_proc_bktModsW_"/>
1650                         </xsl:if>
1651                         <xsl:if test="not($mp_proc_bktModsW_ &gt; $mp_proc_pstkModsW_)">
1652                                 <xsl:value-of select="$mp_proc_pstkModsW_"/>
1653                         </xsl:if>
1654                 </xsl:variable>
1655                 
1656                 <xsl:variable name="mp_stack_numMemus_"        select="count(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[((@PSTACK_BLKD_X = @PSTACK_BLKD_X) and (@MODCLASS = 'MEMORY_UNIT'))])"/>      
1657                 
1658                 <xsl:variable name="mp_stack_h_">
1659                         <xsl:call-template name="_calc_MultiProc_Stack_Height">
1660                                 <xsl:with-param name="mpstack_blkd_x" select="(@PSTACK_BLKD_X)"/>
1661                         </xsl:call-template>
1662                 </xsl:variable>
1663                 
1664                 <xsl:variable name="mp_stack_y_"                           select="($SharedBus_Y - ($PROC2SBS_GAP + $Max_Proc_H + $Max_Proc_PerisAbvSbs_H + $mp_stack_h_))"/>
1665
1666                 <xsl:variable name="mp_stack_gaps_right_"      select="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@PSTACK_BLKD_X = @PSTACK_BLKD_X)]/@GAPS_X           * $MOD_SHAPES_G)"/>
1667                 <xsl:variable name="mp_stack_mods_right_"      select="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@PSTACK_BLKD_X = @PSTACK_BLKD_X)]/@MODS_X      * $periMOD_W)"/>
1668                 <xsl:variable name="mp_stack_lanes_right_"     select="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@PSTACK_BLKD_X = @PSTACK_BLKD_X)]/@BUS_LANES_X * $BUS_LANE_W)"/>
1669                 <xsl:variable name="mp_stack_bkt_lanes_right_" select="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@PSTACK_BLKD_X = @PSTACK_BLKD_X)]/@BKT_LANES_X * $MOD_BKTLANE_W)"/>
1670                 <xsl:variable name="mp_stack_bkt_gaps_right_"  select="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@PSTACK_BLKD_X = @PSTACK_BLKD_X)]/@BKT_GAPS_X  * $MOD_BUCKET_G)"/>
1671                 <xsl:variable name="mp_stack_x_"               select="($Inner_X + $mp_stack_gaps_right_ +  $mp_stack_mods_right_ + $mp_stack_bkt_lanes_right_ + $mp_stack_bkt_gaps_right_ + $mp_stack_lanes_right_)"/>
1672                 
1673                 <xsl:variable name="mp_stack_w_">
1674                         <xsl:if test="($mp_stack_numMemus_ &gt; 0)">
1675                                 <xsl:value-of select="($periMOD_W * 2)"/>
1676                         </xsl:if>
1677                         <xsl:if test="not($mp_stack_numMemus_ &gt; 0)">
1678                                 <xsl:value-of select="$periMOD_W"/>
1679                         </xsl:if>
1680                 </xsl:variable>
1681                 
1682                 <xsl:variable name="mp_busLaneWestW_">
1683                         <xsl:if test="(../../BUSCONNS[@ORIENTED = 'WEST'])">
1684                                 <xsl:value-of select="((../../BUSCONNS[@ORIENTED ='WEST']/@BUSLANE_W) * $BUS_LANE_W)"/>
1685                         </xsl:if>
1686                         <xsl:if test="not(../../BUSCONNS[@ORIENTED = 'WEST'])">0</xsl:if>
1687                 </xsl:variable>
1688                         
1689                 <xsl:variable name="mp_busLaneEastW_">
1690                         <xsl:if test="(../../BUSCONNS[@ORIENTED = 'EAST'])">
1691                                 <xsl:value-of select="((../../BUSCONNS[@ORIENTED ='EAST']/@BUSLANE_W) * $BUS_LANE_W)"/>
1692                         </xsl:if>
1693                         <xsl:if test="not(../../BUSCONNS[@ORIENTED = 'EAST'])">0</xsl:if>
1694                 </xsl:variable>
1695                 
1696                 <!-- all the connections will be on the same line..      -->    
1697                 <xsl:variable name="mp_bc_x_" >
1698                         <xsl:if test="$oriented_= 'EAST'">
1699                                 <xsl:value-of select="($mp_proc_x_ + $mp_busLaneWestW_ + $mp_proc_stack_w_ + ((@BUSLANE_X + 1) * $BUS_LANE_W))"/>
1700                         </xsl:if>       
1701                                 
1702                         <xsl:if test="$oriented_= 'WEST'">
1703                                 <xsl:value-of select="($mp_proc_x_ + $mp_busLaneWestW_ + - ((@BUSLANE_X + 1) * $BUS_LANE_W))"/>
1704                         </xsl:if>       
1705                 </xsl:variable>  
1706                 
1707 <!--            
1708                 <rect 
1709               x="{$mp_bc_x_}"
1710                           y="{$mp_stack_y_}"
1711                       width= "4"
1712                       height="700"
1713                           style="fill:{$COL_WHITE}; stroke:none;"/>             
1714 -->     
1715                                 
1716                         
1717                 <xsl:for-each select="BUSCONN">
1718                         <xsl:choose>
1719                                 
1720                                 <!-- A processor connection -->         
1721                                 <xsl:when test="(@PBIF_Y and @BIFRANK)">
1722                                         
1723                                         <xsl:variable name="mp_proc_bif_dy_" select="((($BIF_H + $MOD_BIF_GAP_V) * @PBIF_Y) + ($MOD_LABEL_H + $MOD_BIF_GAP_V + $MOD_LANE_H))"/> 
1724                                         <xsl:variable name="mp_proc_bif_y_" select="$mp_proc_y_ + $mp_proc_bif_dy_"/>
1725 <!--                                    
1726                                         <xsl:variable name="mp_proc_bif_y_" select="$mp_proc_y_ + $mp_proc_bif_dy_  - ceiling($BIFC_H div 2) + ($BUS_ARROW_G * 2)"/>
1727 -->     
1728                                         
1729                                         <use   x="{$mp_bc_x_ - ceiling($BIFC_W div 2)}"
1730                                            y="{$mp_proc_bif_y_}"
1731                                                 xlink:href="#{../@BUSSTD}_busconn_{@BIFRANK}"/>
1732                                         
1733                                         <xsl:if test="$oriented_ = 'EAST'">
1734                                                 <xsl:variable name="east_bif_x_" select="($mp_proc_x_ + $mp_busLaneWestW_ + ceiling($mp_proc_stack_w_ div 2) + ceiling($periMOD_W div 2) - $MOD_LANE_W)"/>
1735                                                 <line x1="{$mp_bc_x_}" 
1736                                                   y1="{$mp_proc_bif_y_ + ceiling($BIFC_H div 2)}" 
1737                                           x2="{$east_bif_x_}" 
1738                                                   y2="{$mp_proc_bif_y_ + ceiling($BIFC_H div 2)}" 
1739                                                   style="stroke:{$busColor_};stroke-width:1"/>
1740                                         </xsl:if>
1741                                         
1742                                         <xsl:if test="$oriented_ = 'WEST'">
1743                                                 <xsl:variable name="west_bif_x_" select="($mp_proc_x_ + $mp_busLaneWestW_ + ceiling($mp_proc_stack_w_ div 2) - ceiling($periMOD_W div 2) + $MOD_LANE_W)"/>
1744                                                 <line x1="{$mp_bc_x_}" 
1745                                                   y1="{$mp_proc_bif_y_ + ceiling($BIFC_H div 2)}" 
1746                                           x2="{$west_bif_x_}" 
1747                                                   y2="{$mp_proc_bif_y_ + ceiling($BIFC_H div 2)}" 
1748                                                   style="stroke:{$busColor_};stroke-width:1"/>
1749                                         </xsl:if>
1750                                         
1751                                 </xsl:when>
1752                                 
1753                                 
1754                                 <!-- A non processor connection from some peripheral in the stack-->            
1755                                 <xsl:when test="(@BIF_Y and @CSTACK_MODS_Y and @CSTACK_INDEX and @BIFRANK)">
1756 <!--                                    
1757                                         <xsl:variable name="mp_peri_bif_dy_" select="((($BIF_H + $BIF_GAP) * @PBIF_Y) + ($MOD_LABEL_H + $BIF_GAP + $MOD_LANE_H))"/>     
1758                                         <xsl:variable name="mp_peri_bif_y_" select="$mp_proc_y_ + $mp_proc_bif_dy_"/>
1759                                         <xsl:with-param name="cstackModY"  select="@CSTACK_MODS_Y"/>
1760 -->     
1761                                         
1762                                         <xsl:variable name="mp_stack_mod_h_">
1763                                                 <xsl:call-template name="_calc_CStackShapesAbv_Height">
1764                                                         <xsl:with-param name="cstkIndex"  select="@CSTACK_INDEX"/>
1765                                                         <xsl:with-param name="cstkMods_Y" select="@CSTACK_MODS_Y"/>
1766                                                 </xsl:call-template>    
1767                                         </xsl:variable>
1768                                         
1769                                         <xsl:variable name="mp_stack_mod_y_" select="$mp_stack_y_ + $mp_stack_mod_h_"/>
1770                                         
1771                                         <xsl:variable name="mp_stack_mod_dy_" >
1772                                                 <xsl:if test="not(@IS_MEMBIF)">
1773                                                         <xsl:value-of select="($MOD_LANE_H + $MOD_LABEL_H + $MOD_BIF_GAP_V + (@BIF_Y * ($BIF_H + $MOD_BIF_GAP_V)) + ceiling($BIF_H div 2))"/>
1774                                                 </xsl:if>
1775                                 
1776                                                 <xsl:if test="@IS_MEMBIF">
1777                                                         <xsl:value-of select="($periMOD_H +  $MOD_LANE_H + ceiling($BIF_H div 2))"/>
1778                                                 </xsl:if> </xsl:variable>  
1779                                         
1780                                         <use   x="{$mp_bc_x_ - ceiling($BIFC_W div 2)}"
1781                                            y="{$mp_stack_mod_y_ + $mp_stack_mod_dy_ - ceiling($BIFC_H div 2)}"
1782                                                 xlink:href="#{../@BUSSTD}_busconn_{@BIFRANK}"/>
1783                                         
1784                                         <xsl:if test="$oriented_ = 'WEST'">
1785                                                 <line x1="{$mp_stack_x_ + $periMOD_W - $MOD_LANE_W}" 
1786                                                   y1="{$mp_stack_mod_y_  + $mp_stack_mod_dy_}" 
1787                                                   x2="{$mp_bc_x_}" 
1788                                                   y2="{$mp_stack_mod_y_  + $mp_stack_mod_dy_}" 
1789                                                           style="stroke:{$busColor_};stroke-width:1"/>
1790                                         </xsl:if>               
1791                                         
1792                                         <xsl:if test="$oriented_ = 'EAST'">
1793                                                 <line x1="{$mp_bc_x_}" 
1794                                                   y1="{$mp_stack_mod_y_  + $mp_stack_mod_dy_}" 
1795                                                   x2="{$mp_stack_x_ + $MOD_LANE_W}" 
1796                                                   y2="{$mp_stack_mod_y_  + $mp_stack_mod_dy_}" 
1797                                                         style="stroke:{$busColor_};stroke-width:1"/>
1798                                         </xsl:if>               
1799                           
1800                                         
1801                                 </xsl:when>
1802                                 
1803                                 
1804                                 <xsl:otherwise>
1805                                 </xsl:otherwise>                
1806                         </xsl:choose>
1807                 </xsl:for-each>
1808                         
1809                 
1810                 <!-- Store the bus conn Ys in a variable to use to draw the P2P bus --> 
1811                 <xsl:variable name="busConn_Ys_">
1812                 <xsl:for-each select="BUSCONN">
1813                         <xsl:choose>
1814                                 
1815                                 <!-- A processor connection -->         
1816                                 <xsl:when test="(@PBIF_Y and @BIFRANK)">
1817                                         
1818                                         <xsl:variable name="mp_proc_bif_dy_" select="((($BIF_H + $MOD_BIF_GAP_V) * @PBIF_Y) + ($MOD_LABEL_H + $MOD_BIF_GAP_V + $MOD_LANE_H))"/> 
1819                                         <xsl:variable name="mp_proc_bif_y_" select="$mp_proc_y_ + $mp_proc_bif_dy_"/>
1820                                         
1821                                         <BUSCONN Y="{$mp_proc_bif_y_}"/>
1822                                         
1823                                 </xsl:when>
1824                                 
1825                                 <!-- A non processor connection from some peripheral in the stack-->            
1826                                 <xsl:when test="(@BIF_Y and @CSTACK_MODS_Y and @CSTACK_INDEX and @BIFRANK)">
1827                                         
1828                                         <xsl:variable name="mp_stack_mod_h_">
1829                                                 <xsl:call-template name="_calc_CStackShapesAbv_Height">
1830                                                         <xsl:with-param name="cstkIndex"  select="@CSTACK_INDEX"/>
1831                                                         <xsl:with-param name="cstkMods_Y" select="@CSTACK_MODS_Y"/>
1832                                                 </xsl:call-template>    
1833                                         </xsl:variable>
1834                                         
1835                                         <xsl:variable name="mp_stack_mod_y_" select="$mp_stack_y_ + $mp_stack_mod_h_"/>
1836                                         
1837                                         <xsl:variable name="mp_stack_mod_dy_" >
1838                                                 <xsl:if test="not(@IS_MEMBIF)">
1839                                                         <xsl:value-of select="($MOD_LANE_H + $MOD_LABEL_H + $MOD_BIF_GAP_V + (@BIF_Y * ($BIF_H + $MOD_BIF_GAP_V)) + ceiling($BIF_H div 2))"/>
1840                                                 </xsl:if>
1841                                 
1842                                                 <xsl:if test="@IS_MEMBIF">
1843                                                         <xsl:value-of select="($periMOD_H +  $MOD_LANE_H + ceiling($BIF_H div 2))"/>
1844                                                 </xsl:if> </xsl:variable>  
1845                                         
1846                                         <BUSCONN Y="{$mp_stack_mod_y_ + $mp_stack_mod_dy_ - ceiling($BIFC_H div 2)}"/>
1847                                         
1848                                 </xsl:when>
1849                                 
1850                                 
1851                                 <xsl:otherwise>
1852                                 </xsl:otherwise>                
1853                         </xsl:choose>
1854                 </xsl:for-each>
1855                         
1856                 </xsl:variable>
1857                 
1858                 
1859 <!--            
1860                 <xsl:message>MAX Height is <xsl:value-of select="math:max(exsl:node-set($busConn_Ys_)/BUSCONN/@Y)"/></xsl:message>
1861                 <xsl:message>MIN Height is <xsl:value-of select="math:min(exsl:node-set($busConn_Ys_)/BUSCONN/@Y)"/></xsl:message>
1862 -->     
1863                 
1864                 <xsl:call-template name="Draw_P2PBus">
1865                         <xsl:with-param name="busX"    select="$mp_bc_x_ - ceiling($BIFC_W div 2)"/>
1866                         <xsl:with-param name="busTop"  select="math:min(exsl:node-set($busConn_Ys_)/BUSCONN/@Y)"/>
1867                         <xsl:with-param name="busBot"  select="math:max(exsl:node-set($busConn_Ys_)/BUSCONN/@Y)"/>
1868                         <xsl:with-param name="busStd"  select="@BUSSTD"/>
1869                         <xsl:with-param name="busName" select="@BUSNAME"/>
1870                 </xsl:call-template>
1871                         
1872         </xsl:for-each>         
1873         
1874         
1875         <!--
1876                  ============================================================ 
1877                 Draw Multiproc connections to the shared busses 
1878                  ============================================================ 
1879          -->    
1880         
1881         <xsl:for-each select="/EDKSYSTEM/BLKDSHAPES/PROCSHAPES/MODULE/BUSCONNS/BUSCONN[(@IS_MULTIPROC and not(@IS_SPLITCONN) and @BUSINDEX and @BIF_Y and @BUSLANE_X and @BUSSTD and @BIFRANK)]">
1882                 
1883 <!--            
1884                 <xsl:message>Reached Shared bus Multi Processor connections loop</xsl:message>
1885 -->             
1886                         
1887                 <xsl:variable name="oriented_"         select="../@ORIENTED"/>
1888                 <xsl:variable name="busName_"          select="@BUSNAME"/>
1889                 
1890                 <xsl:variable name="busColor_">
1891                         <xsl:call-template name="BusType2Color">
1892                                 <xsl:with-param name="busType" select="@BUSSTD"/>
1893                         </xsl:call-template>    
1894                 </xsl:variable>
1895                 
1896                 <xsl:variable name="mp_proc_inst_"    select="../../@INSTANCE"/>
1897                 <xsl:variable name="mp_proc_bifs_h_"  select="../../@BIFS_H"/>
1898                 <xsl:variable name="mp_proc_bifs_w_"  select="../../@BIFS_W"/>
1899                 <xsl:variable name="mp_proc_pbktW_"   select="../../@PSTACK_BKT_W"/>
1900                 <xsl:variable name="mp_proc_pbktH_"   select="../../@PSTACK_BKT_H"/>
1901                 <xsl:variable name="mp_proc_pmodW_"   select="../../@PSTACK_MOD_W"/>
1902                 <xsl:variable name="mp_proc_pmodH_"   select="../../@PSTACK_MOD_H"/>
1903                 
1904                 <xsl:variable name="mp_proc_gaps_right_"      select="(../../@GAPS_X      * $MOD_SHAPES_G)"/>
1905                 <xsl:variable name="mp_proc_mods_right_"      select="(../../@MODS_X      * $periMOD_W)"/>
1906                 <xsl:variable name="mp_proc_lanes_right_"     select="(../../@BUS_LANES_X * $BUS_LANE_W)"/>
1907                 <xsl:variable name="mp_proc_bkt_lanes_right_" select="(../../@BKT_LANES_X * $MOD_BKTLANE_W)"/>
1908                 <xsl:variable name="mp_proc_bkt_gaps_right_"  select="(../../@BKT_GAPS_X  * $MOD_BUCKET_G)"/>
1909                 
1910                 <xsl:variable name="mp_proc_h_"  select="(($MOD_LANE_H * 2) + (($BIF_H + $MOD_BIF_GAP_V) * $mp_proc_bifs_h_) + ($MOD_LABEL_H + $MOD_BIF_GAP_V))"/>
1911                 <xsl:variable name="mp_proc_y_"  select="($SharedBus_Y - ($PROC2SBS_GAP + $mp_proc_h_))"/>
1912                 <xsl:variable name="mp_proc_x_"  select="($Inner_X + $mp_proc_gaps_right_ +  $mp_proc_mods_right_ + $mp_proc_bkt_lanes_right_ + $mp_proc_bkt_gaps_right_ + $mp_proc_lanes_right_)"/>
1913                 
1914                 <xsl:variable name="mp_proc_numSbsBkts_"  select="count(/EDKSYSTEM/BLKDSHAPES/SBSBUCKETS/SBSBUCKET[   (@PROCESSOR = $mp_proc_inst_)])"/>        
1915                 
1916                 <xsl:variable name="mp_proc_bktModsW_">
1917                         <xsl:if test="($mp_proc_numSbsBkts_ &gt; 0)">
1918                                 <xsl:value-of select="(($MOD_BKTLANE_W * 2) + ($periMOD_W * $mp_proc_pbktW_) + ($MOD_BUCKET_G * ($mp_proc_pbktW_ - 1)))"/>      
1919                         </xsl:if>
1920                         <xsl:if test="not($mp_proc_numSbsBkts_ &gt; 0)">0</xsl:if>
1921                 </xsl:variable> 
1922                 
1923                 <xsl:variable name="mp_proc_pstkModsW_" select="($mp_proc_pmodW_ * $periMOD_W)"/>
1924                 
1925                 <xsl:variable name="mp_proc_stack_w_">
1926                         <xsl:if test="$mp_proc_bktModsW_ &gt; $mp_proc_pstkModsW_">
1927                                 <xsl:value-of select="$mp_proc_bktModsW_"/>
1928                         </xsl:if>
1929                         <xsl:if test="not($mp_proc_bktModsW_ &gt; $mp_proc_pstkModsW_)">
1930                                 <xsl:value-of select="$mp_proc_pstkModsW_"/>
1931                         </xsl:if>
1932                 </xsl:variable>
1933                 
1934                 <xsl:variable name="mp_stack_numMemus_"        select="count(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[((@PSTACK_BLKD_X = @PSTACK_BLKD_X) and (@MODCLASS = 'MEMORY_UNIT'))])"/>      
1935                 
1936                 <xsl:variable name="mp_stack_h_">
1937                         <xsl:call-template name="_calc_MultiProc_Stack_Height">
1938                                 <xsl:with-param name="mpstack_blkd_x" select="(@PSTACK_BLKD_X)"/>
1939                         </xsl:call-template>
1940                 </xsl:variable>
1941                 
1942                 <xsl:variable name="sbus_bc_y_"                            select="($SharedBus_Y + (@BUSINDEX * $SBS_LANE_H))"/>
1943                 <xsl:variable name="mp_stack_y_"                           select="($SharedBus_Y - ($PROC2SBS_GAP + $Max_Proc_H + $Max_Proc_PerisAbvSbs_H + $mp_stack_h_))"/>
1944
1945                 <xsl:variable name="mp_stack_gaps_right_"      select="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@PSTACK_BLKD_X = @PSTACK_BLKD_X)]/@GAPS_X           * $MOD_SHAPES_G)"/>
1946                 <xsl:variable name="mp_stack_mods_right_"      select="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@PSTACK_BLKD_X = @PSTACK_BLKD_X)]/@MODS_X      * $periMOD_W)"/>
1947                 <xsl:variable name="mp_stack_lanes_right_"     select="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@PSTACK_BLKD_X = @PSTACK_BLKD_X)]/@BUS_LANES_X * $BUS_LANE_W)"/>
1948                 <xsl:variable name="mp_stack_bkt_lanes_right_" select="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@PSTACK_BLKD_X = @PSTACK_BLKD_X)]/@BKT_LANES_X * $MOD_BKTLANE_W)"/>
1949                 <xsl:variable name="mp_stack_bkt_gaps_right_"  select="(/EDKSYSTEM/BLKDSHAPES/CMPLXSHAPES/CMPLXSHAPE[(@PSTACK_BLKD_X = @PSTACK_BLKD_X)]/@BKT_GAPS_X  * $MOD_BUCKET_G)"/>
1950                 <xsl:variable name="mp_stack_x_"               select="($Inner_X + $mp_stack_gaps_right_ +  $mp_stack_mods_right_ + $mp_stack_bkt_lanes_right_ + $mp_stack_bkt_gaps_right_ + $mp_stack_lanes_right_)"/>
1951                 
1952                 <xsl:variable name="mp_stack_w_">
1953                         <xsl:if test="($mp_stack_numMemus_ &gt; 0)">
1954                                 <xsl:value-of select="($periMOD_W * 2)"/>
1955                         </xsl:if>
1956                         <xsl:if test="not($mp_stack_numMemus_ &gt; 0)">
1957                                 <xsl:value-of select="$periMOD_W"/>
1958                         </xsl:if>
1959                 </xsl:variable>
1960                 
1961                 <xsl:variable name="mp_busLaneWestW_">
1962                         <xsl:if test="(../../BUSCONNS[@ORIENTED = 'WEST'])">
1963                                 <xsl:value-of select="((../../BUSCONNS[@ORIENTED ='WEST']/@BUSLANE_W) * $BUS_LANE_W)"/>
1964                         </xsl:if>
1965                         <xsl:if test="not(../../BUSCONNS[@ORIENTED = 'WEST'])">0</xsl:if>
1966                 </xsl:variable>
1967                         
1968                 <xsl:variable name="mp_busLaneEastW_">
1969                         <xsl:if test="(../../BUSCONNS[@ORIENTED = 'EAST'])">
1970                                 <xsl:value-of select="((../../BUSCONNS[@ORIENTED ='EAST']/@BUSLANE_W) * $BUS_LANE_W)"/>
1971                         </xsl:if>
1972                         <xsl:if test="not(../../BUSCONNS[@ORIENTED = 'EAST'])">0</xsl:if>
1973                 </xsl:variable>
1974 <!--            
1975 -->     
1976         
1977                 <xsl:variable name="mp_stack_dx_" >
1978                         
1979                         <xsl:if test="$oriented_= 'WEST'">
1980                                 <xsl:if test="@IS_MEMBIF= 'TRUE'">
1981                                         <xsl:value-of select="(($mp_stack_w_ div 2) + ($periMOD_W - $MOD_LANE_W))"/>
1982                                 </xsl:if>       
1983                                 
1984                                 <xsl:if test="not(@IS_MEMBIF= 'TRUE')">
1985                                         <xsl:value-of select="(($mp_stack_w_ div 2) + (($periMOD_W div 2) - $MOD_LANE_W))"/>
1986                                 </xsl:if>       
1987                         </xsl:if>
1988                         
1989                         <xsl:if test="$oriented_= 'EAST'">
1990                                 <xsl:if test="@IS_MEMBIF= 'TRUE'">
1991                                         <xsl:value-of select="(($mp_stack_w_ div 2) - ($periMOD_W - $MOD_LANE_W))"/>
1992                                 </xsl:if>       
1993                                 
1994                                 <xsl:if test="not(@IS_MEMBIF= 'TRUE')">
1995                                         <xsl:value-of select="(($mp_stack_w_ div 2) - (($periMOD_W div 2) - $MOD_LANE_W))"/>
1996                                 </xsl:if>       
1997                         </xsl:if>       
1998                         
1999                 </xsl:variable>  
2000                 
2001                 <xsl:variable name="mp_stack_mod_h_">
2002                         <xsl:call-template name="_calc_CStackShapesAbv_Height">
2003                                 <xsl:with-param name="cstkIndex"  select="@CSTACK_INDEX"/>
2004                                 <xsl:with-param name="cstkMods_Y" select="@CSTACK_MODS_Y"/>
2005                         </xsl:call-template>    
2006                 </xsl:variable>
2007                 
2008                 <xsl:variable name="mp_stack_mod_y_" select="$mp_stack_y_ + $mp_stack_mod_h_"/>
2009                 
2010                 <xsl:variable name="mp_stack_mod_dy_" >
2011                         <xsl:if test="not(@IS_MEMBIF)">
2012                                 <xsl:value-of select="($MOD_LANE_H + $MOD_LABEL_H + $MOD_BIF_GAP_V + (@BIF_Y * ($BIF_H + $MOD_BIF_GAP_V)) + ceiling($BIF_H div 2))"/>
2013                         </xsl:if>
2014                                 
2015                         <xsl:if test="@IS_MEMBIF">
2016                                 <xsl:value-of select="($periMOD_H +  $MOD_LANE_H + ceiling($BIF_H div 2))"/>
2017                         </xsl:if>
2018                 </xsl:variable>  
2019                 
2020                 <xsl:variable name="mp_sbs_bc_x_" >
2021                         <xsl:if test="$oriented_= 'EAST'">
2022                                 <xsl:value-of select="($mp_proc_x_ + $mp_busLaneWestW_ + $mp_proc_stack_w_ + ((@BUSLANE_X + 1) * $BUS_LANE_W))"/>
2023                         </xsl:if>       
2024                                 
2025                         <xsl:if test="$oriented_= 'WEST'">
2026                                 <xsl:value-of select="($mp_proc_x_ + $mp_busLaneWestW_ + - ((@BUSLANE_X + 1) * $BUS_LANE_W))"/>
2027                         </xsl:if>       
2028                 </xsl:variable>  
2029                 
2030                 <use   x="{$mp_sbs_bc_x_ - ceiling($BIFC_W div 2)}"    
2031                        y="{$sbus_bc_y_         - ceiling($BIFC_H div 2) + ($BUS_ARROW_G * 2)}"   
2032                        xlink:href="#{@BUSSTD}_busconn_{@BIFRANK}"/>
2033                 
2034                 <!-- Horizontal line out from module -->                
2035                 <xsl:choose>
2036                         <xsl:when test="$oriented_ = 'EAST'">
2037                                 <line x1="{$mp_sbs_bc_x_}" 
2038                                   y1="{$mp_stack_mod_y_  + $mp_stack_mod_dy_}" 
2039                                   x2="{$mp_stack_x_ + $MOD_LANE_W}" 
2040                                   y2="{$mp_stack_mod_y_  + $mp_stack_mod_dy_}" 
2041                                           style="stroke:{$busColor_};stroke-width:1"/>
2042                         </xsl:when>
2043                         <xsl:otherwise>
2044                                 <line x1="{$mp_sbs_bc_x_}" 
2045                                   y1="{$mp_stack_mod_y_  + $mp_stack_mod_dy_}" 
2046                                   x2="{$mp_stack_x_ + $MOD_LANE_W}" 
2047                                   y2="{$mp_stack_mod_y_  + $mp_stack_mod_dy_}" 
2048                                           style="stroke:{$busColor_};stroke-width:1"/>
2049                         </xsl:otherwise>                
2050                 </xsl:choose>
2051                           
2052                 <!-- Vertical line down to shared bus -->               
2053                 <line x1="{$mp_sbs_bc_x_}" 
2054                           y1="{$mp_stack_mod_y_  + $mp_stack_mod_dy_}" 
2055                           x2="{$mp_sbs_bc_x_}" 
2056                           y2="{$sbus_bc_y_ + ceiling($BIFC_H div 2)}" 
2057                           style="stroke:{$busColor_};stroke-width:1"/>
2058                           
2059 <!--                      
2060                 <xsl:message>==============================================</xsl:message>
2061                 <xsl:message>Busname <xsl:value-of select="$busName_"/></xsl:message>
2062                 <xsl:message>====<xsl:value-of select="$mp_stack_h_"/></xsl:message>
2063                 <xsl:message>====<xsl:value-of select="$mp_proc_y_"/></xsl:message>
2064                 <xsl:message>====<xsl:value-of select="$mp_stack_y_"/></xsl:message>
2065                 <xsl:message>====<xsl:value-of select="$mp_stack_mod_begX_"/></xsl:message>
2066                 <xsl:message>====<xsl:value-of select="$mp_stack_mod_endX_"/></xsl:message>
2067                 <xsl:message>====<xsl:value-of select="$mp_stack_mod_y_"/></xsl:message>
2068                 <xsl:message>====<xsl:value-of select="$mp_stack_mod_dy_"/></xsl:message>
2069                 <xsl:message>=============================================</xsl:message>
2070 -->
2071                               
2072         </xsl:for-each>         
2073         
2074 </xsl:template>
2075         
2076         
2077 <xsl:template name="Draw_BlkDiagram_Key">
2078         <xsl:param name="blkd_w"     select="820"/>
2079         <xsl:param name="blkd_h"     select="520"/>
2080         <xsl:param name="drawarea_w" select="800"/>
2081         <xsl:param name="drawarea_h" select="500"/>
2082         <use   x="{ceiling($blkd_w div 2) - ceiling($BLKD_KEY_W div 2)}"   y="0"  xlink:href="#BlkDiagram_Key"/> 
2083 </xsl:template>
2084
2085 <xsl:template name="Define_BlkDiagram_Key">
2086         
2087         <xsl:variable name="key_col_">
2088                 <xsl:call-template name="BusType2Color">
2089                         <xsl:with-param name="busType" select="'KEY'"/>
2090                 </xsl:call-template>    
2091         </xsl:variable>
2092         
2093         <xsl:variable name="key_lt_col_">
2094                 <xsl:call-template name="BusType2LightColor">
2095                         <xsl:with-param name="busType" select="'KEY'"/>
2096                 </xsl:call-template>    
2097         </xsl:variable>
2098         
2099         <symbol id="KEY_IntrCntrl">
2100                 <rect  
2101                         x="0"
2102                         y="0"
2103                         rx="3"
2104                         ry="3"
2105                         width= "{ceiling($INTR_W div 2)}" 
2106                         height="{$INTR_H}" style="fill:{$key_lt_col_}; stroke:none; stroke-width:1"/> 
2107                         
2108                 <line x1="0" 
2109                           y1="{ceiling($INTR_H div 4)}"
2110                           x2="{ceiling($INTR_W div 2)}" 
2111                           y2="{ceiling($INTR_H div 4)}" 
2112                           style="stroke:{$COL_BLACK};stroke-width:2"/>
2113                           
2114                 <text class="intrsymbol" 
2115                           x="1.5"
2116                           y="{7 + ceiling($INTR_H div 2)}">x</text>
2117                         
2118         </symbol>
2119                 
2120         <symbol id="KEY_IntrdProc">
2121                 <rect  
2122                         x="0"
2123                         y="0"
2124                         rx="3"
2125                         ry="3"
2126                         width= "{ceiling($INTR_W div 2)}" 
2127                         height="{$INTR_H}" style="fill:{$key_lt_col_}; stroke:none; stroke-width:1"/> 
2128                         
2129                 <line x1="0" 
2130                           y1="{ceiling($INTR_H div 4) - 2}"
2131                           x2="{ceiling($INTR_W div 2)}" 
2132                           y2="{ceiling($INTR_H div 4) - 2}" 
2133                           style="stroke:{$COL_BLACK};stroke-width:1"/>
2134                           
2135                 <line x1="0" 
2136                           y1="{ceiling($INTR_H div 4) + 2}"
2137                           x2="{ceiling($INTR_W div 2)}" 
2138                           y2="{ceiling($INTR_H div 4) + 2}" 
2139                           style="stroke:{$COL_BLACK};stroke-width:1"/>
2140                           
2141                 <text class="intrsymbol" 
2142                           x="1.5"
2143                           y="{7 + ceiling($INTR_H div 2)}">x</text>
2144         </symbol>
2145         
2146         <symbol id="KEY_IntrSrc">
2147                 <rect  
2148                         x="0"
2149                         y="0"
2150                         rx="3"
2151                         ry="3"
2152                         width= "{$INTR_W}" 
2153                         height="{ceiling($INTR_H div 2)}" style="fill:{$key_lt_col_}; stroke:none; stroke-width:1"/> 
2154                         
2155                 <line x1="{ceiling($INTR_W div 2)}" 
2156                           y1="0"
2157                           x2="{ceiling($INTR_W div 2)}" 
2158                           y2="{ceiling($INTR_H div 2)}" 
2159                           style="stroke:{$COL_BLACK};stroke-width:1"/>
2160                           
2161                 <text class="intrsymbol" 
2162                           x="2"
2163                           y="7">y</text>
2164                         
2165                 <text class="intrsymbol" 
2166                           x="{2 + ceiling($INTR_W div 2)}"
2167                           y="7">x</text>
2168         </symbol>
2169         
2170         
2171         <symbol id="BlkDiagram_Key">
2172                 <rect 
2173               x="0"
2174                           y="0"
2175                       width= "{$BLKD_KEY_W}"
2176                       height="{$BLKD_KEY_H}"
2177                           style="fill:{$COL_BG}; stroke:none;"/>                
2178                           
2179                 <rect 
2180               x="0"
2181                           y="0"
2182                       width= "{$BLKD_KEY_W}"
2183                       height="16"
2184                           style="fill:{$COL_BG}; stroke:none;"/>                
2185                           
2186                 <text class="keytitle"
2187               x="{ceiling($BLKD_KEY_W div 2)} "
2188                           y="14">KEY</text>               
2189                           
2190                 <rect 
2191               x="0"
2192                           y="16"
2193                       width= "{$BLKD_KEY_W}"
2194                       height="16"
2195                           style="fill:{$COL_BG_LT}; stroke:none;"/>             
2196                           
2197                 <text class="keyheader"
2198               x="{ceiling($BLKD_KEY_W div 2)} "
2199                           y="30">SYMBOLS</text>           
2200                           
2201                 <use  x="32"  y="47"  xlink:href="#KEY_Bif" transform="scale(0.75)"/> 
2202                 <text class="keylabel"
2203               x="12"
2204                           y="60">bus interface</text>             
2205                           
2206                 <use   x="20"  y="68"  xlink:href="#KEY_SharedBus"/> 
2207                 <text class="keylabel"
2208               x="12"
2209                           y="85">shared bus</text>                
2210                           
2211                 <text class="keylblul"
2212               x="110"
2213                           y="47">Bus connections</text>           
2214                           
2215                 <use   x="110"  y="58"  xlink:href="#KEY_busconn_MASTER"/> 
2216                 <text class="keylabel"
2217               x="140"
2218                           y="72">master or initiator</text>               
2219                           
2220                 <use   x="110"  y="{58 + (($BIFC_H  + 4) * 1)}"  xlink:href="#KEY_busconn_SLAVE"/> 
2221                 <text class="keylabel"
2222               x="140"
2223                           y="{72 + (($BIFC_H + 4) * 1)}">slave or target</text>           
2224                           
2225                 <use   x="110"  y="{58 + (($BIFC_H  + 4) * 2)}"  xlink:href="#KEY_busconn_MASTER_SLAVE"/> 
2226                 <text class="keylabel"
2227               x="140"
2228                           y="{72 + (($BIFC_H + 4) * 2)}">master slave</text>              
2229                           
2230                 <use   x="110"  y="{58 + (($BIFC_H  + 4) * 3)}"  xlink:href="#KEY_busconn_MONITOR"/>
2231                 <text class="keylabel"
2232               x="140"
2233                           y="{72 + (($BIFC_H + 4) * 3)}">monitor</text>           
2234                           
2235                 <text class="keylblul"
2236               x="258"
2237                           y="47">External Ports</text>            
2238                 
2239                 <use   x="258"  y="58"  xlink:href="#KEY_INPort"/> 
2240                 <text class="keylabel"
2241               x="288"
2242                           y="72">input</text>             
2243                           
2244                 <use   x="258"  y="{58 + ($IOP_H * 1) + 4}"  xlink:href="#KEY_OUTPort"/> 
2245                 <text class="keylabel"
2246               x="288"
2247                           y="{72 + ($IOP_H * 1) + 4}">output</text>               
2248                           
2249                 <use   x="258" y="{58 + ($IOP_H * 2) + 8}"  xlink:href="#KEY_INOUTPort"/> 
2250                 <text class="keylabel"
2251               x="288"
2252                           y="{72 + ($IOP_H * 2) + 8}">inout</text>                
2253                 
2254                 
2255                 <text class="keylblul"
2256               x="380"
2257                           y="47">Interrupts</text>
2258                 
2259                 <use   x="380"  y="58"  xlink:href="#KEY_IntrCntrl"/> 
2260                 <text class="keylabel"
2261               x="396"
2262                           y="64">interrupt</text>                 
2263                 <text class="keylabel"
2264               x="396"
2265                           y="74">controller</text>                
2266                           
2267                 
2268                 <use   x="380"  y="88"  xlink:href="#KEY_IntrdProc"/> 
2269                 <text class="keylabel"
2270               x="396"
2271                           y="94">interrupted</text>               
2272                 <text class="keylabel"
2273               x="396"
2274                           y="104">processor</text>                
2275                           
2276                 
2277                 <use   x="380"  y="118"  xlink:href="#KEY_IntrSrc"/> 
2278                 <text class="keylabel"
2279               x="400"
2280                           y="124">interrupt</text>                
2281                 <text class="keylabel"
2282               x="400"
2283                           y="134">source</text>           
2284                 
2285                 <text class="keylabel"
2286               x="360"
2287                           y="146">x = controller ID</text>                
2288                 
2289                 <text class="keylabel"
2290               x="360"
2291                           y="156">y = priority</text>             
2292 <!--            
2293                 <text class="keylabel"
2294               x="400"
2295                           y="134">source</text>           
2296         
2297 -->
2298                           
2299                 
2300                 
2301                 
2302                 
2303                 
2304                 <rect 
2305               x="0"
2306                           y="160"
2307                       width= "{$BLKD_KEY_W}"
2308                       height="16"
2309                           style="fill:{$COL_BG_LT}; stroke:none;"/>             
2310                           
2311                 <text class="keyheader"
2312               x="{ceiling($BLKD_KEY_W div 2)} "
2313                           y="172">COLORS</text>           
2314                 
2315                           
2316                 <text class="keylblul"
2317               x="110"
2318                           y="190">Bus Standards</text>            
2319                           
2320                 <xsl:variable name="dcr_col_">
2321                         <xsl:call-template name="BusType2Color">
2322                                 <xsl:with-param name="busType" select="'DCR'"/>
2323                         </xsl:call-template>    
2324                 </xsl:variable>
2325                 
2326                 <rect 
2327               x="{12 + ((12 + $BIFC_W + 36) * 0)}"
2328                           y="200"
2329                       width= "{$BIFC_H}"
2330                       height="{$BIFC_W}"
2331                           style="fill:{$dcr_col_}; stroke:none;"/>              
2332                 <text class="keylabel"
2333               x="{12 + $BIFC_W + 4}"
2334                           y="{200 + (($BIF_H + 4) * 1)}">DCR</text>               
2335                           
2336                 <xsl:variable name="fcb_col_">
2337                         <xsl:call-template name="BusType2Color">
2338                                 <xsl:with-param name="busType" select="'FCB'"/>
2339                         </xsl:call-template>    
2340                 </xsl:variable>
2341                 
2342                 <rect 
2343               x="{12 + ((12 + $BIFC_W + 36) * 0)}"
2344                           y="{200 + (($BIFC_H + 4) * 1)}"
2345                       width= "{$BIFC_H}"
2346                       height="{$BIFC_W}"
2347                           style="fill:{$fcb_col_}; stroke:none;"/>              
2348                 <text class="keylabel"
2349               x="{12 + $BIFC_W + 4}"
2350                           y="{200 + (($BIF_H + 4) * 2)}">FCB</text>               
2351                 
2352                 <xsl:variable name="fsl_col_">
2353                         <xsl:call-template name="BusType2Color">
2354                                 <xsl:with-param name="busType" select="'FSL'"/>
2355                         </xsl:call-template>    
2356                 </xsl:variable>
2357                           
2358                 <rect 
2359               x="{12 + ((12 + $BIFC_W + 36) * 1)}"
2360                           y="200"
2361                       width= "{$BIFC_H}"
2362                       height="{$BIFC_W}"
2363                           style="fill:{$fsl_col_}; stroke:none;"/>              
2364                 <text class="keylabel"
2365               x="{12  + ($BIFC_W + 4) + ((12 + $BIFC_W + 36) * 1)}"
2366                           y="{200 + (($BIF_H + 4) * 1)}">FSL</text>               
2367                 
2368                 <xsl:variable name="col_lmb_">
2369                         <xsl:call-template name="BusType2Color">
2370                                 <xsl:with-param name="busType" select="'LMB'"/>
2371                         </xsl:call-template>    
2372                 </xsl:variable>
2373                           
2374                 <rect 
2375               x="{12 + ((12 + $BIFC_W + 36) * 1)}"
2376                           y="{200 + (($BIFC_H + 4) * 1)}"
2377                       width= "{$BIFC_H}"
2378                       height="{$BIFC_W}"
2379                           style="fill:{$col_lmb_}; stroke:none;"/>              
2380                 <text class="keylabel"
2381               x="{12  + ($BIFC_W + 4) + ((12 + $BIFC_W + 36) * 1)}"
2382                           y="{200 + (($BIF_H + 4) * 2)}">LMB</text>               
2383                           
2384                 
2385                 <xsl:variable name="opb_col_">
2386                         <xsl:call-template name="BusType2Color">
2387                                 <xsl:with-param name="busType" select="'OPB'"/>
2388                         </xsl:call-template>    
2389                 </xsl:variable>
2390                           
2391                 <rect 
2392               x="{12 + ((12 + $BIFC_W + 36) * 2)}"
2393                           y="200"
2394                       width= "{$BIFC_H}"
2395                       height="{$BIFC_W}"
2396                           style="fill:{$opb_col_}; stroke:none;"/>              
2397                 <text class="keylabel"
2398               x="{12  + ($BIFC_W + 4) + ((12 + $BIFC_W + 36) * 2)}"
2399                           y="{200 + (($BIF_H + 4) * 1)}">OPB</text>               
2400                 
2401                 <xsl:variable name="plb_col_">
2402                         <xsl:call-template name="BusType2Color">
2403                                 <xsl:with-param name="busType" select="'PLB'"/>
2404                         </xsl:call-template>    
2405                 </xsl:variable>
2406                 
2407                 <rect 
2408               x="{12 + ((12 + $BIFC_W + 36) * 2)}"
2409                           y="{200 + (($BIFC_H + 4) * 1)}"
2410                       width= "{$BIFC_H}"
2411                       height="{$BIFC_W}"
2412                           style="fill:{$plb_col_}; stroke:none;"/>              
2413                 <text class="keylabel"
2414               x="{12  + ($BIFC_W + 4) + ((12 + $BIFC_W + 36) * 2)}"
2415                           y="{200 + (($BIF_H + 4) * 2)}">PLB</text>               
2416                 
2417                          
2418                 <xsl:variable name="ocm_col_">
2419                         <xsl:call-template name="BusType2Color">
2420                                 <xsl:with-param name="busType" select="'OCM'"/>
2421                         </xsl:call-template>    
2422                 </xsl:variable>
2423                           
2424                 <rect 
2425               x="{12 + ((12 + $BIFC_W + 36) * 3)}"
2426                           y="200"
2427                       width= "{$BIFC_H}"
2428                       height="{$BIFC_W}"
2429                           style="fill:{$ocm_col_}; stroke:none;"/>              
2430                 <text class="keylabel"
2431               x="{12  + ($BIFC_W + 4) + ((12 + $BIFC_W + 36) * 3)}"
2432                           y="{200 + (($BIF_H + 4) * 1)}">SOCM</text>
2433                 
2434                 
2435                 <xsl:variable name="xil_col_">
2436                         <xsl:call-template name="BusType2Color">
2437                                 <xsl:with-param name="busType" select="'XIL'"/>
2438                         </xsl:call-template>    
2439                 </xsl:variable>
2440                           
2441                 <rect 
2442               x="{12 + ((12 + $BIFC_W + 36) * 3)}"
2443                           y="{200 + (($BIFC_H + 4) * 1)}"
2444                       width= "{$BIFC_H}"
2445                       height="{$BIFC_W}"
2446                           style="fill:{$xil_col_}; stroke:none;"/>              
2447                 <text class="keylabel"
2448               x="{12  + ($BIFC_W + 4) + ((12 + $BIFC_W + 36) * 3)}"
2449                           y="{200 + (($BIF_H + 4) * 2)}">XIL (prefix) P2P</text>                  
2450                          
2451                           
2452                 <xsl:variable name="trs_col_">
2453                         <xsl:call-template name="BusType2Color">
2454                                 <xsl:with-param name="busType" select="'TRS'"/>
2455                         </xsl:call-template>    
2456                 </xsl:variable>
2457                           
2458                 <rect 
2459               x="{12 + ((12 + $BIFC_W + 36) * 4)}"
2460                           y="200"
2461                       width= "{$BIFC_H}"
2462                       height="{$BIFC_W}"
2463                           style="fill:{$trs_col_}; stroke:none;"/>              
2464                 <text class="keylabel"
2465               x="{12  + ($BIFC_W + 4) + ((12 + $BIFC_W + 36) * 4)}"
2466                           y="{200 + (($BIF_H + 4) * 1)}">GEN. P2P, USER, etc</text>               
2467                           
2468 </symbol>       
2469 </xsl:template>
2470
2471 <xsl:template name="Define_BlkDiagram_Specs">
2472
2473         <xsl:param name="blkd_arch"     select="'NA'"/>
2474         <xsl:param name="blkd_part"     select="'NA'"/>
2475         <xsl:param name="blkd_edkver"   select="'NA'"/>
2476         <xsl:param name="blkd_gentime"  select="'NA'"/>
2477                         
2478         <symbol id="BlkDiagram_Specs">
2479                 <rect 
2480               x="0"
2481                           y="0"
2482                       width= "{$BLKD_SPECS_W}"
2483                       height="{$BLKD_SPECS_H}"
2484                           style="fill:{$COL_BG}; stroke:none;"/>                
2485                           
2486                 <rect 
2487               x="0"
2488                           y="0"
2489                       width= "{$BLKD_SPECS_W}"
2490                       height="16"
2491                           style="fill:{$COL_BG}; stroke:none;"/>                
2492                           
2493                 <text class="keytitle"
2494               x="{ceiling($BLKD_SPECS_W div 2)} "
2495                           y="14">SPECS</text>
2496                           
2497                 <rect 
2498               x="0"
2499                           y="20"
2500                       width= "{$BLKD_SPECS_W}"
2501                       height="16"
2502                           style="fill:{$COL_BG_LT}; stroke:none;"/>             
2503                           
2504                 <text class="specsheader"
2505               x="4"
2506                           y="32">EDK VERSION</text>
2507                           
2508 <!--            
2509                 <text class="specsvalue"
2510               x="{($BLKD_SPECS_W + 1) - (string-length($blkd_edkver) * 6.5)}"
2511                           y="32"><xsl:value-of select="$blkd_edkver"/></text>
2512 -->             
2513                 <text class="specsvaluemid"
2514               x="{($BLKD_SPECS_W + 1) - ceiling($BLKD_SPECS_W div 5)}"
2515                           y="32"><xsl:value-of select="$blkd_edkver"/></text>
2516                           
2517                 <rect 
2518               x="0"
2519                           y="40"
2520                       width= "{$BLKD_SPECS_W}"
2521                       height="16"
2522                           style="fill:{$COL_BG_LT}; stroke:none;"/>             
2523                           
2524                 <text class="specsheader"
2525               x="4"
2526                           y="52">ARCH</text>
2527                           
2528 <!--            
2529                 <text class="specsvalue"
2530               x="{($BLKD_SPECS_W + 1) - (string-length($blkd_arch) * 6.5)}"
2531                           y="52"><xsl:value-of select="$blkd_arch"/></text>
2532 -->             
2533                 <text class="specsvaluemid"
2534               x="{($BLKD_SPECS_W + 1) - ceiling($BLKD_SPECS_W div 5)}"
2535                           y="52"><xsl:value-of select="$blkd_arch"/></text>
2536                           
2537                 <rect 
2538               x="0"
2539                           y="60"
2540                       width= "{$BLKD_SPECS_W}"
2541                       height="16"
2542                           style="fill:{$COL_BG_LT}; stroke:none;"/>             
2543                           
2544                 <text class="specsheader"
2545               x="4"
2546                           y="72">PART</text>
2547                           
2548 <!--            
2549                 <text class="specsvalue"
2550               x="{($BLKD_SPECS_W  + 1) - ((string-length($blkd_part) + 2) * 6.5)}"
2551                           y="72"><xsl:value-of select="$blkd_part"/></text>
2552 -->             
2553                 <text class="specsvaluemid"
2554               x="{($BLKD_SPECS_W + 1) - ceiling($BLKD_SPECS_W div 5)}"
2555                           y="72"><xsl:value-of select="$blkd_part"/></text>
2556                           
2557                 <rect 
2558               x="0"
2559                           y="80"
2560                       width= "{$BLKD_SPECS_W}"
2561                       height="16"
2562                           style="fill:{$COL_BG_LT}; stroke:none;"/>             
2563                           
2564                 <text class="specsheader"
2565               x="4"
2566                           y="92">GENERATED</text>
2567                           
2568                 <text class="specsvalue"
2569               x="{($BLKD_SPECS_W  + 1) - (string-length($blkd_gentime) * 6.5)}"
2570                           y="92"><xsl:value-of select="$blkd_gentime"/></text>
2571                           
2572                           
2573         </symbol>       
2574 </xsl:template>
2575         
2576
2577 <xsl:template name="Draw_BlkdShapes_old">
2578         <xsl:param name="blkd_w"     select="820"/>
2579         <xsl:param name="blkd_h"     select="520"/>
2580         <xsl:param name="drawarea_w" select="800"/>
2581         <xsl:param name="drawarea_h" select="500"/>
2582         
2583         <xsl:variable name="inner_X_" select="($BLKD_PRTCHAN_W  + $BLKD_IORCHAN_W + $BLKD_INNER_GAP)"/>
2584         <xsl:variable name="inner_Y_" select="($BLKD_PRTCHAN_H  + $BLKD_IORCHAN_H + $BLKD_INNER_GAP)"/>
2585         
2586 <!--    
2587         <xsl:message>Number mods above procs <xsl:value-of  select="$lmt_modsAbvProcsH_"/></xsl:message>
2588         <xsl:message>Number memus above procs <xsl:value-of select="$lmt_memusAbvProcsH_"/></xsl:message>
2589 -->     
2590
2591         <xsl:variable name="max_Proc_h_">
2592                 <xsl:call-template name="_calc_Max_Proc_Height"/>
2593         </xsl:variable>
2594         
2595         <xsl:variable name="max_Proc_PerisAbvSbs_h_">
2596                 <xsl:call-template name="_calc_Max_Proc_PerisAbvSbs_Height"/>
2597         </xsl:variable>
2598         
2599         <xsl:variable name="max_Proc_PerisBlwSbs_h_">
2600                 <xsl:call-template name="_calc_Max_Proc_PerisBlwSbs_Height"/>
2601         </xsl:variable>
2602         
2603         <xsl:variable name="max_MultiProc_Stack_h_">
2604                 <xsl:call-template name="_calc_Max_MultiProc_Stack_Height"/>
2605         </xsl:variable>
2606         
2607         <xsl:variable name="max_SbsBuckets_h_">
2608                 <xsl:call-template name="_calc_Max_SbsBuckets_Height"/>         
2609         </xsl:variable>
2610         
2611         
2612 <!--    
2613         <xsl:variable name="lmt_slvs_h_"  select="($lmt_slvsabv_sbs_h_  * ( $periMOD_H      + $BIF_H))"/>
2614 -->     
2615         
2616         <xsl:variable name="numSbs_"    select="count(BLKDSHAPES/SBSSHAPES/MODULE)"/>                   
2617         <xsl:variable name="numProcs_"  select="count(BLKDSHAPES/PROCSHAPES/MODULE)"/>                  
2618 <!--    
2619         
2620         <xsl:message>inner y  <xsl:value-of select="$inner_Y_"/></xsl:message>
2621         <xsl:message>max_proc  <xsl:value-of select="$max_proc_h_"/></xsl:message>
2622         <xsl:message>max_multiprocstack <xsl:value-of select="$max_MultiProc_Stack_h_"/></xsl:message>
2623         <xsl:message>max_proc_perisabvsbs_h_ <xsl:value-of select="$max_Proc_PerisAbvSbs_h_"/></xsl:message>
2624 -->     
2625         <xsl:variable name="sbs_h_"     select="($numSbs_  * $SBS_LANE_H)"/>
2626         <xsl:variable name="sbs_y_"     select="($inner_Y_ + $max_MultiProc_Stack_h_ + $max_Proc_h_ + $max_Proc_PerisAbvSbs_h_  + $PROC2SBS_GAP)"/>
2627         
2628 <!-- Draw the Bridges -->       
2629         <xsl:call-template name="Draw_BlkDiagram_Bridges">
2630                 <xsl:with-param name="Inner_X"      select="$inner_X_"/>
2631                 <xsl:with-param name="SharedBus_Y"  select="$sbs_y_"/>
2632         </xsl:call-template>    
2633         
2634 <!-- Draw the Processors -->    
2635         <xsl:call-template name="Draw_BlkDiagram_Processors">
2636                 <xsl:with-param name="Inner_X"                 select="$inner_X_"/>
2637                 <xsl:with-param name="SharedBus_Y"                 select="$sbs_y_"/>
2638                 <xsl:with-param name="Max_Proc_H"              select="$max_Proc_h_"/>
2639             <xsl:with-param name="Max_Proc_PerisAbvSbs_H"  select="$max_Proc_PerisAbvSbs_h_"/>
2640             <xsl:with-param name="Max_Proc_PerisBlwSbs_H"  select="$max_Proc_PerisBlwSbs_h_"/>
2641         </xsl:call-template>    
2642         
2643 <!-- Draw the Complex stacks, (collections of more than one module that are not memory and not connected to a processor) -->    
2644         <xsl:call-template name="Draw_BlkDiagram_ComplexStacks">
2645                 <xsl:with-param name="Inner_X"                 select="$inner_X_"/>
2646                 <xsl:with-param name="SharedBus_Y"                 select="$sbs_y_"/>
2647                 <xsl:with-param name="Max_Proc_H"              select="$max_Proc_h_"/>
2648             <xsl:with-param name="Max_Proc_PerisAbvSbs_H"  select="$max_Proc_PerisAbvSbs_h_"/>
2649             <xsl:with-param name="Max_Proc_PerisBlwSbs_H"  select="$max_Proc_PerisBlwSbs_h_"/>
2650         </xsl:call-template>    
2651         
2652 <!-- Draw the Complex Modules, (Modules that are not memory and not connected to a processor) -->       
2653         <xsl:call-template name="Draw_BlkDiagram_ComplexModules">
2654                 <xsl:with-param name="Inner_X"                 select="$inner_X_"/>
2655                 <xsl:with-param name="SharedBus_Y"                 select="$sbs_y_"/>
2656                 <xsl:with-param name="SharedBus_H"                 select="$sbs_h_"/>
2657         </xsl:call-template>    
2658
2659
2660 <!-- Draw the shared bus buckets -->    
2661         <xsl:call-template name="Draw_BlkDiagram_SharedBusBuckets">
2662                 <xsl:with-param name="Inner_X"                 select="$inner_X_"/>
2663                 <xsl:with-param name="SharedBus_Y"                 select="$sbs_y_"/>
2664                 <xsl:with-param name="SharedBus_H"                 select="$sbs_h_"/>
2665         </xsl:call-template>    
2666         
2667 <!-- Draw the IP bucket -->     
2668         <xsl:call-template name="Draw_BlkDiagram_IPBucket">
2669                 <xsl:with-param name="Blkd_W"                  select="$blkd_w"/>
2670                 <xsl:with-param name="Inner_X"                 select="$inner_X_"/>
2671                 <xsl:with-param name="SharedBus_Y"                 select="$sbs_y_"/>
2672                 <xsl:with-param name="SharedBus_H"                 select="$sbs_h_"/>
2673                 <xsl:with-param name="Max_Proc_H"              select="$max_Proc_h_"/>
2674             <xsl:with-param name="Max_Proc_PerisAbvSbs_H"  select="$max_Proc_PerisAbvSbs_h_"/>
2675             <xsl:with-param name="Max_Proc_PerisBlwSbs_H"  select="$max_Proc_PerisBlwSbs_h_"/>
2676             <xsl:with-param name="Max_SbsBuckets_H"        select="$max_SbsBuckets_h_"/>
2677         </xsl:call-template>    
2678         
2679 <!-- Draw bucket for floating modules, modules not connected to a shared bus or a processor --> 
2680         <xsl:call-template name="Draw_BlkDiagram_FloatingModsBucket">
2681                 <xsl:with-param name="Blkd_W"                  select="$blkd_w"/>
2682                 <xsl:with-param name="Inner_X"                 select="$inner_X_"/>
2683                 <xsl:with-param name="SharedBus_Y"                 select="$sbs_y_"/>
2684                 <xsl:with-param name="SharedBus_H"                 select="$sbs_h_"/>
2685                 <xsl:with-param name="Max_Proc_H"              select="$max_Proc_h_"/>
2686             <xsl:with-param name="Max_Proc_PerisAbvSbs_H"  select="$max_Proc_PerisAbvSbs_h_"/>
2687             <xsl:with-param name="Max_Proc_PerisBlwSbs_H"  select="$max_Proc_PerisBlwSbs_h_"/>
2688             <xsl:with-param name="Max_SbsBuckets_H"        select="$max_SbsBuckets_h_"/>
2689         </xsl:call-template>    
2690         
2691 <!-- Draw processor to processor connections -->        
2692         <xsl:call-template name="Draw_BlkDiagram_Proc2ProcConnections">
2693                 <xsl:with-param name="Inner_X"                 select="$inner_X_"/>
2694                 <xsl:with-param name="SharedBus_Y"                 select="$sbs_y_"/>
2695                 <xsl:with-param name="SharedBus_H"                 select="$sbs_h_"/>
2696                 <xsl:with-param name="Max_Proc_H"              select="$max_Proc_h_"/>
2697             <xsl:with-param name="Max_Proc_PerisAbvSbs_H"  select="$max_Proc_PerisAbvSbs_h_"/>
2698             <xsl:with-param name="Max_Proc_PerisBlwSbs_H"  select="$max_Proc_PerisBlwSbs_h_"/>
2699             <xsl:with-param name="Max_SbsBuckets_H"        select="$max_SbsBuckets_h_"/>
2700         </xsl:call-template>    
2701         
2702 <!-- Draw multi processor connections -->       
2703         <xsl:call-template name="Draw_BlkDiagram_MultiProcConnections">
2704                 <xsl:with-param name="Inner_X"                 select="$inner_X_"/>
2705                 <xsl:with-param name="SharedBus_Y"                 select="$sbs_y_"/>
2706                 <xsl:with-param name="SharedBus_H"                 select="$sbs_h_"/>
2707                 <xsl:with-param name="Max_Proc_H"              select="$max_Proc_h_"/>
2708             <xsl:with-param name="Max_Proc_PerisAbvSbs_H"  select="$max_Proc_PerisAbvSbs_h_"/>
2709             <xsl:with-param name="Max_Proc_PerisBlwSbs_H"  select="$max_Proc_PerisBlwSbs_h_"/>
2710         </xsl:call-template>    
2711         
2712         
2713         <!-- 
2714                  ===========================================================
2715                                                 Draw the shared busses 
2716                  ===========================================================
2717         -->
2718         
2719         
2720         <use   x="{$inner_X_}"    y="{$sbs_y_}"  xlink:href="#group_sharedBusses"/> 
2721         
2722         <!-- ************************************************************ -->   
2723         <!-- Draw the Key -->   
2724         <!-- ************************************************************ -->   
2725         <use   x="{$blkd_w - $BLKD_KEY_W - $BLKD_PRTCHAN_W}"   y="{$blkd_h + $BLKD2KEY_GAP - 8}"  xlink:href="#BlkDiagram_Key"/> 
2726         
2727         <!-- ************************************************************ -->   
2728         <!-- Draw the Specs --> 
2729         <!-- ************************************************************ -->   
2730         <use   x="{$BLKD_PRTCHAN_W}"                           y="{$blkd_h + $BLKD2KEY_GAP - 8}"  xlink:href="#BlkDiagram_Specs"/> 
2731         
2732 <!--    
2733         <use   x="{$blkd_w - $BLKD_KEY_W - $BLKD_PRTCHAN_W}"   y="{$blkd_h + $BLKD2KEY_GAP - 16}"  xlink:href="#symbol_extportstable"/> 
2734 -->     
2735         <!-- ************************************************************ -->   
2736         <!-- ***************  DONE DRAWING BLOCK DIAGRAM   ************** -->
2737         <!-- ************************************************************ -->   
2738         
2739 </xsl:template>
2740         
2741
2742 </xsl:stylesheet>
2743
2744 <!-- =========================================================================== -->
2745 <!--                          FUNCTION TEMPLATE                                  -->
2746 <!--                                                                                                                                                     -->
2747 <!-- =========================================================================== -->