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