]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/MicroBlaze_Spartan-6_EthernetLite/PlatformStudioProject/__xps/.dswkshop/MdtTinySvgBLKD_Main.xsl
Add FreeRTOS-Plus directory.
[freertos] / FreeRTOS / Demo / MicroBlaze_Spartan-6_EthernetLite / PlatformStudioProject / __xps / .dswkshop / MdtTinySvgBLKD_Main.xsl
1 <?xml version="1.0" standalone="no"?>
2
3 <xsl:stylesheet version="1.0"
4            xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5        xmlns:exsl="http://exslt.org/common"
6        xmlns:dyn="http://exslt.org/dynamic"
7        xmlns:math="http://exslt.org/math"
8        xmlns:xlink="http://www.w3.org/1999/xlink"
9        extension-element-prefixes="math dyn exsl xlink">
10            
11                    
12 <!-- 
13       xmlns:svg="http://www.w3.org/2000/svg"
14         ===============================================
15                                 INCLUDES
16         ===============================================
17  -->    
18 <xsl:include href="MdtSvgBLKD_Dimensions.xsl"/>
19
20 <xsl:include href="MdtSvgDiag_Colors.xsl"/>
21 <xsl:include href="MdtSvgDiag_Globals.xsl"/>
22 <xsl:include href="MdtSvgDiag_StyleDefs.xsl"/>
23
24 <xsl:include href="MdtTinySvgDiag_BifShapes.xsl"/>
25
26 <xsl:include href="MdtTinySvgBLKD_IOPorts.xsl"/>
27 <xsl:include href="MdtTinySvgBLKD_Busses.xsl"/>
28 <xsl:include href="MdtTinySvgBLKD_Globals.xsl"/>
29 <xsl:include href="MdtTinySvgBLKD_Functions.xsl"/>
30 <xsl:include href="MdtTinySvgBLKD_Peripherals.xsl"/>
31 <xsl:include href="MdtTinySvgBLKD_Processors.xsl"/>
32 <xsl:include href="MdtTinySvgBLKD_BusLaneSpaces.xsl"/>
33         
34 <xsl:output method="xml" 
35                     version="1.0" 
36                     indent="yes"
37                     encoding="UTF-8" 
38                 doctype-public="-//W3C//DTD SVG 1.1//EN"
39                     doctype-system="http://www.w3.org/Graphics/SVG/1.1/svg11-tiny.dtd"/>
40         
41 <!-- 
42         ===============================================
43                                 PARAMETERS
44         ===============================================
45  -->    
46  
47 <xsl:param    name="ADD_VIEWBOX"   select="'FALSE'"/>              
48 <xsl:param    name="IN_TESTMODE"   select="'FALSE'"/>
49
50
51 <!-- 
52 <xsl:param    name="CSS_SVG_DIAGRAMS"   select="'MdtSvgDiag_StyleDefs.css'"/>
53 <xsl:param    name="CSS_SVG_DIAGRAMS"   select="'__INTERNAL__'"/>
54  -->
55                 
56 <!-- 
57         ====================================================== 
58                                 MAIN BLOCKDIAGRAM TEMPLATE      
59         ====================================================== 
60 -->
61 <xsl:template match="EDKSYSTEM[not(BLKDIAGRAM)]">
62         <xsl:message>ERROT: Project is missing BLKDIAGRAM Element. Cannot generate.</xsl:message>
63 </xsl:template>
64
65 <xsl:template match="EDKSYSTEM[BLKDIAGRAM]">
66         
67 <!--
68 <xsl:message>STCK_W is <xsl:value-of select="$G_Total_Stacks_W"/></xsl:message>
69 <xsl:message>BRDG_W is <xsl:value-of select="$G_Total_Bridges_W"/></xsl:message>
70 <xsl:message>MPMC is <xsl:value-of select="$G_Total_StandAloneMpmc_H"/></xsl:message>
71 <xsl:message>MPMC is <xsl:value-of select="$G_Total_StandAloneMpmc_H"/></xsl:message>
72 <xsl:message>MABV is <xsl:value-of select="$G_Max_Stack_AbvSbs_H"/></xsl:message>
73 <xsl:message>MBLW is <xsl:value-of select="$G_Max_Stack_BlwSbs_H"/></xsl:message>
74 <xsl:message>IPBK is <xsl:value-of select="$G_Total_IpBucket_H"/></xsl:message>
75 <xsl:message>Blkd Total is <xsl:value-of select="$blkd_H_"/></xsl:message>
76 <xsl:message>max abv is <xsl:value-of select="$max_Stack_AbvSbs_H_"/></xsl:message>
77 <xsl:message>max blw is <xsl:value-of select="$max_Stack_BlwSbs_H_"/></xsl:message>
78 <xsl:message>Ip Bkt is <xsl:value-of select="$totalIpBkt_H_"/></xsl:message>
79 <xsl:message>Sbs is <xsl:value-of select="$totalSbs_H_"/></xsl:message>
80 <xsl:message>Unk Bkt is <xsl:value-of select="$totalUnkBkt_H_"/></xsl:message>
81 <xsl:message>Blkd DrawArea height as <xsl:value-of select="$total_DrawArea_H_"/></xsl:message>
82 -->
83
84 <!--specify a css for the file -->
85 <!-- 
86 <xsl:processing-instruction name="xml-stylesheet">href="<xsl:value-of select="$CSS_SVG_DIAGRAMS"/>" type="text/css"</xsl:processing-instruction>
87 <xsl:variable name="BLKD_ZOOM_Y">
88         <xsl:choose>
89                 <xsl:when test="($ADD_VIEWBOX = 'TRUE')">
90                         <xsl:value-of select="($G_Total_Diag_H * 2)"/>
91                 </xsl:when>
92                 <xsl:otherwise>0</xsl:otherwise>                
93         </xsl:choose>
94 </xsl:variable>
95 <xsl:message>EDWVERSION is <xsl:value-of select="$G_ROOT/EDKSYSTEM/@EDWVERSION"/></xsl:message>
96  -->
97         
98 <xsl:text>&#10;</xsl:text>
99 <!--
100 <svg width="{$G_Total_Diag_W}" height="{$G_Total_Diag_H}" viewBox="0 0 0 {$BLKD_ZOOM_Y}">       
101 -->
102 <svg width="{$G_Total_Diag_W}" height="{$G_Total_Diag_H}">
103 <!-- 
104          =============================================== 
105                Layout All the various definitions       
106          =============================================== 
107 -->
108         <defs>
109                 
110                 <!-- IO Port Defs -->
111                 <xsl:call-template name="Define_IOPorts"/>              
112                 
113                 <!-- BIF Defs -->
114                 <xsl:call-template name="Define_ConnectedBifTypes"/>            
115                 
116                 <!-- Bus Defs -->
117                 <xsl:call-template name="Define_Busses"/>               
118                 
119                 <!-- Shared Bus Buckets Defs -->
120                 <xsl:call-template name="Define_SBSBuckets"/>           
121                 
122                 <!-- IP Bucket Defs -->
123                 <xsl:call-template name="Define_IPBucket"/>             
124                 
125                 <!-- Stack Defs -->
126                 <xsl:call-template name="Define_AllStacks"/>            
127                 
128                 <!-- Space Defs -->
129                 <xsl:call-template name="Define_BusLaneSpaces"/>                
130                 
131                 <!-- Main MPMC Defs -->
132                 <xsl:if test="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/MPMCSHAPE">
133                         <xsl:call-template name="Define_StandAlone_MPMC"/>      
134                 </xsl:if>
135                 
136                 <!-- Diagram Key Definition -->
137                 <xsl:call-template name="Define_BlkDiagram_Key"/>               
138                 
139                 <!-- Diagram Specs Definition -->
140                 <xsl:call-template name="Define_BlkDiagram_Specs">              
141                         <xsl:with-param name="iArch"       select="SYSTEMINFO/@ARCH"/>
142                         <xsl:with-param name="iPart"       select="SYSTEMINFO/@PART"/>
143                         <xsl:with-param name="iTimeStamp"  select="@TIMESTAMP"/>
144                         <xsl:with-param name="iEdkVersion" select="@EDKVERSION"/>
145                 </xsl:call-template>            
146                 
147         </defs>
148         
149 <!-- =============================================== -->
150 <!--             Draw Outlines                       -->
151 <!-- =============================================== -->
152         
153          <!-- The surrounding black liner -->
154      <rect x="0"  
155                    y="0" 
156                    width ="{$G_Total_Diag_W}"
157                    height="{$G_Total_Diag_H}" 
158                    fill="{$COL_WHITE}" 
159                    stroke="{$COL_BLACK}"
160                    stroke-width="4"/>
161                    
162          <!-- The outer IO channel -->
163      <rect x="{$BLKD_PRTCHAN_W}"  
164                    y="{$BLKD_PRTCHAN_H}" 
165                    width= "{$G_Total_Blkd_W - ($BLKD_PRTCHAN_W * 2)}" 
166                    height="{$G_Total_Blkd_H - ($BLKD_PRTCHAN_H * 2)}" style="fill:{$COL_IORING}"/>
167                    
168          <!-- The Diagram's drawing area -->
169      <rect x="{$BLKD_PRTCHAN_W + $BLKD_IORCHAN_W}"  
170                    y="{$BLKD_PRTCHAN_H + $BLKD_IORCHAN_H}" 
171                    rx="8" 
172                    ry="8" 
173                    width= "{$G_Total_DrawArea_W}"
174                    height="{$G_Total_DrawArea_H}" 
175                    fill="{$COL_BG}"/>
176                    
177 <!-- =============================================== -->
178 <!--        Draw All the various components          -->
179 <!-- =============================================== -->
180         
181         <!--   Layout the IO Ports    -->       
182 <!-- 
183         <xsl:if test="(not($IN_TESTMODE) or ($IN_TESTMODE = 'FALSE'))">
184                 <xsl:call-template name="Draw_IOPorts"/>        
185         </xsl:if>
186  -->    
187         
188         <!--   Layout the Shapes      -->       
189         <xsl:call-template name="Draw_BlkDiagram_Shapes"/>              
190         
191 </svg>
192         
193 <!-- ======================= END MAIN SVG BLOCK =============================== -->
194 </xsl:template>
195         
196 <xsl:template name="Draw_BlkDiagram_Shapes">
197
198         <!-- 
199                 ************************************************************ 
200                 ***************  BEGIN DRAWING BLOCK DIAGRAM   ************* 
201                 ************************************************************ 
202         -->     
203         
204         <!-- 
205                  ===========================================================
206                                                 Draw the Stand Alone MPMC, (if any)
207          ===========================================================
208         -->
209         <xsl:if test="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/MPMCSHAPE">
210         
211                 <xsl:variable name="mpmc_inst_" select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/MPMCSHAPE/@INSTANCE"/>
212                 
213                 <use   x="{$BLKD_INNER_X}"  y="{$BLKD_INNER_Y}"  xlink:href="#mpmcmodule_{$mpmc_inst_}"/> 
214         <!-- 
215                  ===========================================================
216                                                 Draw the connections to the Stand Alone MPMC
217                  ===========================================================
218         -->
219                 <xsl:call-template name="Draw_BlkDiagram_StandAloneMpmcConnections"/>   
220         </xsl:if>       
221         
222         <!-- 
223                  ===========================================================
224                                                 Draw the Stacks
225                  ===========================================================
226         -->
227         <xsl:call-template name="Draw_BlkDiagram_Stacks"/>      
228         
229         <!-- 
230                  ===========================================================
231                                                 Draw the Bus Lane Spaces 
232                  ===========================================================
233         -->
234         <xsl:call-template name="Draw_BlkDiagram_BusLaneSpaces"/>       
235         
236         <!-- 
237                  ===========================================================
238                                                 Draw the shared busses 
239                  ===========================================================
240         -->
241         <use   x="{$BLKD_INNER_X}"      y="{$G_SharedBus_Y}"  xlink:href="#group_sharedBusses"/> 
242         
243         <!-- 
244                  ===========================================================
245                                                 Draw the Bridges
246                  ===========================================================
247         -->
248         <xsl:call-template name="Draw_BlkDiagram_Bridges"/>     
249         
250         
251         <!-- 
252                  ===========================================================
253                                                 Draw the Ip Bucket
254                  ===========================================================
255         -->
256         <xsl:call-template name="Draw_BlkDiagram_IPBucket"/>
257         
258         <!-- 
259                  ===========================================================
260                                                 Draw the Key
261                  ===========================================================
262         -->
263         <xsl:if test="(not($IN_TESTMODE) or ($IN_TESTMODE = 'FALSE'))">
264                 <use   x="{$G_Total_Blkd_W - $BLKD_KEY_W - $BLKD_PRTCHAN_W}" y="{$G_Total_Blkd_H + $BLKD_DRAWAREA2KEY_GAP - 8}"  xlink:href="#BlkDiagram_Key"/> 
265         </xsl:if>
266         
267         <!-- 
268                  ===========================================================
269                                                 Draw the Specs
270                  ===========================================================
271         -->
272         <xsl:if test="(not($IN_TESTMODE) or ($IN_TESTMODE = 'FALSE'))">
273                 <use   x="{$BLKD_PRTCHAN_W}"  y="{$G_Total_Blkd_H + $BLKD_DRAWAREA2KEY_GAP - 8}"  xlink:href="#BlkDiagram_Specs"/> 
274         </xsl:if>
275         
276         <!-- 
277                 ************************************************************ 
278                 ***************  DONE DRAWING BLOCK DIAGRAM   ************** 
279                 ************************************************************ 
280         -->     
281         
282 </xsl:template> 
283         
284         
285 <!-- ======================================================================= -->
286 <!--                         FUNCTION TEMPLATE                               -->
287 <!--                                                                                                                                             -->
288 <!--  Draw stacks on the Block Diagram                                                                           -->
289 <!-- ======================================================================= -->
290 <xsl:template name="Draw_BlkDiagram_Stacks">
291         
292         <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/BCLANESPACES/BCLANESPACE[(@EAST &lt; $G_ROOT/EDKSYSTEM/BLKDIAGRAM/@STACK_HORIZ_WIDTH)]">
293                         
294                 <xsl:variable name="stack_line_x_">
295                         <xsl:call-template name="F_Calc_Stack_X">
296                                 <xsl:with-param name="iStackIdx"  select="@EAST"/>
297                         </xsl:call-template>
298                 </xsl:variable>
299                 
300                 <xsl:variable name="stack_abv_sbs_">
301                         <xsl:call-template name="F_Calc_Stack_AbvSbs_Height">
302                                 <xsl:with-param name="iStackIdx"  select="@EAST"/>
303                         </xsl:call-template>
304                 </xsl:variable>
305                 
306                 <xsl:variable name="bridges_w_"    select="(($G_NumOfBridges * ($BLKD_MOD_W + ($BLKD_BUS_LANE_W * 2))) + $BLKD_BRIDGE_GAP)"/>
307                 
308                 <xsl:variable name="stack_y_" select="($G_SharedBus_Y - $stack_abv_sbs_ - $BLKD_PROC2SBS_GAP)"/>
309                 <xsl:variable name="stack_x_" select="($BLKD_INNER_X + $stack_line_x_ + $bridges_w_)"/>
310                 
311                 <xsl:variable name="stack_name_">
312                         <xsl:call-template name="F_generate_Stack_Name"> 
313                                 <xsl:with-param name="iHorizIdx" select="@EAST"/>
314                         </xsl:call-template>            
315                 </xsl:variable> 
316                 
317                 <use   x="{$stack_x_}"    y="{$stack_y_}"  xlink:href="#{$stack_name_}"/> 
318         
319         </xsl:for-each> 
320                         
321 </xsl:template>
322         
323 <xsl:template name="Draw_BlkDiagram_StandAloneMpmcConnections">
324         
325         <xsl:variable name="mpmcInst_" select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/CMPLXSHAPES/MPMCSHAPE/@INSTANCE"/>
326         <xsl:variable name="lastStack_" select="($G_ROOT/EDKSYSTEM/BLKDIAGRAM/@STACK_HORIZ_WIDTH) - 1"/>
327         
328         
329         <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/BCLANESPACES/BCLANESPACE">
330                 <xsl:variable name="currentLane_" select="position()"/>
331 <!--            
332                 <xsl:message>Current lane <xsl:value-of select="$currentLane_"/></xsl:message>
333 -->     
334                 <xsl:variable name="stackToEast_">
335                         <xsl:choose>
336                                 <xsl:when test="not(@WEST = $lastStack_)"><xsl:value-of select="@EAST"/></xsl:when>
337                                 <xsl:when test="   (@WEST = $lastStack_)"><xsl:value-of select="'NONE'"/></xsl:when>
338                         </xsl:choose>
339                 </xsl:variable>
340                 
341                 <xsl:variable name="stackToWest_">
342                         <xsl:choose>
343                                 <xsl:when test="not(@WEST = $lastStack_)"><xsl:value-of select="'NONE'"/></xsl:when>
344                                 <xsl:when test="   (@WEST = $lastStack_)"><xsl:value-of select="@WEST"/></xsl:when>
345                         </xsl:choose>
346                 </xsl:variable>
347                 
348                 <xsl:variable name="spaceAbvSbs_H_">
349                         <xsl:call-template name="F_Calc_Space_AbvSbs_Height">
350                                 <xsl:with-param name="iStackToEast"  select="$stackToEast_"/>
351                                 <xsl:with-param name="iStackToWest"  select="$stackToWest_"/>
352                         </xsl:call-template>
353                 </xsl:variable> 
354                 
355                 <xsl:variable name="space_y_"   select="($G_SharedBus_Y - $spaceAbvSbs_H_ - $BLKD_PROC2SBS_GAP)"/>
356         
357 <!--            
358                 <xsl:message>Stack To East <xsl:value-of select="$stackToEast_"/></xsl:message>
359                 <xsl:message>Stack To West <xsl:value-of select="$stackToWest_"/></xsl:message>
360                 <xsl:variable name="space_X_">
361                         <xsl:call-template name="F_Calc_Space_X"> 
362                                 <xsl:with-param name="iStackToEast" select="$stackToEast_"/>
363                                 <xsl:with-param name="iStackToWest" select="$stackToWest_"/>
364                         </xsl:call-template>            
365                 </xsl:variable>
366                 <xsl:variable name="space_y_"   select="($G_SharedBus_Y - $spaceAbvSbs_H_ - $BLKD_PROC2SBS_GAP)"/>
367                 <xsl:variable name="space_x_"   select="($BLKD_INNER_X + $G_Total_Bridges_W + $space_line_x_)"/>
368 -->             
369                 
370         
371                 <xsl:for-each select="BUSCONNLANE[@IS_MPMCCONN]">
372                         
373 <!--                    
374                         <xsl:variable name="bifSide_" select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = BUSCONN/@INSTANCE)]/BUSINTERFACE[(@BUSNAME = @BUSNAME)]/@BIF_X"/>
375 -->     
376                         <xsl:variable name="bifInst_"     select="BUSCONN/@INSTANCE"/>
377                         <xsl:variable name="busName_"     select="@BUSNAME"/>
378                         <xsl:variable name="bifSide_"     select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $bifInst_)]/BUSINTERFACE[(@BUSNAME = $busName_)]/@BIF_X"/>
379                         
380                         <xsl:variable name="mpmcBifName_">
381                                 <xsl:choose>
382                                         <xsl:when test="   (@IS_SBSCONN)"><xsl:value-of select="BUSCONN/@BUSINTERFACE"/></xsl:when>
383                                         <xsl:when test="not(@IS_SBSCONN)"><xsl:value-of select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $mpmcInst_)]/BUSINTERFACE[(@BUSNAME = $busName_)]/@NAME"/></xsl:when>
384                                         <xsl:otherwise><xsl:value-of select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $mpmcInst_)]/BUSINTERFACE[(@BUSNAME = $busName_)]/@NAME"/></xsl:otherwise>
385                                 </xsl:choose>
386                         </xsl:variable>
387                         
388 <!--                    
389                         <xsl:message>MPMC Bif Name <xsl:value-of select="$mpmcBifName_"/></xsl:message>
390                         <xsl:message>Bif Side <xsl:value-of select="$bifSide_"/></xsl:message>
391                         <xsl:message>Bus Name <xsl:value-of select="@BUSNAME"/></xsl:message>
392                         <xsl:message>Instance <xsl:value-of select="$bifInst_"/></xsl:message>
393                         <xsl:message>Space line x <xsl:value-of select="$space_line_X_"/></xsl:message>
394 -->
395                         <xsl:variable name="space_line_X_">
396                                 <xsl:call-template name="F_Calc_Space_X">
397                                         <xsl:with-param name="iStackToEast"  select="$stackToEast_"/>
398                                         <xsl:with-param name="iStackToWest"  select="$stackToWest_"/>
399                                 </xsl:call-template>
400                         </xsl:variable>
401                         
402                         <xsl:variable name="space_X_"   select="($BLKD_INNER_X + $G_Total_Bridges_W + $space_line_X_)"/>
403                         
404                         <xsl:variable name = "stackToWest_W_">
405                                 <xsl:choose>
406                                         <xsl:when test="(($stackToEast_ = '0')   and     ($stackToWest_ = 'NONE'))">0</xsl:when>
407                                         <xsl:when test="(($stackToEast_ = 'NONE') and not($stackToWest_ = 'NONE'))">
408                                                 <xsl:call-template name="F_Calc_Stack_Width">
409                                                         <xsl:with-param name="iStackIdx"  select="$stackToWest_"/>
410                                                 </xsl:call-template>
411                                         </xsl:when>
412                                         <xsl:when test="(not($stackToEast_ = '0') and not($stackToEast_ = 'NONE') and ($stackToWest_ = 'NONE'))">
413                                                 <xsl:call-template name="F_Calc_Stack_Width">
414                                                         <xsl:with-param name="iStackIdx"  select="($stackToEast_ - 1)"/>
415                                                 </xsl:call-template>
416                                         </xsl:when>
417                                         <xsl:otherwise>0</xsl:otherwise>
418                                 </xsl:choose>
419                         </xsl:variable>
420         
421                         <xsl:variable name = "stackToEast_W_">
422                                 <xsl:call-template name="F_Calc_Stack_Width">
423                                         <xsl:with-param name="iStackIdx"  select="$stackToEast_"/>
424                                 </xsl:call-template>
425                         </xsl:variable>
426         
427                         <xsl:variable name ="extSpaceWest_W_" select="ceiling($stackToWest_W_ div 2)"/>
428                         <xsl:variable name ="extSpaceEast_W_" select="ceiling($stackToEast_W_ div 2)"/>
429                         <xsl:variable name="laneInSpace_X_">
430                                 <xsl:choose>
431                                    <xsl:when test="(@ORIENTED = 'EAST')">
432                                            <xsl:value-of select="($extSpaceWest_W_ + (@BUSLANE_X * $BLKD_BUS_LANE_W) - $BLKD_BUS_ARROW_W - $BLKD_P2P_BUS_W)"/>
433 <!-- 
434                                            <xsl:value-of select="($extSpaceWest_W_ + (@BUSLANE_X * $BLKD_BUS_LANE_W) - $BLKD_BUS_LANE_W - $BLKD_BUS_ARROW_W - $BLKD_P2P_BUS_W)"/>
435 -->                                
436                                    </xsl:when>
437                                    <xsl:otherwise><xsl:value-of select="($extSpaceWest_W_ + (@BUSLANE_X * $BLKD_BUS_LANE_W))"/></xsl:otherwise>
438                                 </xsl:choose>
439                         </xsl:variable> 
440                                                 
441                         
442                         <xsl:variable name="lane_X_"        select="($space_X_ + $laneInSpace_X_)"/>
443                         
444                         <xsl:variable name="mpmcBifType_" select="$G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $mpmcInst_)]/BUSINTERFACE[(@NAME = $mpmcBifName_)]/@TYPE"/>
445                         
446                 <!--    
447                         <xsl:variable name="bc_X_" select="($lane_X_ +  ceiling($BLKD_BIFC_W div 2) - ceiling($BLKD_BUS_ARROW_W div 2))"/>
448                         <xsl:variable name="bc_X_" select="($lane_X_ +  ceiling($BLKD_BIFC_W div 2) - ceiling($BLKD_BUS_ARROW_W div 2))"/>
449                         <xsl:variable name="bc_X_" select="($lane_X_ + ceiling($BLKD_BIFC_W div 2))"/>
450                 -->     
451                         
452                         <xsl:variable name="bc_Y_" select="($BLKD_INNER_Y + $BLKD_MPMC_MOD_H)"/>
453                         <xsl:variable name="bc_X_" >
454                                 <xsl:choose>
455                                         <xsl:when test="($bifSide_ = '0')"><xsl:value-of select="($lane_X_ + ceiling($BLKD_BIFC_W div 2))"/></xsl:when>
456                                         <xsl:when test="($bifSide_ = '1')"><xsl:value-of select="($lane_X_ + $BLKD_BIFC_dx)"/></xsl:when>
457                                         <xsl:otherwise>                    <xsl:value-of select="($lane_X_ + ceiling($BLKD_BIFC_W div 2))"/></xsl:otherwise>
458                                 </xsl:choose>
459                         </xsl:variable>
460                         
461                         <xsl:variable name="busColor_">
462                                 <xsl:call-template name="F_BusStd2RGB">
463                                         <xsl:with-param name="iBusStd" select="@BUSSTD"/>
464                                 </xsl:call-template>    
465                         </xsl:variable>
466                 
467                         <!-- Place the MPMC bif label -->
468                         <xsl:variable name="bcl_X_" select="($bc_X_ + ceiling($BLKD_BIFC_W div 2) - ceiling($BLKD_BIF_W div 2))"/>
469                         <xsl:variable name="bcl_Y_" select="($bc_Y_ - $BLKD_BIF_H - $BLKD_MOD_BIF_GAP_H)"/>
470                         <use  x="{$bcl_X_}"   y="{$bcl_Y_}"  xlink:href="#{@BUSSTD}_BifLabel"/>
471                         
472                         <xsl:call-template name="F_WriteText">
473                                 <xsl:with-param name="iX"               select="($bcl_X_ + ceiling($BLKD_BIF_W div 2))"/>
474                                 <xsl:with-param name="iY"               select="($bcl_Y_ + ceiling($BLKD_BIF_H div 2) + 3)"/>
475                                 <xsl:with-param name="iText"    select="$mpmcBifName_"/>
476                                 <xsl:with-param name="iClass"   select="'mpmc_biflabel'"/>
477                         </xsl:call-template>    
478                                   
479                         <!-- Place the MPMC bif -->
480                         <use   x="{$bc_X_}"   y="{$bc_Y_}"  xlink:href="#{@BUSSTD}_busconn_{$mpmcBifType_}"/>
481 <!-- 
482 -->
483                         
484                         <xsl:variable name="bcArrow_X_" select="($bc_X_ +  ceiling($BLKD_BIFC_W div 2) - ceiling($BLKD_BUS_ARROW_H div 2))"/>
485                         <xsl:variable name="bcArrow_Y_" select="($bc_Y_ + $BLKD_BIFC_H - 3)"/>
486                         
487                         <!-- Place the MPMC Arrow -->
488                         <use   x="{$bcArrow_X_}"   y="{$bcArrow_Y_}"  xlink:href="#{@BUSSTD}_BusArrowNorth"/>
489                         
490                         <!-- 
491                                 Place a block to cover the gap btw MPMC and top of Bus Lane Space, or to the correct SBS 
492                                 For non SBS connections a vertical block will already have been drawn to the top of the
493                                 space.
494                         -->
495                         
496                         <xsl:variable name="sbsDy_">
497                                 <xsl:choose>
498                                         <xsl:when test="@IS_SBSCONN"><xsl:value-of select="2 + ($G_ROOT/EDKSYSTEM/MODULES/MODULE[(@INSTANCE = $busName_)]/@BUS_INDEX * $BLKD_SBS_LANE_H)"/></xsl:when>
499                                         <xsl:when test="not(@IS_SBSCONN)">0</xsl:when>
500                                         <xsl:otherwise>0></xsl:otherwise>
501                                 </xsl:choose>
502                         </xsl:variable>
503                         
504                         <xsl:variable name="mpmcBusHeight_">
505                                 <xsl:choose>
506                                         <xsl:when    test="(@IS_SBSCONN)"><xsl:value-of select="($G_SharedBus_Y - ($bcArrow_Y_ + $BLKD_BUS_ARROW_W + 4) + $sbsDy_)"/></xsl:when>
507                                         <xsl:when test="not(@IS_SBSCONN)">
508                                                 <xsl:choose>
509                                                         <xsl:when test="($space_y_ &gt;= ($bcArrow_Y_ + $BLKD_BUS_ARROW_W + 4 + $sbsDy_))">
510                                                                 <xsl:value-of select="($space_y_ - ($bcArrow_Y_ + $BLKD_BUS_ARROW_W + 4 + $sbsDy_))"/>
511                                                         </xsl:when>
512                                                         <xsl:when test="($space_y_ &lt; ($bcArrow_Y_ + $BLKD_BUS_ARROW_W + 4 + $sbsDy_))">
513                                                                 <xsl:value-of select="(($bcArrow_Y_ + $BLKD_BUS_ARROW_W + 4 + $sbsDy_) - $space_y_)"/>
514                                                         </xsl:when>
515                                                 </xsl:choose>
516                                         </xsl:when>
517                                         <xsl:otherwise><xsl:value-of select="$BLKD_BIFC_H"/></xsl:otherwise>
518                                 </xsl:choose>
519                         </xsl:variable>
520                         
521                         <rect x="{$bcArrow_X_ + $BLKD_BUS_ARROW_G}" 
522                                   y="{$bcArrow_Y_ + $BLKD_BUS_ARROW_W + 4}"  
523                                   width= "{$BLKD_P2P_BUS_W}" 
524                                   height="{$mpmcBusHeight_}"  
525                               style="stroke:none; fill:{$busColor_}"/>  
526                         
527                         <!-- place the bus label here -->
528
529                         <xsl:call-template name="F_WriteText">
530                                 <xsl:with-param name="iX"               select="($bcArrow_X_ + $BLKD_BUS_ARROW_W + 6)"/>
531                                 <xsl:with-param name="iY"               select="($bcArrow_Y_ + ceiling($mpmcBusHeight_ div 2) + 6)"/>
532                                 <xsl:with-param name="iText"    select="$busName_"/>
533                                 <xsl:with-param name="iClass"   select="'p2pbus_label'"/>
534                         </xsl:call-template>    
535                         
536                 </xsl:for-each>                         
537         </xsl:for-each> 
538         
539 </xsl:template>
540         
541         
542 <!-- ======================================================================= -->
543 <!--                         FUNCTION TEMPLATE                               -->
544 <!--                                                                                                                                             -->
545 <!--  Draw bus lane spaces on the Block Diagram                                                          -->
546 <!-- ======================================================================= -->
547 <xsl:template name="Draw_BlkDiagram_BusLaneSpaces">
548         
549         <xsl:variable name="lastStack_" select="($G_ROOT/EDKSYSTEM/BLKDIAGRAM/@STACK_HORIZ_WIDTH) - 1"/>
550         
551         <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/BCLANESPACES/BCLANESPACE[@EAST]">
552                 <xsl:sort select="@EAST" data-type="number"/>
553                         
554                 <xsl:call-template name="Draw_BlkDiagram_BusLaneSpace">
555                         <xsl:with-param name="iStackToEast"  select="@EAST"/>
556                 </xsl:call-template>
557         </xsl:for-each> 
558         
559         <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/BCLANESPACES/BCLANESPACE[(@WEST = $lastStack_)]">
560                 <xsl:call-template name="Draw_BlkDiagram_BusLaneSpace">
561                         <xsl:with-param name="iStackToWest"  select="$lastStack_"/>
562                 </xsl:call-template>
563         </xsl:for-each> 
564                         
565 </xsl:template>
566         
567 <xsl:template name="Draw_BlkDiagram_BusLaneSpace">
568         
569         <xsl:param name="iStackToEast" select="'NONE'"/>
570         <xsl:param name="iStackToWest" select="'NONE'"/>
571         
572         <xsl:variable name="spaceAbvSbs_H_">
573                 <xsl:call-template name="F_Calc_Space_AbvSbs_Height">
574                         <xsl:with-param name="iStackToEast"  select="$iStackToEast"/>
575                         <xsl:with-param name="iStackToWest"  select="$iStackToWest"/>
576                 </xsl:call-template>
577         </xsl:variable> 
578         
579         <xsl:variable name="spaceBlwSbs_H_">
580                 <xsl:call-template name="F_Calc_Space_BlwSbs_Height">
581                         <xsl:with-param name="iStackToEast"  select="$iStackToEast"/>
582                         <xsl:with-param name="iStackToWest"  select="$iStackToWest"/>
583                 </xsl:call-template>
584         </xsl:variable> 
585         
586         <xsl:variable name="space_line_x_">
587                 <xsl:call-template name="F_Calc_Space_X">
588                         <xsl:with-param name="iStackToEast"  select="$iStackToEast"/>
589                         <xsl:with-param name="iStackToWest"  select="$iStackToWest"/>
590                 </xsl:call-template>
591         </xsl:variable>
592         
593         <xsl:variable name="space_y_"   select="($G_SharedBus_Y - $spaceAbvSbs_H_ - $BLKD_PROC2SBS_GAP)"/>
594         <xsl:variable name="space_x_"   select="($BLKD_INNER_X + $G_Total_Bridges_W + $space_line_x_)"/>
595         
596         <xsl:variable name="stackToEast_">
597                 <xsl:choose>
598                         <xsl:when test="not($iStackToEast = 'NONE')"><xsl:value-of select="$iStackToEast"/></xsl:when>
599                         <xsl:otherwise>NONE</xsl:otherwise>
600                 </xsl:choose>
601         </xsl:variable> 
602         
603         <xsl:variable name="stackToWest_">
604                 <xsl:choose>
605                         <xsl:when test=" not($iStackToWest = 'NONE')"><xsl:value-of select="$iStackToWest"/></xsl:when>
606                         <xsl:when test="(not($iStackToEast = 'NONE') and not($iStackToEast = '0'))"><xsl:value-of select="($iStackToEast - 1)"/></xsl:when>
607                         <xsl:otherwise>NONE</xsl:otherwise>
608                 </xsl:choose>
609         </xsl:variable> 
610         
611                 
612         <xsl:variable name="space_Name_">
613                 <xsl:call-template name="F_generate_Space_Name"> 
614                         <xsl:with-param name="iStackToEast" select="$stackToEast_"/>
615                         <xsl:with-param name="iStackToWest" select="$stackToWest_"/>
616                 </xsl:call-template>            
617         </xsl:variable> 
618         
619 <!--    
620         <xsl:message>StackToEast is <xsl:value-of select="$iStackToEast"/></xsl:message>
621         <xsl:message>StackToWest is <xsl:value-of select="$iStackToWest"/></xsl:message>
622         <xsl:message>SpaceName is <xsl:value-of select="$space_Name_"/></xsl:message>
623 -->     
624                 
625         <use   x="{$space_x_}"    y="{$space_y_}"  xlink:href="#{$space_Name_}"/> 
626         
627 </xsl:template>
628         
629         
630 <!-- =========================================================================== -->
631 <!--                          FUNCTION TEMPLATE                                  -->
632 <!--                                                                                                                                                     -->
633 <!--  Draw Bridges on the Block Diagram                                                                                  -->
634 <!-- =========================================================================== -->
635 <xsl:template name="Draw_BlkDiagram_Bridges">
636         
637         <!-- First save all the bridge indexs in a variable      -->
638         <xsl:variable name="bridgeShapes_">
639                 <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/BRIDGESHAPES/MODULE/BUSCONNS[(@ORIENTED = 'WEST')]/BUSCONN"> 
640                         <BRIDGE BUS_INDEX="{@BUS_INDEX}" INSTANCE="{../../@INSTANCE}" POSITION="{(position() -1)}"/>
641                         <BRIDGECONN BUS_INDEX="{@BUS_INDEX}" INSTANCE="{../../@INSTANCE}" ORIENTED="{../@ORIENTED}" POSITION="{(position()  - 1)}" BUSSTD="{@BUSSTD}" TYPE="{@TYPE}"/>
642                         <!-- So both bus conns have same position.... -->
643                         <xsl:if test="../../BUSCONNS[(@ORIENTED = 'EAST')]">
644                                 <BRIDGECONN BUS_INDEX="{../../BUSCONNS[(@ORIENTED ='EAST')]/BUSCONN/@BUS_INDEX}" INSTANCE="{../../@INSTANCE}" ORIENTED="EAST" POSITION="{(position()  - 1)}"   BUSSTD="{../../BUSCONNS[(@ORIENTED = 'EAST')]/BUSCONN/@BUSSTD}" TYPE="{../../BUSCONNS[(@ORIENTED = 'EAST')]/BUSCONN/@TYPE}"/>
645                         </xsl:if>
646                 </xsl:for-each>
647         </xsl:variable>
648 <!--                            
649                         <xsl:message>Found an east connection on <xsl:value-of select="../../@INSTANCE"/></xsl:message>
650 -->                             
651         <!-- Now layout the bridge shapes between the shared busses      -->
652         <xsl:for-each select="exsl:node-set($bridgeShapes_)/BRIDGE">
653                 <xsl:sort select="@POSITION" data-type="number"/>
654                 
655                 <xsl:variable name="brdgPosition_"  select="@POSITION"/>
656                 <xsl:variable name="brdgInstance_"  select="@INSTANCE"/>
657                 
658                 <xsl:variable name="min_bus_idx_" select="math:min(exsl:node-set($bridgeShapes_)/BRIDGECONN[(@POSITION = $brdgPosition_)]/@BUS_INDEX)"/>
659 <!--            
660                 <xsl:variable name="max_bus_idx_" select="math:max(exsl:node-set($bridgeShapes_)/BRIDGECONN[(@POSITION = $brdgPosition_)]/@BUS_INDEX)"/>
661                 
662         <xsl:message>Maximum index <xsl:value-of select="$max_bus_idx_"/></xsl:message>
663         <xsl:message>Minimum index <xsl:value-of select="$min_bus_idx_"/></xsl:message>
664 -->
665                 
666                 
667                 <xsl:variable name="brdg_X_"  select="($BLKD_INNER_X + $BLKD_BRIDGE_GAP + $BLKD_BUS_LANE_W + (@POSITION * ($BLKD_MOD_W + ($BLKD_BUS_LANE_W * 2))))"/>   
668                 <xsl:variable name="brdg_Y_"  select="($G_SharedBus_Y  + ($min_bus_idx_ * $BLKD_SBS_LANE_H) + ceiling($BLKD_SBS_LANE_H div 2) - ceiling($BLKD_MOD_H div 2))"/>
669                 
670                 <use  x="{$brdg_X_}"  y="{$brdg_Y_}"  xlink:href="#symbol_{$brdgInstance_}"/>   
671         </xsl:for-each> 
672         
673                 
674         
675 <!--    
676         <xsl:message>Found <xsl:value-of select="count(exsl:node-set($bridgeShapes_)/BRIDGECONN)"/> busconns </xsl:message>
677                 <xsl:message>Drawing connection for bridge <xsl:value-of select="$brdgInstance_"/> at <xsl:value-of select="@POSITION"/> </xsl:message>
678 -->     
679         
680         <xsl:for-each select="exsl:node-set($bridgeShapes_)/BRIDGECONN">
681                 <xsl:sort select="@POSITION" data-type="number"/>
682                 
683                 <xsl:variable name="brdgInstance_"  select="@INSTANCE"/>
684                 <xsl:variable name="brdgPosition_"  select="@POSITION"/>
685                 
686                 <xsl:variable name="busColor_">
687                         <xsl:call-template name="F_BusStd2RGB">
688                                 <xsl:with-param name="iBusStd" select="@BUSSTD"/>
689                         </xsl:call-template>    
690                 </xsl:variable>
691                 
692                 <xsl:variable name="min_bus_idx_" select="math:min(exsl:node-set($bridgeShapes_)/BRIDGECONN[(@POSITION = $brdgPosition_)]/@BUS_INDEX)"/>
693                 <xsl:variable name="brdg_Y1_"     select="($G_SharedBus_Y  + ($min_bus_idx_ * $BLKD_SBS_LANE_H) + ceiling($BLKD_SBS_LANE_H div 2) - ceiling($BLKD_MOD_H div 2))"/>
694                 <xsl:variable name="brdg_X_"      select="($BLKD_INNER_X   + $BLKD_BRIDGE_GAP + $BLKD_BUS_LANE_W + (@POSITION * ($BLKD_MOD_W + ($BLKD_BUS_LANE_W * 2))))"/>     
695                 
696                 <xsl:variable name="bc_Y_"        select="$brdg_Y1_ + $BLKD_MOD_LANE_H + $BLKD_MOD_LABEL_H + $BLKD_MOD_BIF_GAP_V + ceiling($BLKD_BIF_H div 2) - ceiling($BLKD_BIFC_H div 2)"/>  
697                 <xsl:variable name="bc_X_">
698                         <xsl:choose>
699                                 <xsl:when test="@ORIENTED='WEST'">
700                                         <xsl:value-of select="($brdg_X_ - $BLKD_BIFC_W)"/>
701                                 </xsl:when>
702                                 <xsl:when test="@ORIENTED='EAST'">
703                                         <xsl:value-of select="($brdg_X_ + $BLKD_MOD_W)"/>
704                                 </xsl:when>
705                         </xsl:choose>
706                 </xsl:variable> 
707                 
708                 <!-- Layout the bus conn -->
709                 <use   x="{$bc_X_}"   y="{$bc_Y_}"  xlink:href="#{@BUSSTD}_busconn_{@TYPE}"/>
710                 
711                 <!-- Figure out the positions of the lines -->
712                 
713 <!--            
714                 <xsl:variable name="vert_line_x_"  select="$bc_X_    + ceiling($BLKD_BIFC_W div 2)"/>
715                 <xsl:message>vert line x <xsl:value-of select="$vert_line_x_"/></xsl:message>
716                 <xsl:message>bus index <xsl:value-of select="@BUS_INDEX"/></xsl:message>
717 -->             
718                 
719                 <xsl:variable name="vert_line_x_">
720                         <xsl:choose>
721                                 <xsl:when test="@ORIENTED='WEST'">
722                                         <xsl:value-of select="($bc_X_ - ($BLKD_BUS_LANE_W - $BLKD_BIFC_W))"/>
723                                 </xsl:when>
724                                 <xsl:when test="@ORIENTED='EAST'">
725                                         <xsl:value-of select="($bc_X_ + ($BLKD_BUS_LANE_W - $BLKD_P2P_BUS_W))"/>
726                                 </xsl:when>
727                         </xsl:choose>
728                 </xsl:variable> 
729                 
730                 <!-- At least one of the points is going to be the bus -->
731 <!--            
732                 <xsl:variable name="vert_line_y1_" select="($G_SharedBus_Y  + $BLKD_PROC2SBS_GAP + (@BUS_INDEX * $BLKD_SBS_LANE_H))"/>
733 -->             
734                 <xsl:variable name="vert_line_y1_" select="($G_SharedBus_Y  + (@BUS_INDEX * $BLKD_SBS_LANE_H))"/>
735                 <xsl:variable name="vert_line_y2_" select="$bc_Y_ + ceiling($BLKD_BIFC_H div 2)"/>
736                 
737                 <xsl:variable name="v_bus_ul_y_">
738                         <xsl:choose>
739                                 <xsl:when test="$vert_line_y1_ &gt; $vert_line_y2_">
740                                         <xsl:value-of select="$vert_line_y2_"/>
741                                 </xsl:when>
742                                 <xsl:when test="$vert_line_y2_ &gt; $vert_line_y1_">
743                                         <xsl:value-of select="$vert_line_y1_"/>
744                                 </xsl:when>
745                         </xsl:choose>
746                 </xsl:variable> 
747 <!--            
748                 <xsl:variable name="v_bus_ul_x_" select="$vert_line_x_"/>
749 -->     
750                 <xsl:variable name="v_bus_ul_x_">
751                         <xsl:choose>
752                                 <xsl:when test="@ORIENTED='WEST'">
753                                         <xsl:value-of select="($vert_line_x_ + $BLKD_MOD_BIF_GAP_H)"/>
754                                 </xsl:when>
755                                 <xsl:when test="@ORIENTED='EAST'">
756                                         <xsl:value-of select="($vert_line_x_ - $BLKD_MOD_BIF_GAP_H)"/>
757                                 </xsl:when>
758                         </xsl:choose>
759                 </xsl:variable> 
760                 
761                 
762                 <xsl:variable name="v_bus_width_" select="$BLKD_P2P_BUS_W"/>
763                 <xsl:variable name="v_bus_height_">
764                         <xsl:choose>
765                                 <xsl:when test="$vert_line_y1_ &gt; $vert_line_y2_">
766                                         <xsl:value-of select="($vert_line_y1_ - $vert_line_y2_)"/>
767                                 </xsl:when>
768                                 <xsl:when test="$vert_line_y2_ &gt; $vert_line_y1_">
769                                         <xsl:value-of select="($vert_line_y2_ - $vert_line_y1_)"/>
770                                 </xsl:when>
771                         </xsl:choose>
772                 </xsl:variable> 
773                 
774                 <xsl:variable name="h_bus_ul_x_">
775                         <xsl:choose>
776                                 <xsl:when test="@ORIENTED='WEST'">
777                                         <xsl:value-of select="($bc_X_ - ($BLKD_BUS_LANE_W - $BLKD_BIFC_W) + $BLKD_MOD_BIF_GAP_H)"/>
778                                 </xsl:when>
779                                 <xsl:when test="@ORIENTED='EAST'">
780                                         <xsl:value-of select="($bc_X_ + $BLKD_BIFC_W - ceiling(($BLKD_BIFC_W - $BLKD_BIFC_Wi) div 2))"/>
781                                 </xsl:when>
782                         </xsl:choose>
783                 </xsl:variable> 
784                 
785                 <xsl:variable name="h_bus_ul_y_" select="$bc_Y_ + ceiling($BLKD_BIFC_H div 2) - ceiling($BLKD_P2P_BUS_W div 2)"/>
786                 <xsl:variable name="h_bus_height_" select="$BLKD_P2P_BUS_W"/>
787                 
788                 <xsl:variable name="h_bus_width_">
789                         <xsl:choose>
790                                 <xsl:when test="@ORIENTED='WEST'">
791                                         <xsl:value-of select="(($bc_X_ + ceiling(($BLKD_BIFC_W - $BLKD_BIFC_Wi) div 2)) - $h_bus_ul_x_ + 1)"/>
792                                 </xsl:when>
793                                 <xsl:when test="@ORIENTED='EAST'">
794                                         <xsl:value-of select="(($v_bus_ul_x_ + $BLKD_P2P_BUS_W) - $h_bus_ul_x_)"/>
795                                 </xsl:when>
796                         </xsl:choose>
797                 </xsl:variable> 
798                 
799                 
800 <!--            
801                 <xsl:message>vert line y1 <xsl:value-of select="$vert_line_y1_"/></xsl:message>
802 -->             
803                 
804                 <rect x="{$v_bus_ul_x_}" 
805                           y="{$v_bus_ul_y_ + 2}"  
806                           width= "{$v_bus_width_}" 
807                           height="{$v_bus_height_}" 
808                           style="stroke:none; fill:{$busColor_}"/>
809                 
810                 <rect x="{$h_bus_ul_x_}" 
811                           y="{$h_bus_ul_y_}"  
812                           width= "{$h_bus_width_}" 
813                           height="{$h_bus_height_}" 
814                           style="stroke:none; fill:{$busColor_}"/>
815                 
816         </xsl:for-each> 
817         
818 </xsl:template>
819         
820         
821         
822         
823 <!-- =========================================================================== -->
824 <!--                          FUNCTION TEMPLATE                                  -->
825 <!--                                                                                                                                                     -->
826 <!-- Draw the IP Bucket                                                                                                          -->
827 <!-- =========================================================================== -->
828 <xsl:template name="Draw_BlkDiagram_IPBucket">
829         
830         <!-- Draw IP Bucket --> 
831         <xsl:for-each select="$G_ROOT/EDKSYSTEM/BLKDIAGRAM/IPBUCKET">
832         
833                 <xsl:variable name="bucket_w_"  select="(($BLKD_MOD_BKTLANE_W * 2) + (($BLKD_MOD_W * @MODS_W) + ($BLKD_MOD_BUCKET_G * (@MODS_W - 1))))"/>
834                 <xsl:variable name="bucket_h_"  select="(($BLKD_MOD_BKTLANE_H * 2) + (($BLKD_MOD_H * @MODS_H) + ($BLKD_MOD_BUCKET_G * (@MODS_H - 1))))"/>
835                 
836                 <xsl:variable name="bucket_x_"  select="(ceiling($G_Total_Blkd_W div 2) - ceiling($bucket_w_ div 2))"/>
837                 <xsl:variable name="bucket_y_"  select="($G_SharedBus_Y + $G_Total_SharedBus_H + $G_Max_Stack_BlwSbs_H + $BLKD_SBS2IP_GAP)"/>
838                 
839                 <xsl:call-template name="F_WriteText">
840                         <xsl:with-param name="iX"               select="$bucket_x_"/>
841                         <xsl:with-param name="iY"               select="($bucket_y_ - 4)"/>
842                         <xsl:with-param name="iText"    select="'IP'"/>
843                         <xsl:with-param name="iClass"   select="'bkt_label'"/>
844                 </xsl:call-template>
845                 
846                 <use   x="{$bucket_x_}"   y="{$bucket_y_}"  xlink:href="#ipbucket"/>
847                 
848         </xsl:for-each>
849         
850 </xsl:template>
851         
852         
853 <xsl:template name="Draw_BlkDiagram_Key">
854         <use   x="{ceiling($G_Total_Blkd_W div 2) - ceiling($BLKD_KEY_W div 2)}"   y="0"  xlink:href="#BlkDiagram_Key"/> 
855 </xsl:template>
856
857 <xsl:template name="Define_BlkDiagram_Key">
858         
859         <xsl:variable name="key_col_">
860                 <xsl:call-template name="F_BusStd2RGB">
861                         <xsl:with-param name="iBusStd" select="'KEY'"/>
862                 </xsl:call-template>    
863         </xsl:variable>
864         
865         <xsl:variable name="key_lt_col_">
866                 <xsl:call-template name="F_BusStd2RGB_LT">
867                         <xsl:with-param name="iBusStd" select="'KEY'"/>
868                 </xsl:call-template>    
869         </xsl:variable>
870         
871         <g id="KEY_IntrCntrl">
872                 <rect  
873                         x="0"
874                         y="0"
875                         rx="3"
876                         ry="3"
877                         width= "{ceiling($BLKD_INTR_W div 2)}" 
878                         height="{$BLKD_INTR_H}" style="fill:{$key_lt_col_}; stroke:none; stroke-width:1"/> 
879                         
880                 <line x1="0" 
881                           y1="{ceiling($BLKD_INTR_H div 4)}"
882                           x2="{ceiling($BLKD_INTR_W div 2)}" 
883                           y2="{ceiling($BLKD_INTR_H div 4)}" 
884                           style="stroke:{$COL_BLACK};stroke-width:2"/>
885
886                 <xsl:call-template name="F_WriteText">
887                         <xsl:with-param name="iX"               select="1.5"/>
888                         <xsl:with-param name="iY"               select="(7 + ceiling($BLKD_INTR_H div 2))"/>
889                         <xsl:with-param name="iText"    select="'x'"/>
890                         <xsl:with-param name="iClass"   select="'intr_symbol'"/>
891                 </xsl:call-template>
892                         
893         </g>
894                 
895         <g id="KEY_IntrdProc">
896                 <rect  
897                         x="0"
898                         y="0"
899                         rx="3"
900                         ry="3"
901                         width= "{ceiling($BLKD_INTR_W div 2)}" 
902                         height="{$BLKD_INTR_H}" style="fill:{$key_lt_col_}; stroke:none; stroke-width:1"/> 
903                         
904                 <line x1="0" 
905                           y1="{ceiling($BLKD_INTR_H div 4) - 2}"
906                           x2="{ceiling($BLKD_INTR_W div 2)}" 
907                           y2="{ceiling($BLKD_INTR_H div 4) - 2}" 
908                           style="stroke:{$COL_BLACK};stroke-width:1"/>
909                           
910                 <line x1="0" 
911                           y1="{ceiling($BLKD_INTR_H div 4) + 2}"
912                           x2="{ceiling($BLKD_INTR_W div 2)}" 
913                           y2="{ceiling($BLKD_INTR_H div 4) + 2}" 
914                           style="stroke:{$COL_BLACK};stroke-width:1"/>
915                           
916                 <xsl:call-template name="F_WriteText">
917                         <xsl:with-param name="iX"               select="1.5"/>
918                         <xsl:with-param name="iY"               select="(7 + ceiling($BLKD_INTR_H div 2))"/>
919                         <xsl:with-param name="iText"    select="'x'"/>
920                         <xsl:with-param name="iClass"   select="'intr_symbol'"/>
921                 </xsl:call-template>
922         </g>
923         
924         <g id="KEY_IntrSrc">
925                 <rect  
926                         x="0"
927                         y="0"
928                         rx="3"
929                         ry="3"
930                         width= "{$BLKD_INTR_W}" 
931                         height="{ceiling($BLKD_INTR_H div 2)}" style="fill:{$key_lt_col_}; stroke:none; stroke-width:1"/> 
932                         
933                 <line x1="{ceiling($BLKD_INTR_W div 2)}" 
934                           y1="0"
935                           x2="{ceiling($BLKD_INTR_W div 2)}" 
936                           y2="{ceiling($BLKD_INTR_H div 2)}" 
937                           style="stroke:{$COL_BLACK};stroke-width:1"/>
938                           
939                 <xsl:call-template name="F_WriteText">
940                         <xsl:with-param name="iX"               select="'2'"/>
941                         <xsl:with-param name="iY"               select="'7'"/>
942                         <xsl:with-param name="iText"    select="'y'"/>
943                         <xsl:with-param name="iClass"   select="'intr_symbol'"/>
944                 </xsl:call-template>
945                           
946                 <xsl:call-template name="F_WriteText">
947                         <xsl:with-param name="iX"               select="(2 + ceiling($BLKD_INTR_W div 2))"/>
948                         <xsl:with-param name="iY"               select="'7'"/>
949                         <xsl:with-param name="iText"    select="'x'"/>
950                         <xsl:with-param name="iClass"   select="'intr_symbol'"/>
951                 </xsl:call-template>
952         </g>
953         
954         
955         <g id="BlkDiagram_Key">
956                 <rect 
957               x="0"
958                           y="0"
959                       width= "{$BLKD_KEY_W}"
960                       height="{$BLKD_KEY_H}"
961                           style="fill:{$COL_BG}; stroke:none;"/>                
962                           
963                 <rect x="0"
964                           y="0"
965                       width= "{$BLKD_KEY_W}"
966                       height="16"
967                           style="fill:{$COL_BG}; stroke:none;"/>                
968                           
969                 <xsl:call-template name="F_WriteText">
970                         <xsl:with-param name="iX"               select="ceiling($BLKD_KEY_W div 2)"/>
971                         <xsl:with-param name="iY"               select="'14'"/>
972                         <xsl:with-param name="iText"    select="'KEY'"/>
973                         <xsl:with-param name="iClass"   select="'key_title'"/>
974                 </xsl:call-template>
975                           
976                 <rect x="0"
977                           y="16"
978                       width= "{$BLKD_KEY_W}"
979                       height="16"
980                           style="fill:{$COL_BG_LT}; stroke:none;"/>             
981
982                 <xsl:call-template name="F_WriteText">
983                         <xsl:with-param name="iX"               select="ceiling($BLKD_KEY_W div 2)"/>
984                         <xsl:with-param name="iY"               select="'30'"/>
985                         <xsl:with-param name="iText"    select="'SYMBOLS'"/>
986                         <xsl:with-param name="iClass"   select="'key_header'"/>
987                 </xsl:call-template>
988                           
989                 <use  x="32"  y="47"  xlink:href="#KEY_BifLabel" transform="scale(0.75)"/> 
990                 <xsl:call-template name="F_WriteText">
991                         <xsl:with-param name="iX"               select="'12'"/>
992                         <xsl:with-param name="iY"               select="'60'"/>
993                         <xsl:with-param name="iText"    select="'bus interface'"/>
994                         <xsl:with-param name="iClass"   select="'key_label'"/>
995                 </xsl:call-template>
996                           
997                 <use   x="20"  y="68"  xlink:href="#KEY_SharedBus"/> 
998                 <xsl:call-template name="F_WriteText">
999                         <xsl:with-param name="iX"               select="'12'"/>
1000                         <xsl:with-param name="iY"               select="'89'"/>
1001                         <xsl:with-param name="iText"    select="'shared bus'"/>
1002                         <xsl:with-param name="iClass"   select="'key_label'"/>
1003                 </xsl:call-template>
1004                           
1005                 
1006 <!-- 
1007         ==================================                                      
1008                         BUS CONNECTIONS
1009         ==================================                                      
1010 -->             
1011
1012                 <xsl:call-template name="F_WriteText">
1013                         <xsl:with-param name="iX"               select="'110'"/>
1014                         <xsl:with-param name="iY"               select="'47'"/>
1015                         <xsl:with-param name="iText"    select="'Bus connections'"/>
1016                         <xsl:with-param name="iClass"   select="'key_label_ul'"/>
1017                 </xsl:call-template>
1018                           
1019                 <use   x="110"  y="58"  xlink:href="#KEY_busconn_MASTER"/> 
1020                 <xsl:call-template name="F_WriteText">
1021                         <xsl:with-param name="iX"               select="'140'"/>
1022                         <xsl:with-param name="iY"               select="'72'"/>
1023                         <xsl:with-param name="iText"    select="'master or initiator'"/>
1024                         <xsl:with-param name="iClass"   select="'key_label'"/>
1025                 </xsl:call-template>
1026                           
1027                 <use   x="110"  y="{58 + (($BLKD_BIFC_H  + 4) * 1)}"  xlink:href="#KEY_busconn_SLAVE"/> 
1028                 <xsl:call-template name="F_WriteText">
1029                         <xsl:with-param name="iX"               select="'140'"/>
1030                         <xsl:with-param name="iY"               select="(72 + (($BLKD_BIFC_H + 4) * 1))"/>
1031                         <xsl:with-param name="iText"    select="'slave or target'"/>
1032                         <xsl:with-param name="iClass"   select="'key_label'"/>
1033                 </xsl:call-template>
1034                           
1035                 <use   x="110"  y="{58 + (($BLKD_BIFC_H  + 4) * 2)}"  xlink:href="#KEY_busconn_MASTER_SLAVE"/> 
1036                 <xsl:call-template name="F_WriteText">
1037                         <xsl:with-param name="iX"               select="'140'"/>
1038                         <xsl:with-param name="iY"               select="(72 + (($BLKD_BIFC_H + 4) * 2))"/>
1039                         <xsl:with-param name="iText"    select="'master slave'"/>
1040                         <xsl:with-param name="iClass"   select="'key_label'"/>
1041                 </xsl:call-template>
1042                           
1043                           
1044                 <use   x="110"  y="{58 + (($BLKD_BIFC_H  + 4) * 3)}"  xlink:href="#KEY_busconn_MONITOR"/>
1045                 <xsl:call-template name="F_WriteText">
1046                         <xsl:with-param name="iX"               select="'140'"/>
1047                         <xsl:with-param name="iY"               select="(72 + (($BLKD_BIFC_H + 4) * 3))"/>
1048                         <xsl:with-param name="iText"    select="'monitor'"/>
1049                         <xsl:with-param name="iClass"   select="'key_label'"/>
1050                 </xsl:call-template>
1051                           
1052 <!-- 
1053         ==================================                                      
1054                         EXTERNAL PORTS
1055         ==================================                                      
1056 -->             
1057                 <xsl:call-template name="F_WriteText">
1058                         <xsl:with-param name="iX"               select="'258'"/>
1059                         <xsl:with-param name="iY"               select="'47'"/>
1060                         <xsl:with-param name="iText"    select="'External Ports'"/>
1061                         <xsl:with-param name="iClass"   select="'key_label_ul'"/>
1062                 </xsl:call-template>                      
1063                           
1064                 <use   x="258"  y="58"  xlink:href="#KEY_INPort"/> 
1065                 <xsl:call-template name="F_WriteText">
1066                         <xsl:with-param name="iX"               select="'288'"/>
1067                         <xsl:with-param name="iY"               select="'72'"/>
1068                         <xsl:with-param name="iText"    select="'input'"/>
1069                         <xsl:with-param name="iClass"   select="'key_label'"/>
1070                 </xsl:call-template>
1071                           
1072                 <use   x="258"  y="{58 + ($BLKD_IOP_H * 1) + 4}"  xlink:href="#KEY_OUTPort"/> 
1073                 <xsl:call-template name="F_WriteText">
1074                         <xsl:with-param name="iX"               select="'288'"/>
1075                         <xsl:with-param name="iY"               select="(72 + ($BLKD_IOP_H * 1) + 4)"/>
1076                         <xsl:with-param name="iText"    select="'output'"/>
1077                         <xsl:with-param name="iClass"   select="'key_label'"/>
1078                 </xsl:call-template>
1079                         
1080                 <use   x="258"  y="{58 + ($BLKD_IOP_H * 2) + 8}"  xlink:href="#KEY_INOUTPort"/> 
1081                 <xsl:call-template name="F_WriteText">
1082                         <xsl:with-param name="iX"               select="'288'"/>
1083                         <xsl:with-param name="iY"               select="(72 + ($BLKD_IOP_H * 2) + 8)"/>
1084                         <xsl:with-param name="iText"    select="'inout'"/>
1085                         <xsl:with-param name="iClass"   select="'key_label'"/>
1086                 </xsl:call-template>
1087                 
1088                 
1089 <!-- 
1090         ==================================                                      
1091                         INTERRUPTS 
1092         ==================================                                      
1093 -->             
1094                 <xsl:call-template name="F_WriteText">
1095                         <xsl:with-param name="iX"               select="'380'"/>
1096                         <xsl:with-param name="iY"               select="'47'"/>
1097                         <xsl:with-param name="iText"    select="'Interrupts'"/>
1098                         <xsl:with-param name="iClass"   select="'key_label_ul'"/>
1099                 </xsl:call-template>                      
1100                           
1101                 <use   x="380"  y="58"  xlink:href="#KEY_IntrCntrl"/> 
1102                 <xsl:call-template name="F_WriteText">
1103                         <xsl:with-param name="iX"               select="'396'"/>
1104                         <xsl:with-param name="iY"               select="'64'"/>
1105                         <xsl:with-param name="iText"    select="'Interrupt'"/>
1106                         <xsl:with-param name="iClass"   select="'key_label_small'"/>
1107                 </xsl:call-template>                      
1108                 <xsl:call-template name="F_WriteText">
1109                         <xsl:with-param name="iX"               select="'396'"/>
1110                         <xsl:with-param name="iY"               select="'74'"/>
1111                         <xsl:with-param name="iText"    select="'Controller'"/>
1112                         <xsl:with-param name="iClass"   select="'key_label_small'"/>
1113                 </xsl:call-template>                      
1114                           
1115                 
1116                 <use   x="380"  y="88"  xlink:href="#KEY_IntrdProc"/> 
1117                 <xsl:call-template name="F_WriteText">
1118                         <xsl:with-param name="iX"               select="'396'"/>
1119                         <xsl:with-param name="iY"               select="'94'"/>
1120                         <xsl:with-param name="iText"    select="'Interrupt'"/>
1121                         <xsl:with-param name="iClass"   select="'key_label'"/>
1122                 </xsl:call-template>                      
1123                 <xsl:call-template name="F_WriteText">
1124                         <xsl:with-param name="iX"               select="'396'"/>
1125                         <xsl:with-param name="iY"               select="'104'"/>
1126                         <xsl:with-param name="iText"    select="'Target'"/>
1127                         <xsl:with-param name="iClass"   select="'key_label_small'"/>
1128                 </xsl:call-template>                      
1129                 
1130                 
1131                 <use   x="380"  y="118"  xlink:href="#KEY_IntrSrc"/> 
1132                 <xsl:call-template name="F_WriteText">
1133                         <xsl:with-param name="iX"               select="'400'"/>
1134                         <xsl:with-param name="iY"               select="'124'"/>
1135                         <xsl:with-param name="iText"    select="'Interrupt'"/>
1136                         <xsl:with-param name="iClass"   select="'key_label_small'"/>
1137                 </xsl:call-template>                      
1138                 <xsl:call-template name="F_WriteText">
1139                         <xsl:with-param name="iX"               select="'400'"/>
1140                         <xsl:with-param name="iY"               select="'134'"/>
1141                         <xsl:with-param name="iText"    select="'Source'"/>
1142                         <xsl:with-param name="iClass"   select="'key_label_small'"/>
1143                 </xsl:call-template>                      
1144                           
1145                 <xsl:call-template name="F_WriteText">
1146                         <xsl:with-param name="iX"               select="'360'"/>
1147                         <xsl:with-param name="iY"               select="'146'"/>
1148                         <xsl:with-param name="iText"    select="'X = Controller ID'"/>
1149                         <xsl:with-param name="iClass"   select="'key_label_small'"/>
1150                 </xsl:call-template>                      
1151                 <xsl:call-template name="F_WriteText">
1152                         <xsl:with-param name="iX"               select="'360'"/>
1153                         <xsl:with-param name="iY"               select="'156'"/>
1154                         <xsl:with-param name="iText"    select="'Y = Interrupt Priority'"/>
1155                         <xsl:with-param name="iClass"   select="'key_label_small'"/>
1156                 </xsl:call-template>                      
1157                 
1158 <!-- 
1159         ==================================                                      
1160                         COLORS 
1161         ==================================                                      
1162 -->             
1163                 <rect x="0"
1164                           y="160"
1165                       width= "{$BLKD_KEY_W}"
1166                       height="16"
1167                           style="fill:{$COL_BG_LT}; stroke:none;"/>             
1168                           
1169                 <xsl:call-template name="F_WriteText">
1170                         <xsl:with-param name="iX"               select="ceiling($BLKD_KEY_W div 2)"/>
1171                         <xsl:with-param name="iY"               select="'172'"/>
1172                         <xsl:with-param name="iText"    select="'COLORS'"/>
1173                         <xsl:with-param name="iClass"   select="'key_header'"/>
1174                 </xsl:call-template>
1175                 
1176 <!-- 
1177                 <text class="keylblul"
1178               x="110"
1179                           y="190">Bus Standards</text>            
1180 -->                       
1181                 <xsl:call-template name="F_WriteText">
1182                         <xsl:with-param name="iX"               select="'110'"/>
1183                         <xsl:with-param name="iY"               select="'190'"/>
1184                         <xsl:with-param name="iText"    select="'Bus Standard'"/>
1185                         <xsl:with-param name="iClass"   select="'key_label'"/>
1186                 </xsl:call-template>
1187                 
1188                 <xsl:variable name="dcr_col_">
1189                         <xsl:call-template name="F_BusStd2RGB">
1190                                 <xsl:with-param name="iBusStd" select="'DCR'"/>
1191                         </xsl:call-template>    
1192                 </xsl:variable>
1193                 
1194                 <rect x="{12 + ((12 + $BLKD_BIFC_W + 36) * 0)}"
1195                           y="200"
1196                       width= "{$BLKD_BIFC_H}"
1197                       height="{$BLKD_BIFC_W}"
1198                           style="fill:{$dcr_col_}; stroke:none;"/>              
1199                           
1200 <!-- 
1201                 <text class="keylabel"
1202               x="{12  + $BLKD_BIFC_W + 4}"
1203                           y="{200 + (($BLKD_BIF_H + 4) * 1)}">DCR</text>
1204 -->                       
1205                 <xsl:call-template name="F_WriteText">
1206                         <xsl:with-param name="iX"               select="(12  + $BLKD_BIFC_W + 4)"/>
1207                         <xsl:with-param name="iY"               select="(200 + (($BLKD_BIF_H + 4) * 1))"/>
1208                         <xsl:with-param name="iText"    select="'DCR'"/>
1209                         <xsl:with-param name="iClass"   select="'key_label'"/>
1210                 </xsl:call-template>
1211                           
1212                 <xsl:variable name="fcb_col_">
1213                         <xsl:call-template name="F_BusStd2RGB">
1214                                 <xsl:with-param name="iBusStd" select="'FCB'"/>
1215                         </xsl:call-template>    
1216                 </xsl:variable>
1217                 
1218                 <rect x="{12  + ((12 + $BLKD_BIFC_W + 36) * 0)}"
1219                           y="{200 + (($BLKD_BIFC_H + 4) * 1)}"
1220                       width= "{$BLKD_BIFC_H}"
1221                       height="{$BLKD_BIFC_W}"
1222                           style="fill:{$fcb_col_}; stroke:none;"/>              
1223                           
1224 <!-- 
1225                 <text class="keylabel"
1226               x="{12  + $BLKD_BIFC_W + 4}"
1227                           y="{200 + (($BLKD_BIF_H + 4) * 2)}">FCB</text>                  
1228 -->                       
1229                 <xsl:call-template name="F_WriteText">
1230                         <xsl:with-param name="iX"               select="(12  + $BLKD_BIFC_W + 4)"/>
1231                         <xsl:with-param name="iY"               select="(200 + (($BLKD_BIF_H + 4) * 2))"/>
1232                         <xsl:with-param name="iText"    select="'FCB'"/>
1233                         <xsl:with-param name="iClass"   select="'key_label'"/>
1234                 </xsl:call-template>
1235                 
1236                 <xsl:variable name="fsl_col_">
1237                         <xsl:call-template name="F_BusStd2RGB">
1238                                 <xsl:with-param name="iBusStd" select="'FSL'"/>
1239                         </xsl:call-template>    
1240                 </xsl:variable>
1241                           
1242                 <rect x="{12 + ((12 + $BLKD_BIFC_W + 36) * 1)}"
1243                           y="200"
1244                       width= "{$BLKD_BIFC_H}"
1245                       height="{$BLKD_BIFC_W}"
1246                           style="fill:{$fsl_col_}; stroke:none;"/>              
1247 <!-- 
1248                 <text class="keylabel"
1249               x="{12  +  ($BLKD_BIFC_W + 4) + ((12 + $BLKD_BIFC_W + 36) * 1)}"
1250                           y="{200 + (($BLKD_BIF_H + 4) * 1)}">FSL</text>                  
1251 -->
1252
1253                 <xsl:call-template name="F_WriteText">
1254                         <xsl:with-param name="iX"               select="(12  +  ($BLKD_BIFC_W + 4) + ((12 + $BLKD_BIFC_W + 36) * 1))"/>
1255                         <xsl:with-param name="iY"               select="(200 + (($BLKD_BIF_H + 4) * 1))"/>
1256                         <xsl:with-param name="iText"    select="'FSL'"/>
1257                         <xsl:with-param name="iClass"   select="'key_label'"/>
1258                 </xsl:call-template>
1259                 
1260                 <xsl:variable name="col_lmb_">
1261                         <xsl:call-template name="F_BusStd2RGB">
1262                                 <xsl:with-param name="iBusStd" select="'LMB'"/>
1263                         </xsl:call-template>    
1264                 </xsl:variable>
1265                           
1266                 <rect x="{12 + ((12 + $BLKD_BIFC_W + 36) * 1)}"
1267                           y="{200 + (($BLKD_BIFC_H + 4) * 1)}"
1268                       width= "{$BLKD_BIFC_H}"
1269                       height="{$BLKD_BIFC_W}"
1270                           style="fill:{$col_lmb_}; stroke:none;"/>              
1271 <!--
1272                 <text class="keylabel"
1273               x="{12  + ($BLKD_BIFC_W + 4) + ((12 + $BLKD_BIFC_W + 36) * 1)}"
1274                           y="{200 + (($BLKD_BIF_H + 4) * 2)}">LMB</text>                  
1275 -->                       
1276
1277                 <xsl:call-template name="F_WriteText">
1278                         <xsl:with-param name="iX"               select="(12  + ($BLKD_BIFC_W + 4) + ((12 + $BLKD_BIFC_W + 36) * 1))"/>
1279                         <xsl:with-param name="iY"               select="(200 + (($BLKD_BIF_H + 4) * 2))"/>
1280                         <xsl:with-param name="iText"    select="'LMB'"/>
1281                         <xsl:with-param name="iClass"   select="'key_label'"/>
1282                 </xsl:call-template>
1283                 
1284                 <xsl:variable name="opb_col_">
1285                         <xsl:call-template name="F_BusStd2RGB">
1286                                 <xsl:with-param name="iBusStd" select="'OPB'"/>
1287                         </xsl:call-template>    
1288                 </xsl:variable>
1289                           
1290                 <rect 
1291               x="{12 + ((12 + $BLKD_BIFC_W + 36) * 2)}"
1292                           y="200"
1293                       width= "{$BLKD_BIFC_H}"
1294                       height="{$BLKD_BIFC_W}"
1295                           style="fill:{$opb_col_}; stroke:none;"/>              
1296 <!-- 
1297                 <text class="keylabel"
1298               x="{12  +  ($BLKD_BIFC_W + 4) + ((12 + $BLKD_BIFC_W + 36) * 2)}"
1299                           y="{200 + (($BLKD_BIF_H + 4) * 1)}">OPB</text>
1300 -->                       
1301                 <xsl:call-template name="F_WriteText">
1302                         <xsl:with-param name="iX"               select="(12  +  ($BLKD_BIFC_W + 4) + ((12 + $BLKD_BIFC_W + 36) * 2))"/>
1303                         <xsl:with-param name="iY"               select="(200 + (($BLKD_BIF_H + 4) * 1))"/>
1304                         <xsl:with-param name="iText"    select="'OPB'"/>
1305                         <xsl:with-param name="iClass"   select="'key_label'"/>
1306                 </xsl:call-template>
1307                 
1308                 <xsl:variable name="plb_col_">
1309                         <xsl:call-template name="F_BusStd2RGB">
1310                                 <xsl:with-param name="iBusStd" select="'PLB'"/>
1311                         </xsl:call-template>    
1312                 </xsl:variable>
1313                 <rect 
1314               x="{12 + ((12 + $BLKD_BIFC_W + 36) * 2)}"
1315                           y="{200 + (($BLKD_BIFC_H + 4) * 1)}"
1316                       width= "{$BLKD_BIFC_H}"
1317                       height="{$BLKD_BIFC_W}"
1318                           style="fill:{$plb_col_}; stroke:none;"/>              
1319 <!--
1320                 <text class="keylabel"
1321               x="{12  +  ($BLKD_BIFC_W + 4) + ((12 + $BLKD_BIFC_W + 36) * 2)}"
1322                           y="{200 + (($BLKD_BIF_H + 4) * 2)}">PLB</text>                  
1323 -->                       
1324                 <xsl:call-template name="F_WriteText">
1325                         <xsl:with-param name="iX"               select="(12  +  ($BLKD_BIFC_W + 4) + ((12 + $BLKD_BIFC_W + 36) * 2))"/>
1326                         <xsl:with-param name="iY"               select="(200 + (($BLKD_BIF_H + 4) * 2))"/>
1327                         <xsl:with-param name="iText"    select="'PLB'"/>
1328                         <xsl:with-param name="iClass"   select="'key_header'"/>
1329                 </xsl:call-template>
1330                 
1331                          
1332                 <xsl:variable name="ocm_col_">
1333                         <xsl:call-template name="F_BusStd2RGB">
1334                                 <xsl:with-param name="iBusStd" select="'OCM'"/>
1335                         </xsl:call-template>    
1336                 </xsl:variable>
1337                           
1338                 <rect 
1339               x="{12 + ((12 + $BLKD_BIFC_W + 36) * 3)}"
1340                           y="200"
1341                       width= "{$BLKD_BIFC_H}"
1342                       height="{$BLKD_BIFC_W}"
1343                           style="fill:{$ocm_col_}; stroke:none;"/>              
1344 <!--
1345                 <text class="keylabel"
1346               x="{12  + ($BLKD_BIFC_W + 4) + ((12 + $BLKD_BIFC_W + 36) * 3)}"
1347                           y="{200 + (($BLKD_BIF_H + 4) * 1)}">SOCM</text>
1348  -->                      
1349                 
1350                 <xsl:call-template name="F_WriteText">
1351                         <xsl:with-param name="iX"               select="(12  + ($BLKD_BIFC_W + 4) + ((12 + $BLKD_BIFC_W + 36) * 3))"/>
1352                         <xsl:with-param name="iY"               select="(200 + (($BLKD_BIF_H + 4) * 1))"/>
1353                         <xsl:with-param name="iText"    select="'SOCM'"/>
1354                         <xsl:with-param name="iClass"   select="'key_label'"/>
1355                 </xsl:call-template>
1356                 
1357                 
1358                 <xsl:variable name="xil_p2p_col_">
1359                         <xsl:call-template name="F_BusStd2RGB">
1360                                 <xsl:with-param name="iBusStd" select="'XIL'"/>
1361                         </xsl:call-template>    
1362                 </xsl:variable>
1363                           
1364                 <rect 
1365               x="{12 + ((12 + $BLKD_BIFC_W + 36) * 3)}"
1366                           y="{200 + (($BLKD_BIFC_H + 4) * 1)}"
1367                       width= "{$BLKD_BIFC_H}"
1368                       height="{$BLKD_BIFC_W}"
1369                           style="fill:{$xil_p2p_col_}; stroke:none;"/>          
1370 <!--
1371                 <text class="keylabel"
1372               x="{12  + ($BLKD_BIFC_W + 4) + ((12 + $BLKD_BIFC_W + 36) * 3)}"
1373                           y="{200 + (($BLKD_BIF_H + 4) * 2)}">Xilinx P2P</text>
1374 -->                       
1375                 <xsl:call-template name="F_WriteText">
1376                         <xsl:with-param name="iX"               select="(12  + ($BLKD_BIFC_W + 4) + ((12 + $BLKD_BIFC_W + 36) * 3))"/>
1377                         <xsl:with-param name="iY"               select="(200 + (($BLKD_BIF_H + 4) * 2))"/>
1378                         <xsl:with-param name="iText"    select="'Xilinx P2P'"/>
1379                         <xsl:with-param name="iClass"   select="'key_label'"/>
1380                 </xsl:call-template>
1381                 
1382                           
1383                 <xsl:variable name="user_p2p_col_">
1384                         <xsl:call-template name="F_BusStd2RGB">
1385                                 <xsl:with-param name="iBusStd" select="'USER'"/>
1386                         </xsl:call-template>    
1387                 </xsl:variable>
1388                           
1389                 <rect x="{12 + ((12 + $BLKD_BIFC_W + 36) * 4)}"
1390                           y="200"
1391                       width= "{$BLKD_BIFC_H}"
1392                       height="{$BLKD_BIFC_W}"
1393                           style="fill:{$user_p2p_col_}; stroke:none;"/>         
1394 <!-- 
1395                 <text class="keylabel"
1396               x="{12  + ($BLKD_BIFC_W + 4) + ((12 + $BLKD_BIFC_W + 36) * 4)}"
1397                           y="{200 + (($BLKD_BIF_H + 4) * 1)}">USER P2P</text>             
1398 -->                       
1399
1400                 <xsl:call-template name="F_WriteText">
1401                         <xsl:with-param name="iX"               select="(12  + ($BLKD_BIFC_W + 4) + ((12 + $BLKD_BIFC_W + 36) * 4))"/>
1402                         <xsl:with-param name="iY"               select="(200 + (($BLKD_BIF_H + 4) * 1))"/>
1403                         <xsl:with-param name="iText"    select="'USER P2P'"/>
1404                         <xsl:with-param name="iClass"   select="'key_label'"/>
1405                 </xsl:call-template>
1406                 
1407  
1408 </g>    
1409 </xsl:template>
1410
1411 <xsl:template name="Define_BlkDiagram_Specs">
1412
1413         <xsl:param name="iArch"       select="'NA'"/>
1414         <xsl:param name="iPart"       select="'NA'"/>
1415         <xsl:param name="iTimeStamp"  select="'NA'"/>
1416         <xsl:param name="iEdkVersion" select="'NA'"/>
1417                         
1418         <g id="BlkDiagram_Specs">
1419                 <rect 
1420               x="0"
1421                           y="0"
1422                       width= "{$BLKD_SPECS_W}"
1423                       height="{$BLKD_SPECS_H}"
1424                           style="fill:{$COL_BG}; stroke:none;"/>                
1425                           
1426                 <rect 
1427               x="0"
1428                           y="0"
1429                       width= "{$BLKD_SPECS_W}"
1430                       height="16"
1431                           style="fill:{$COL_BG}; stroke:none;"/>                
1432 <!-- 
1433         ==================================                                      
1434                                         SPEC HEADER
1435         ==================================                                      
1436 -->             
1437                 <xsl:call-template name="F_WriteText">
1438                         <xsl:with-param name="iClass"   select="'key_title'"/>
1439                         <xsl:with-param name="iX"               select="ceiling($BLKD_SPECS_W div 2)"/>
1440                         <xsl:with-param name="iY"               select="'14'"/>
1441                         <xsl:with-param name="iText"    select="'SPECS'"/>
1442                 </xsl:call-template>                      
1443 <!-- 
1444                 <text class="keytitle"
1445               x="{ceiling($BLKD_SPECS_W div 2)} "
1446                           y="14">SPECS</text>
1447 -->                       
1448         
1449 <!-- 
1450         ==================================                                      
1451                         EDK VERSION
1452         ==================================                                      
1453 -->             
1454                 <rect x="0"
1455                           y="20"
1456                       width= "{$BLKD_SPECS_W}"
1457                       height="16"
1458                           style="fill:{$COL_BG_LT}; stroke:none;"/>             
1459                 <xsl:call-template name="F_WriteText">
1460                         <xsl:with-param name="iClass"   select="'blkd_spec_name'"/>
1461                         <xsl:with-param name="iX"               select="'4'"/>
1462                         <xsl:with-param name="iY"               select="'32'"/>
1463                         <xsl:with-param name="iText"    select="'EDK VERSION'"/>
1464                 </xsl:call-template>
1465                           
1466                 <xsl:call-template name="F_WriteText">
1467                         <xsl:with-param name="iClass"   select="'blkd_spec_value_mid'"/>
1468                         <xsl:with-param name="iX"               select="($BLKD_SPECS_W + 1) - ceiling($BLKD_SPECS_W div 5)"/>
1469                         <xsl:with-param name="iY"               select="'32'"/>
1470                         <xsl:with-param name="iText"    select="$iEdkVersion"/>
1471                 </xsl:call-template>                      
1472                 
1473 <!-- 
1474         ==================================                                      
1475                                         ARCH
1476         ==================================                                      
1477 -->             
1478                 <rect x="0"
1479                           y="40"
1480                       width= "{$BLKD_SPECS_W}"
1481                       height="16"
1482                           style="fill:{$COL_BG_LT}; stroke:none;"/>             
1483                           
1484                 <xsl:call-template name="F_WriteText">
1485                         <xsl:with-param name="iClass"   select="'blkd_spec_name'"/>
1486                         <xsl:with-param name="iX"               select="'4'"/>
1487                         <xsl:with-param name="iY"               select="'52'"/>
1488                         <xsl:with-param name="iText"    select="'ARCH'"/>
1489                 </xsl:call-template>                      
1490                 
1491                 <xsl:call-template name="F_WriteText">
1492                         <xsl:with-param name="iClass"   select="'blkd_spec_value_mid'"/>
1493                         <xsl:with-param name="iX"               select="($BLKD_SPECS_W + 1) - ceiling($BLKD_SPECS_W div 5)"/>
1494                         <xsl:with-param name="iY"               select="'52'"/>
1495                         <xsl:with-param name="iText"    select="$iArch"/>
1496                 </xsl:call-template>                      
1497                 
1498 <!--            
1499                 <text class="specsvalue"
1500               x="{($BLKD_SPECS_W + 1) - (string-length($blkd_arch) * 6.5)}"
1501                           y="52"><xsl:value-of select="$blkd_arch"/></text>
1502                 <text class="specsvaluemid"
1503               x="{($BLKD_SPECS_W + 1) - ceiling($BLKD_SPECS_W div 5)}"
1504                           y="52"><xsl:value-of select="$iArch"/></text>
1505 -->             
1506
1507 <!-- 
1508         ==================================                                      
1509                                         PART
1510         ==================================                                      
1511 -->             
1512                 <rect x="0"
1513                           y="60"
1514                       width= "{$BLKD_SPECS_W}"
1515                       height="16"
1516                           style="fill:{$COL_BG_LT}; stroke:none;"/>             
1517                           
1518                 <xsl:call-template name="F_WriteText">
1519                         <xsl:with-param name="iClass"   select="'blkd_spec_name'"/>
1520                         <xsl:with-param name="iX"               select="'4'"/>
1521                         <xsl:with-param name="iY"               select="'72'"/>
1522                         <xsl:with-param name="iText"    select="'PART'"/>
1523                 </xsl:call-template>                      
1524                           
1525                 <xsl:call-template name="F_WriteText">
1526                         <xsl:with-param name="iClass"   select="'blkd_spec_value_mid'"/>
1527                         <xsl:with-param name="iX"               select="($BLKD_SPECS_W + 1) - ceiling($BLKD_SPECS_W div 5)"/>
1528                         <xsl:with-param name="iY"               select="'72'"/>
1529                         <xsl:with-param name="iText"    select="$iPart"/>
1530                 </xsl:call-template>                      
1531                 
1532 <!-- 
1533         ==================================                                      
1534                                         TIMESTAMP
1535         ==================================                                      
1536 -->             
1537                           
1538                 <rect x="0"
1539                           y="80"
1540                       width= "{$BLKD_SPECS_W}"
1541                       height="16"
1542                           style="fill:{$COL_BG_LT}; stroke:none;"/>             
1543
1544                 <xsl:call-template name="F_WriteText">
1545                         <xsl:with-param name="iClass"   select="'blkd_spec_name'"/>
1546                         <xsl:with-param name="iX"               select="'4'"/>
1547                         <xsl:with-param name="iY"               select="'92'"/>
1548                         <xsl:with-param name="iText"    select="'GENERATED'"/>
1549                 </xsl:call-template>                      
1550                 
1551                 <xsl:call-template name="F_WriteText">
1552                         <xsl:with-param name="iClass"   select="'blkd_spec_value_mid'"/>
1553                         <xsl:with-param name="iX"               select="($BLKD_SPECS_W  + 1) - (string-length($iTimeStamp) * 3.5)"/>
1554                         <xsl:with-param name="iY"               select="'92'"/>
1555                         <xsl:with-param name="iText"    select="$iTimeStamp"/>
1556                 </xsl:call-template>                      
1557         </g>    
1558 </xsl:template>
1559         
1560         
1561 </xsl:stylesheet>
1562
1563 <!-- =========================================================================== -->
1564 <!--                          FUNCTION TEMPLATE                                  -->
1565 <!--                                                                                                                                                     -->
1566 <!-- =========================================================================== -->