]> git.sur5r.net Git - freertos/blob - Demo/PPC440_DP_FPU_Xilinx_Virtex5_GCC/__xps/.dswkshop/MdtTinySvgBLKD_IOPorts.xsl
Start to re-arrange files to include FreeRTOS+ in main download.
[freertos] / Demo / PPC440_DP_FPU_Xilinx_Virtex5_GCC / __xps / .dswkshop / MdtTinySvgBLKD_IOPorts.xsl
1 <?xml version="1.0" standalone="no"?>
2 <xsl:stylesheet version="1.0"
3            xmlns:svg="http://www.w3.org/2000/svg"
4            xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5            xmlns:math="http://exslt.org/math"
6            xmlns:exsl="http://exslt.org/common"
7            xmlns:xlink="http://www.w3.org/1999/xlink"
8            extension-element-prefixes="math">
9            
10 <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"
11                doctype-public="-//W3C//DTD SVG 1.0//EN"
12                    doctype-system="http://www.w3.org/TR/SVG/DTD/svg10.dtd"/>
13                         
14         
15 <!-- ======================= DEF BLOCK =============================== -->
16 <xsl:template name="Define_IOPorts">
17         
18         <xsl:variable name="key_col_">
19                 <xsl:call-template name="F_BusStd2RGB">
20                         <xsl:with-param name="iBusStd" select="'KEY'"/>
21                 </xsl:call-template>    
22         </xsl:variable>
23         
24                 <xsl:variable name="key_lt_col_">
25                         <xsl:call-template name="F_BusStd2RGB_LT">
26                                 <xsl:with-param name="iBusStd" select="'KEY'"/>
27                         </xsl:call-template>    
28                 </xsl:variable>
29
30          <g id="G_IOPort">
31                 <rect  
32                         x="0"  
33                         y="0" 
34                         width= "{$BLKD_IOP_W}" 
35                         height="{$BLKD_IOP_H}" style="fill:{$COL_IORING_LT}; stroke:{$COL_IORING}; stroke-width:1"/> 
36                         
37                 <path class="ioport"
38                           d="M   0,0
39                                  L   {$BLKD_IOP_W},{ceiling($BLKD_IOP_H div 2)}
40                                  L   0,{$BLKD_IOP_H}
41                                  Z" style="stroke:none; fill:{$COL_SYSPRT}"/>   
42         </g>
43
44          <g id="G_BIPort">
45                 <rect  
46                         x="0"  
47                         y="0" 
48                         width= "{$BLKD_IOP_W}" 
49                         height="{$BLKD_IOP_H}" style="fill:{$COL_IORING_LT}; stroke:{$COL_IORING}; stroke-width:1"/> 
50                         
51                 <path class="btop"
52                           d="M 0,{ceiling($BLKD_IOP_H div 2)}
53                                  {ceiling($BLKD_IOP_W div 2)},0
54                                  {$BLKD_IOP_W},{ceiling($BLKD_IOP_H div 2)}
55                                  Z" style="stroke:none; fill:{$COL_SYSPRT}"/>   
56                                  
57                 <path class="bbot"
58                           d="M 0,{ceiling($BLKD_IOP_H div 2)}
59                                  {ceiling($BLKD_IOP_W div 2)},{$BLKD_IOP_H}
60                                  {$BLKD_IOP_W},{ceiling($BLKD_IOP_H div 2)}
61                                  Z" style="stroke:none; fill:{$COL_SYSPRT}"/>   
62                                  
63         </g>
64
65          <g id="KEY_IOPort">
66                 <rect  
67                         x="0"  
68                         y="0" 
69                         width= "{$BLKD_IOP_W}" 
70                         height="{$BLKD_IOP_H}" style="fill:{$key_lt_col_}; stroke:none;"/> 
71                         
72                 <path class="ioport"
73                           d="M   0,0
74                                  L   {$BLKD_IOP_W},{ceiling($BLKD_IOP_H div 2)}
75                                  L   0,{$BLKD_IOP_H}
76                                  Z" style="stroke:none; fill:{$key_col_}"/>     
77         </g>
78         
79          <g id="KEY_BIPort">
80                 <rect  
81                         x="0"  
82                         y="0" 
83                         width= "{$BLKD_IOP_W}" 
84                         height="{$BLKD_IOP_H}" style="fill:{$key_lt_col_}; stroke:none;"/> 
85                         
86                 <path class="btop"
87                           d="M 0,{ceiling($BLKD_IOP_H div 2)}
88                                  {ceiling($BLKD_IOP_W div 2)},0
89                                  {$BLKD_IOP_W},{ceiling($BLKD_IOP_H div 2)}
90                                  Z" style="stroke:none; fill:{$key_col_}"/>     
91                                  
92                 <path class="bbot"
93                           d="M 0,{ceiling($BLKD_IOP_H div 2)}
94                                  {ceiling($BLKD_IOP_W div 2)},{$BLKD_IOP_H}
95                                  {$BLKD_IOP_W},{ceiling($BLKD_IOP_H div 2)}
96                                  Z" style="stroke:none; fill:{$key_col_}"/>
97         </g>
98         
99          <g id="KEY_INPort">
100                 <use   x="0"   y="0"   xlink:href="#KEY_IOPort"/>
101                 <rect  
102                         x="{$BLKD_IOP_W}"  
103                         y="0" 
104                         width= "{ceiling($BLKD_IOP_W div 2)}" 
105                         height="{$BLKD_IOP_H}" style="fill:{$COL_SYSPRT}; stroke:none;"/> 
106         </g>
107         
108          <g id="KEY_OUTPort">
109                 <use   x="0"   y="0"   xlink:href="#KEY_IOPort" transform="scale(-1,1) translate({$BLKD_IOP_W * -1},0)"/>
110                 <rect  
111                         x="{$BLKD_IOP_W}"  
112                         y="0" 
113                         width= "{ceiling($BLKD_IOP_W div 2)}" 
114                         height="{$BLKD_IOP_H}" style="fill:{$COL_SYSPRT}; stroke:none;"/> 
115         </g>
116
117          <g id="KEY_INOUTPort">
118                 <use   x="0"   y="0"   xlink:href="#KEY_BIPort"/>
119                 <rect  
120                         x="{$BLKD_IOP_W}"  
121                         y="0" 
122                         width= "{ceiling($BLKD_IOP_W div 2)}" 
123                         height="{$BLKD_IOP_H}" style="fill:{$COL_SYSPRT}; stroke:none;"/> 
124         </g>
125 </xsl:template>
126
127 <!-- ======================= DRAW BLOCK =============================== -->
128
129 <xsl:template name="Draw_IOPorts"> 
130         
131         <xsl:variable name="ports_count_"    select="count($G_ROOT/EDKSYSTEM/EXTERNALPORTS/PORT)"/>
132         
133         <xsl:if test="($ports_count_ &gt; 30)">
134                 <xsl:call-template name="Draw_IOPorts_4Sides"/> 
135         </xsl:if>
136         
137         <xsl:if test="($ports_count_ &lt;= 30)">
138                 <xsl:call-template name="Draw_IOPorts_2Sides"/> 
139         </xsl:if>
140 </xsl:template>
141
142 <xsl:template name="Draw_IOPorts_2Sides"> 
143         
144         <xsl:variable name="ports_count_"    select="count($G_ROOT/EDKSYSTEM/EXTERNALPORTS/PORT)"/>
145         <xsl:variable name="ports_per_side_" select="ceiling($ports_count_ div 2)"/>
146         
147         <xsl:variable name="h_ofs_">
148                 <xsl:value-of select="$BLKD_PRTCHAN_W + ceiling(($G_Total_DrawArea_W  - (($ports_per_side_ * $BLKD_IOP_W) + (($ports_per_side_ - 1) * $BLKD_IOP_SPC))) div 2)"/>
149         </xsl:variable>
150         
151         <xsl:variable name="v_ofs_">
152                 <xsl:value-of select="$BLKD_PRTCHAN_H + ceiling(($G_Total_DrawArea_H  - (($ports_per_side_ * $BLKD_IOP_H) + (($ports_per_side_ - 1) * $BLKD_IOP_SPC))) div 2)"/>
153         </xsl:variable>
154         
155
156         <xsl:for-each select="EXTERNALPORTS/PORT">
157                 <xsl:sort data-type="number" select="@INDEX" order="ascending"/>
158                 
159                 <xsl:variable name="poffset_" select="0"/>
160                 <xsl:variable name="pcount_"  select="$poffset_ + (position() -1)"/>
161                 
162                 <xsl:variable name="pdir_">
163                         <xsl:choose>
164                                 <xsl:when test="(@DIR='I'  or @DIR='IN'  or @DIR='INPUT')">I</xsl:when>
165                                 <xsl:when test="(@DIR='O'  or @DIR='OUT' or @DIR='OUTPUT')">O</xsl:when>
166                                 <xsl:when test="(@DIR='IO' or @DIR='INOUT')">B</xsl:when>
167                                 <xsl:otherwise>I</xsl:otherwise>
168                         </xsl:choose>   
169                 </xsl:variable>
170                 
171                 <xsl:variable name="pside_">
172                         <xsl:choose>
173                                 <xsl:when test="($pcount_ &gt;= ($ports_per_side_ * 0) and ($pcount_ &lt; ($ports_per_side_ * 1)))">W</xsl:when>
174                                 <xsl:when test="($pcount_ &gt;= ($ports_per_side_ * 1) and ($pcount_ &lt; ($ports_per_side_ * 2)))">E</xsl:when>
175                                 <xsl:otherwise>D</xsl:otherwise>
176                         </xsl:choose>   
177                 </xsl:variable>
178                 
179                 <xsl:variable name="pdec_">
180                         <xsl:choose>
181                                 <xsl:when test="($pside_ = 'W')"><xsl:value-of select="($ports_per_side_ * 0)"/></xsl:when>
182                                 <xsl:when test="($pside_ = 'E')"><xsl:value-of select="($ports_per_side_ * 1)"/></xsl:when>
183                                 <xsl:otherwise>0</xsl:otherwise>
184                         </xsl:choose>   
185                 </xsl:variable>
186                 
187                 <xsl:variable name="px_">
188                         <xsl:choose>
189                                 <xsl:when test="($pside_ = 'W')"><xsl:value-of select="($BLKD_PRTCHAN_W - $BLKD_IOP_W)"/></xsl:when>
190                                 <xsl:when test="($pside_ = 'S')"><xsl:value-of select="($h_ofs_ + (((position() - 1) - $pdec_) * ($BLKD_IOP_SPC + $BLKD_IOP_W)) - 2)"/></xsl:when>
191                                 <xsl:when test="($pside_ = 'E')"><xsl:value-of select="($BLKD_PRTCHAN_W + ($BLKD_IORCHAN_W * 2) + $G_Total_DrawArea_W)"/></xsl:when>
192                                 <xsl:when test="($pside_ = 'N')"><xsl:value-of select="($h_ofs_ + (((position() - 1) - $pdec_) * ($BLKD_IOP_SPC + $BLKD_IOP_W)))"/></xsl:when>
193                                 <xsl:otherwise>0</xsl:otherwise>
194                         </xsl:choose>   
195                 </xsl:variable>
196                 
197                 <xsl:variable name="py_">
198                         <xsl:choose>
199                                 <xsl:when test="($pside_ = 'W')"><xsl:value-of select="($v_ofs_ + (((position() - 1) - $pdec_) * ($BLKD_IOP_SPC + $BLKD_IOP_H)))"/></xsl:when>
200                                 <xsl:when test="($pside_ = 'S')"><xsl:value-of select="($BLKD_PRTCHAN_H + ($BLKD_IORCHAN_H * 2) + $G_Total_DrawArea_H)"/></xsl:when>
201                                 <xsl:when test="($pside_ = 'E')"><xsl:value-of select="($v_ofs_ + (((position() - 1) - $pdec_) * ($BLKD_IOP_SPC + $BLKD_IOP_H)))"/></xsl:when>
202                                 <xsl:when test="($pside_ = 'N')"><xsl:value-of select="($BLKD_PRTCHAN_H - $BLKD_IOP_H)"/></xsl:when>
203                                 <xsl:otherwise>0</xsl:otherwise>
204                         </xsl:choose>   
205                 </xsl:variable>
206                 
207                 <xsl:variable name="prot_">
208                         <xsl:choose>
209                                 <xsl:when test="(($pside_ = 'W') and ($pdir_ = 'I'))">0</xsl:when>
210                                 <xsl:when test="(($pside_ = 'S') and ($pdir_ = 'I'))">-90</xsl:when>
211                                 <xsl:when test="(($pside_ = 'E') and ($pdir_ = 'I'))">180</xsl:when>
212                                 <xsl:when test="(($pside_ = 'N') and ($pdir_ = 'I'))">90</xsl:when>
213                                 
214                                 <xsl:when test="(($pside_ = 'W') and ($pdir_ = 'O'))">180</xsl:when>
215                                 <xsl:when test="(($pside_ = 'S') and ($pdir_ = 'O'))">90</xsl:when>
216                                 <xsl:when test="(($pside_ = 'E') and ($pdir_ = 'O'))">0</xsl:when>
217                                 <xsl:when test="(($pside_ = 'N') and ($pdir_ = 'O'))">-90</xsl:when>
218                                 
219                                 <xsl:when test="(($pside_ = 'W') and ($pdir_ = 'B'))">0</xsl:when>
220                                 <xsl:when test="(($pside_ = 'S') and ($pdir_ = 'B'))">0</xsl:when>
221                                 <xsl:when test="(($pside_ = 'E') and ($pdir_ = 'B'))">0</xsl:when>
222                                 <xsl:when test="(($pside_ = 'N') and ($pdir_ = 'B'))">0</xsl:when>
223                                 <xsl:otherwise>0</xsl:otherwise>
224                         </xsl:choose>   
225                 </xsl:variable>
226                 
227                 
228                 <xsl:variable name="txo_">
229                         <xsl:choose>
230                                 <xsl:when test="($pside_  = 'W')">-10</xsl:when>
231                                 <xsl:when test="($pside_  = 'S')">6</xsl:when>
232                                  <xsl:when test="($pside_ = 'E')"><xsl:value-of select="(($BLKD_IOP_W * 2) - 4)"/></xsl:when>
233                                 <xsl:when test="($pside_  = 'N')">6</xsl:when>
234                                 <xsl:otherwise>0</xsl:otherwise>
235                         </xsl:choose>   
236                 </xsl:variable>
237                 
238                 <xsl:variable name="tyo_">
239                         <xsl:choose>
240                                 <xsl:when test="($pside_ = 'W')"><xsl:value-of select="ceiling($BLKD_IOP_H div 2) + 6"/></xsl:when>
241                                 <xsl:when test="($pside_ = 'S')"><xsl:value-of select="($BLKD_IOP_H * 2) + 4"/></xsl:when>
242                                 <xsl:when test="($pside_ = 'E')"><xsl:value-of select="ceiling($BLKD_IOP_H div 2) + 6"/></xsl:when>
243                                 <xsl:when test="($pside_ = 'N')">-2</xsl:when>
244                                 <xsl:otherwise>0</xsl:otherwise>
245                         </xsl:choose>   
246                 </xsl:variable>
247
248                 <xsl:if test="$pdir_ = 'B'">       
249                         <use   x="{$px_}"  
250                                y="{$py_}"  
251                                    id="{@NAME}"
252                                xlink:href="#G_BIPort" 
253                                transform="rotate({$prot_},{$px_ + ceiling($BLKD_IOP_W div 2)},{$py_ + ceiling($BLKD_IOP_H div 2)})"/>
254                 </xsl:if>
255                 
256                 <xsl:if test="(($pside_ = 'S') and not($pdir_ = 'B'))">    
257                         <rect  
258                                 x="{$px_}"  
259                                 y="{$py_}" 
260                                 width= "{$BLKD_IOP_W}" 
261                                 height="{$BLKD_IOP_H}" style="stroke:{$COL_IORING}; stroke-width:1"/> 
262                 </xsl:if>
263                 
264                 <xsl:if test="not($pdir_ = 'B')">          
265                         <use   x="{$px_}"  
266                                y="{$py_}"  
267                                    id="{@NAME}"
268                                xlink:href="#G_IOPort" 
269                                transform="rotate({$prot_},{$px_ + ceiling($BLKD_IOP_W div 2)},{$py_ + ceiling($BLKD_IOP_H div 2)})"/>
270                 </xsl:if>
271                 
272                 <text class="iopnumb"
273                         x="{$px_ + $txo_}" 
274                         y="{$py_ + $tyo_}">
275                         <xsl:value-of select="@INDEX"/><tspan class="iopgrp"><xsl:value-of select="@GROUP"/></tspan>
276                 </text>
277                 
278         </xsl:for-each>
279         
280 </xsl:template>
281
282
283 <xsl:template name="Draw_IOPorts_4Sides"> 
284         
285         <xsl:variable name="ports_count_"    select="count($G_ROOT/EDKSYSTEM/EXTERNALPORTS/PORT)"/>
286         <xsl:variable name="ports_per_side_" select="ceiling($ports_count_ div 4)"/>
287         
288         <xsl:variable name="h_ofs_">
289                 <xsl:value-of select="$BLKD_PRTCHAN_W + ceiling(($G_Total_DrawArea_W  - (($ports_per_side_ * $BLKD_IOP_W) + (($ports_per_side_ - 1) * $BLKD_IOP_SPC))) div 2)"/>
290         </xsl:variable>
291         
292         <xsl:variable name="v_ofs_">
293                 <xsl:value-of select="$BLKD_PRTCHAN_H + ceiling(($G_Total_DrawArea_H  - (($ports_per_side_ * $BLKD_IOP_H) + (($ports_per_side_ - 1) * $BLKD_IOP_SPC))) div 2)"/>
294         </xsl:variable>
295         
296
297         <xsl:for-each select="$G_ROOT/EDKSYSTEM/EXTERNALPORTS/PORT">
298                 <xsl:sort data-type="number" select="@INDEX" order="ascending"/>
299                 
300                 <xsl:variable name="poffset_" select="0"/>
301                 <xsl:variable name="pcount_"  select="$poffset_ + (position() -1)"/>
302                 
303                 <xsl:variable name="pdir_">
304                         <xsl:choose>
305                                 <xsl:when test="(@DIR='I'  or @DIR='IN'  or @DIR='INPUT')">I</xsl:when>
306                                 <xsl:when test="(@DIR='O'  or @DIR='OUT' or @DIR='OUTPUT')">O</xsl:when>
307                                 <xsl:when test="(@DIR='IO' or @DIR='INOUT')">B</xsl:when>
308                                 <xsl:otherwise>I</xsl:otherwise>
309                         </xsl:choose>   
310                 </xsl:variable>
311                 
312                 <xsl:variable name="pside_">
313                         <xsl:choose>
314                                 <xsl:when test="($pcount_ &gt;= ($ports_per_side_ * 0) and ($pcount_ &lt; ($ports_per_side_ * 1)))">W</xsl:when>
315                                 <xsl:when test="($pcount_ &gt;= ($ports_per_side_ * 1) and ($pcount_ &lt; ($ports_per_side_ * 2)))">S</xsl:when>
316                                 <xsl:when test="($pcount_ &gt;= ($ports_per_side_ * 2) and ($pcount_ &lt; ($ports_per_side_ * 3)))">E</xsl:when>
317                                 <xsl:when test="($pcount_ &gt;= ($ports_per_side_ * 3) and ($pcount_ &lt; ($ports_per_side_ * 4)))">N</xsl:when>
318                                 <xsl:otherwise>D</xsl:otherwise>
319                         </xsl:choose>   
320                 </xsl:variable>
321                 
322                 <xsl:variable name="pdec_">
323                         <xsl:choose>
324                                 <xsl:when test="($pside_ = 'W')"><xsl:value-of select="($ports_per_side_ * 0)"/></xsl:when>
325                                 <xsl:when test="($pside_ = 'S')"><xsl:value-of select="($ports_per_side_ * 1)"/></xsl:when>
326                                 <xsl:when test="($pside_ = 'E')"><xsl:value-of select="($ports_per_side_ * 2)"/></xsl:when>
327                                 <xsl:when test="($pside_ = 'N')"><xsl:value-of select="($ports_per_side_ * 3)"/></xsl:when>
328                                 <xsl:otherwise>0</xsl:otherwise>
329                         </xsl:choose>   
330                 </xsl:variable>
331                 
332                 <xsl:variable name="px_">
333                         <xsl:choose>
334                                 <xsl:when test="($pside_ = 'W')"><xsl:value-of select="($BLKD_PRTCHAN_W - $BLKD_IOP_W)"/></xsl:when>
335                                 <xsl:when test="($pside_ = 'S')"><xsl:value-of select="($h_ofs_ + (((position() - 1) - $pdec_) * ($BLKD_IOP_SPC + $BLKD_IOP_W)) - 2)"/></xsl:when>
336                                 <xsl:when test="($pside_ = 'E')"><xsl:value-of select="($BLKD_PRTCHAN_W + ($BLKD_IORCHAN_W * 2) + $G_Total_DrawArea_W)"/></xsl:when>
337                                 <xsl:when test="($pside_ = 'N')"><xsl:value-of select="($h_ofs_ + (((position() - 1) - $pdec_) * ($BLKD_IOP_SPC + $BLKD_IOP_W)))"/></xsl:when>
338                                 <xsl:otherwise>0</xsl:otherwise>
339                         </xsl:choose>   
340                 </xsl:variable>
341                 
342                 <xsl:variable name="py_">
343                         <xsl:choose>
344                                 <xsl:when test="($pside_ = 'W')"><xsl:value-of select="($v_ofs_ + (((position() - 1) - $pdec_) * ($BLKD_IOP_SPC + $BLKD_IOP_H)))"/></xsl:when>
345                                 <xsl:when test="($pside_ = 'S')"><xsl:value-of select="($BLKD_PRTCHAN_H + ($BLKD_IORCHAN_H * 2) + $G_Total_DrawArea_H)"/></xsl:when>
346                                 <xsl:when test="($pside_ = 'E')"><xsl:value-of select="($v_ofs_ + (((position() - 1) - $pdec_) * ($BLKD_IOP_SPC + $BLKD_IOP_H)))"/></xsl:when>
347                                 <xsl:when test="($pside_ = 'N')"><xsl:value-of select="($BLKD_PRTCHAN_H - $BLKD_IOP_H)"/></xsl:when>
348                                 <xsl:otherwise>0</xsl:otherwise>
349                         </xsl:choose>   
350                 </xsl:variable>
351                 
352         
353                 <xsl:variable name="prot_">
354                         <xsl:choose>
355                                 <xsl:when test="(($pside_ = 'W') and ($pdir_ = 'I'))">0</xsl:when>
356                                 <xsl:when test="(($pside_ = 'S') and ($pdir_ = 'I'))">-90</xsl:when>
357                                 <xsl:when test="(($pside_ = 'E') and ($pdir_ = 'I'))">180</xsl:when>
358                                 <xsl:when test="(($pside_ = 'N') and ($pdir_ = 'I'))">90</xsl:when>
359                                 
360                                 <xsl:when test="(($pside_ = 'W') and ($pdir_ = 'O'))">180</xsl:when>
361                                 <xsl:when test="(($pside_ = 'S') and ($pdir_ = 'O'))">90</xsl:when>
362                                 <xsl:when test="(($pside_ = 'E') and ($pdir_ = 'O'))">0</xsl:when>
363                                 <xsl:when test="(($pside_ = 'N') and ($pdir_ = 'O'))">-90</xsl:when>
364                                 
365                                 <xsl:when test="(($pside_ = 'W') and ($pdir_ = 'B'))">0</xsl:when>
366                                 <xsl:when test="(($pside_ = 'S') and ($pdir_ = 'B'))">0</xsl:when>
367                                 <xsl:when test="(($pside_ = 'E') and ($pdir_ = 'B'))">0</xsl:when>
368                                 <xsl:when test="(($pside_ = 'N') and ($pdir_ = 'B'))">0</xsl:when>
369                                 <xsl:otherwise>0</xsl:otherwise>
370                         </xsl:choose>   
371                 </xsl:variable>
372                 
373                 <xsl:variable name="txo_">
374                         <xsl:choose>
375                                 <xsl:when test="($pside_  = 'W')">-14</xsl:when>
376                                 <xsl:when test="($pside_  = 'S')">8</xsl:when>
377                                  <xsl:when test="($pside_ = 'E')"><xsl:value-of select="(($BLKD_IOP_W * 2) - 4)"/></xsl:when>
378                                 <xsl:when test="($pside_  = 'N')">8</xsl:when>
379                                 <xsl:otherwise>0</xsl:otherwise>
380                         </xsl:choose>   
381                 </xsl:variable>
382                 
383                 <xsl:variable name="tyo_">
384                         <xsl:choose>
385                                 <xsl:when test="($pside_ = 'W')"><xsl:value-of select="ceiling($BLKD_IOP_H div 2) + 6"/></xsl:when>
386                                 <xsl:when test="($pside_ = 'S')"><xsl:value-of select="($BLKD_IOP_H * 2) + 4"/></xsl:when>
387                                 <xsl:when test="($pside_ = 'E')"><xsl:value-of select="ceiling($BLKD_IOP_H div 2) + 6"/></xsl:when>
388                                 <xsl:when test="($pside_ = 'N')">-2</xsl:when>
389                                 <xsl:otherwise>0</xsl:otherwise>
390                         </xsl:choose>   
391                 </xsl:variable>
392
393                 <xsl:if test="$pdir_ = 'B'">       
394                         <use   x="{$px_}"
395                                y="{$py_}"
396                                    id="{@NAME}"
397                                xlink:href="#G_BIPort" 
398                                transform="rotate({$prot_},{$px_ + ceiling($BLKD_IOP_W div 2)},{$py_ + ceiling($BLKD_IOP_H div 2)})"/>
399                 </xsl:if>
400                 
401                 <xsl:if test="(($pside_ = 'S') and not($pdir_ = 'B'))">    
402                         <rect  
403                                 x="{$px_}"
404                                 y="{$py_}"
405                                 width= "{$BLKD_IOP_W}"
406                                 height="{$BLKD_IOP_H}" style="stroke:{$COL_IORING}; stroke-width:1"/> 
407                 </xsl:if>
408                 
409                 <xsl:if test="not($pdir_ = 'B')">          
410                         <use   x="{$px_}"
411                                y="{$py_}"
412                                    id="{@NAME}"
413                                xlink:href="#G_IOPort"
414                                transform="rotate({$prot_},{$px_ + ceiling($BLKD_IOP_W div 2)},{$py_ + ceiling($BLKD_IOP_H div 2)})"/>
415                 </xsl:if>
416                 
417                 <text class="iopnumb"
418                         x="{$px_ + $txo_}" 
419                         y="{$py_ + $tyo_}"><xsl:value-of select="@INDEX"/><tspan class="iopgrp"><xsl:value-of select="@GROUP"/></tspan>
420                 </text>
421
422         </xsl:for-each>
423         
424 </xsl:template>
425         
426 <xsl:template name="Define_ExtPortsTable">
427         
428 <!--    
429                 <xsl:if test="$oriented_= 'WEST'"><xsl:value-of select="$proc2procX_ - (string-length(@BUSNAME) * 6)"/></xsl:if>        
430                 <xsl:variable name="max_name_" select="math:max(string-length($G_ROOT/EDKSYSTEM/EXTERNALPORTS/PORT/@NAME))"/>
431                 <xsl:variable name="max_sgnm_" select="math:max(string-length($G_ROOT/EDKSYSTEM/EXTERNALPORTS/PORT/@SIGNAME))"/>
432         
433                 <xsl:message>MAX NAME <xsl:value-of select="$max_name_"/></xsl:message>
434                 <xsl:message>MAX SIG  <xsl:value-of select="$max_sgnm_"/></xsl:message>
435 -->     
436         
437                 <xsl:variable name="ext_ports_">        
438                         <xsl:if test="not($G_ROOT/EDKSYSTEM/EXTERNALPORTS/PORT)">
439                                 <EXTPORT NAME="__none__" SIGNAME="__none_" NAMELEN="0" SIGLEN="0"/>
440                         </xsl:if>
441                         <xsl:if test="$G_ROOT/EDKSYSTEM/EXTERNALPORTS/PORT">
442                                 <xsl:for-each select="$G_ROOT/EDKSYSTEM/EXTERNALPORTS/PORT">
443                                         <EXTPORT  NAME="{@NAME}" SIGNAME="{@SIGNAME}" NAMELEN="{string-length(@NAME)}" SIGLEN="{string-length(@SIGNAME)}"/>
444                                 </xsl:for-each>
445                         </xsl:if>
446                 </xsl:variable>
447         
448                 <xsl:variable name="max_name_" select="math:max(exsl:node-set($ext_ports_)/EXTPORT/@NAMELEN)"/>
449                 <xsl:variable name="max_sign_" select="math:max(exsl:node-set($ext_ports_)/EXTPORT/@SIGLEN)"/>
450         
451                 <xsl:variable name="h_font_" select="12"/>
452                 <xsl:variable name="w_font_" select="12"/>
453         
454                 <xsl:variable name="w_num_"    select="($w_font_ * 5)"/>
455                 <xsl:variable name="w_dir_"    select="($w_font_ * 3)"/>
456                 <xsl:variable name="w_lsbmsb_" select="($w_font_ * 9)"/>
457                 <xsl:variable name="w_attr_"   select="($w_font_ * 4)"/>
458                 <xsl:variable name="w_name_"   select="($w_font_ * $max_name_)"/>
459                 <xsl:variable name="w_sign_"   select="($w_font_ * $max_sign_)"/>
460         
461                 <xsl:variable name="w_table_" select="($w_num_ + $w_name_ + $w_dir_ + $w_sign_ + $w_attr_)"/>
462         
463 <!--    
464                 <xsl:message>MAX NAME <xsl:value-of select="$max_name_"/></xsl:message>
465                 <xsl:message>MAX SIG  <xsl:value-of select="$max_sign_"/></xsl:message>
466         
467                 <xsl:message>W NUM  <xsl:value-of select="$w_num_"/></xsl:message>
468                 <xsl:message>W DIR  <xsl:value-of select="$w_dir_"/></xsl:message>
469                 <xsl:message>W NAM  <xsl:value-of select="$w_name_"/></xsl:message>
470                 <xsl:message>W SIG  <xsl:value-of select="$w_sign_"/></xsl:message>
471                 <xsl:message>W ATT  <xsl:value-of select="$w_attr_"/></xsl:message>
472         
473                 <xsl:message>W TABLE  <xsl:value-of select="$w_table_"/></xsl:message>
474 -->     
475         
476          <g id="BlkDiagram_ExtPortsTable">
477                 <rect  
478                         x="0"  
479                         y="0" 
480                         width= "{$w_table_}" 
481                         height="{$h_font_}"  style="fill:{$COL_RED}; stroke:none; stroke-width:1"/> 
482         </g>     
483         
484         
485         
486 </xsl:template>
487
488 <!-- ======================= END MAIN BLOCK =========================== -->
489
490 </xsl:stylesheet>