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