⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mdtsvgblkd_ioports.xsl

📁 microblaze下ucos移植源码
💻 XSL
📖 第 1 页 / 共 2 页
字号:
				<xsl:when test="($pside_ = 'S')"><xsl:value-of select="($BLKD_IOP_H * 2) + 4"/></xsl:when>				<xsl:when test="($pside_ = 'E')"><xsl:value-of select="ceiling($BLKD_IOP_H div 2) + 6"/></xsl:when>				<xsl:when test="($pside_ = 'N')">-2</xsl:when>				<xsl:otherwise>0</xsl:otherwise>			</xsl:choose>			</xsl:variable>		<xsl:if test="$pdir_ = 'B'">	   			<use   x="{$px_}"  			       y="{$py_}"  				   id="{@NAME}"			       xlink:href="#G_BIPort" 			       transform="rotate({$prot_},{$px_ + ceiling($BLKD_IOP_W div 2)},{$py_ + ceiling($BLKD_IOP_H div 2)})"/>		</xsl:if>				<xsl:if test="(($pside_ = 'S') and not($pdir_ = 'B'))">	   			<rect  				x="{$px_}"  				y="{$py_}" 				width= "{$BLKD_IOP_W}" 				height="{$BLKD_IOP_H}" style="stroke:{$COL_IORING}; stroke-width:1"/> 		</xsl:if>				<xsl:if test="not($pdir_ = 'B')">	   			<use   x="{$px_}"  			       y="{$py_}"  				   id="{@NAME}"			       xlink:href="#G_IOPort" 			       transform="rotate({$prot_},{$px_ + ceiling($BLKD_IOP_W div 2)},{$py_ + ceiling($BLKD_IOP_H div 2)})"/>		</xsl:if>				<text class="iopnumb"	  		x="{$px_ + $txo_}" 	  		y="{$py_ + $tyo_}">			<xsl:value-of select="@INDEX"/><tspan class="iopgrp"><xsl:value-of select="@GROUP"/></tspan>		</text>			</xsl:for-each>	</xsl:template><xsl:template name="Draw_IOPorts_4Sides"> 		<xsl:variable name="ports_count_"    select="count(EXTERNALPORTS/PORT)"/>	<xsl:variable name="ports_per_side_" select="ceiling($ports_count_ div 4)"/>		<xsl:variable name="h_ofs_">		<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)"/>	</xsl:variable>		<xsl:variable name="v_ofs_">		<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)"/>	</xsl:variable>		<xsl:for-each select="EXTERNALPORTS/PORT">		<xsl:sort data-type="number" select="@INDEX" order="ascending"/>				<xsl:variable name="poffset_" select="0"/>		<xsl:variable name="pcount_"  select="$poffset_ + (position() -1)"/>				<xsl:variable name="pdir_">			<xsl:choose>				<xsl:when test="(@DIR='I'  or @DIR='IN'  or @DIR='INPUT')">I</xsl:when>				<xsl:when test="(@DIR='O'  or @DIR='OUT' or @DIR='OUTPUT')">O</xsl:when>				<xsl:when test="(@DIR='IO' or @DIR='INOUT')">B</xsl:when>				<xsl:otherwise>I</xsl:otherwise>			</xsl:choose>			</xsl:variable>				<xsl:variable name="pside_">			<xsl:choose>				<xsl:when test="($pcount_ &gt;= ($ports_per_side_ * 0) and ($pcount_ &lt; ($ports_per_side_ * 1)))">W</xsl:when>				<xsl:when test="($pcount_ &gt;= ($ports_per_side_ * 1) and ($pcount_ &lt; ($ports_per_side_ * 2)))">S</xsl:when>				<xsl:when test="($pcount_ &gt;= ($ports_per_side_ * 2) and ($pcount_ &lt; ($ports_per_side_ * 3)))">E</xsl:when>				<xsl:when test="($pcount_ &gt;= ($ports_per_side_ * 3) and ($pcount_ &lt; ($ports_per_side_ * 4)))">N</xsl:when>				<xsl:otherwise>D</xsl:otherwise>			</xsl:choose>			</xsl:variable>				<xsl:variable name="pdec_">			<xsl:choose>				<xsl:when test="($pside_ = 'W')"><xsl:value-of select="($ports_per_side_ * 0)"/></xsl:when>				<xsl:when test="($pside_ = 'S')"><xsl:value-of select="($ports_per_side_ * 1)"/></xsl:when>				<xsl:when test="($pside_ = 'E')"><xsl:value-of select="($ports_per_side_ * 2)"/></xsl:when>				<xsl:when test="($pside_ = 'N')"><xsl:value-of select="($ports_per_side_ * 3)"/></xsl:when>				<xsl:otherwise>0</xsl:otherwise>			</xsl:choose>			</xsl:variable>				<xsl:variable name="px_">			<xsl:choose>				<xsl:when test="($pside_ = 'W')"><xsl:value-of select="($BLKD_PRTCHAN_W - $BLKD_IOP_W)"/></xsl:when>				<xsl:when test="($pside_ = 'S')"><xsl:value-of select="($h_ofs_ + (((position() - 1) - $pdec_) * ($BLKD_IOP_SPC + $BLKD_IOP_W)) - 2)"/></xsl:when>				<xsl:when test="($pside_ = 'E')"><xsl:value-of select="($BLKD_PRTCHAN_W + ($BLKD_IORCHAN_W * 2) + $G_total_drawarea_W)"/></xsl:when>				<xsl:when test="($pside_ = 'N')"><xsl:value-of select="($h_ofs_ + (((position() - 1) - $pdec_) * ($BLKD_IOP_SPC + $BLKD_IOP_W)))"/></xsl:when>				<xsl:otherwise>0</xsl:otherwise>			</xsl:choose>			</xsl:variable>				<xsl:variable name="py_">			<xsl:choose>				<xsl:when test="($pside_ = 'W')"><xsl:value-of select="($v_ofs_ + (((position() - 1) - $pdec_) * ($BLKD_IOP_SPC + $BLKD_IOP_H)))"/></xsl:when>				<xsl:when test="($pside_ = 'S')"><xsl:value-of select="($BLKD_PRTCHAN_H + ($BLKD_IORCHAN_H * 2) + $G_total_drawarea_H)"/></xsl:when>				<xsl:when test="($pside_ = 'E')"><xsl:value-of select="($v_ofs_ + (((position() - 1) - $pdec_) * ($BLKD_IOP_SPC + $BLKD_IOP_H)))"/></xsl:when>				<xsl:when test="($pside_ = 'N')"><xsl:value-of select="($BLKD_PRTCHAN_H - $BLKD_IOP_H)"/></xsl:when>				<xsl:otherwise>0</xsl:otherwise>			</xsl:choose>			</xsl:variable>					<xsl:variable name="prot_">			<xsl:choose>				<xsl:when test="(($pside_ = 'W') and ($pdir_ = 'I'))">0</xsl:when>				<xsl:when test="(($pside_ = 'S') and ($pdir_ = 'I'))">-90</xsl:when>				<xsl:when test="(($pside_ = 'E') and ($pdir_ = 'I'))">180</xsl:when>				<xsl:when test="(($pside_ = 'N') and ($pdir_ = 'I'))">90</xsl:when>								<xsl:when test="(($pside_ = 'W') and ($pdir_ = 'O'))">180</xsl:when>				<xsl:when test="(($pside_ = 'S') and ($pdir_ = 'O'))">90</xsl:when>				<xsl:when test="(($pside_ = 'E') and ($pdir_ = 'O'))">0</xsl:when>				<xsl:when test="(($pside_ = 'N') and ($pdir_ = 'O'))">-90</xsl:when>								<xsl:when test="(($pside_ = 'W') and ($pdir_ = 'B'))">0</xsl:when>				<xsl:when test="(($pside_ = 'S') and ($pdir_ = 'B'))">0</xsl:when>				<xsl:when test="(($pside_ = 'E') and ($pdir_ = 'B'))">0</xsl:when>				<xsl:when test="(($pside_ = 'N') and ($pdir_ = 'B'))">0</xsl:when>				<xsl:otherwise>0</xsl:otherwise>			</xsl:choose>			</xsl:variable>				<xsl:variable name="txo_">			<xsl:choose>				<xsl:when test="($pside_  = 'W')">-14</xsl:when>				<xsl:when test="($pside_  = 'S')">8</xsl:when>				 <xsl:when test="($pside_ = 'E')"><xsl:value-of select="(($BLKD_IOP_W * 2) - 4)"/></xsl:when>				<xsl:when test="($pside_  = 'N')">8</xsl:when>				<xsl:otherwise>0</xsl:otherwise>			</xsl:choose>			</xsl:variable>				<xsl:variable name="tyo_">			<xsl:choose>				<xsl:when test="($pside_ = 'W')"><xsl:value-of select="ceiling($BLKD_IOP_H div 2) + 6"/></xsl:when>				<xsl:when test="($pside_ = 'S')"><xsl:value-of select="($BLKD_IOP_H * 2) + 4"/></xsl:when>				<xsl:when test="($pside_ = 'E')"><xsl:value-of select="ceiling($BLKD_IOP_H div 2) + 6"/></xsl:when>				<xsl:when test="($pside_ = 'N')">-2</xsl:when>				<xsl:otherwise>0</xsl:otherwise>			</xsl:choose>			</xsl:variable>		<xsl:if test="$pdir_ = 'B'">	   			<use   x="{$px_}"			       y="{$py_}"				   id="{@NAME}"			       xlink:href="#G_BIPort" 			       transform="rotate({$prot_},{$px_ + ceiling($BLKD_IOP_W div 2)},{$py_ + ceiling($BLKD_IOP_H div 2)})"/>		</xsl:if>				<xsl:if test="(($pside_ = 'S') and not($pdir_ = 'B'))">	   			<rect  				x="{$px_}"				y="{$py_}"				width= "{$BLKD_IOP_W}"				height="{$BLKD_IOP_H}" style="stroke:{$COL_IORING}; stroke-width:1"/> 		</xsl:if>				<xsl:if test="not($pdir_ = 'B')">	   			<use   x="{$px_}"			       y="{$py_}"				   id="{@NAME}"			       xlink:href="#G_IOPort"			       transform="rotate({$prot_},{$px_ + ceiling($BLKD_IOP_W div 2)},{$py_ + ceiling($BLKD_IOP_H div 2)})"/>		</xsl:if>				<text class="iopnumb"	  		x="{$px_ + $txo_}" 	  		y="{$py_ + $tyo_}"><xsl:value-of select="@INDEX"/><tspan class="iopgrp"><xsl:value-of select="@GROUP"/></tspan>		</text>	</xsl:for-each>	</xsl:template>	<xsl:template name="Define_ExtPortsTable">	<!--			<xsl:if test="$oriented_= 'WEST'"><xsl:value-of select="$proc2procX_ - (string-length(@BUSNAME) * 6)"/></xsl:if>			<xsl:variable name="max_name_" select="math:max(string-length(/EDKSYSTEM/EXTERNALPORTS/PORT/@NAME))"/>		<xsl:variable name="max_sgnm_" select="math:max(string-length(/EDKSYSTEM/EXTERNALPORTS/PORT/@SIGNAME))"/>			<xsl:message>MAX NAME <xsl:value-of select="$max_name_"/></xsl:message>		<xsl:message>MAX SIG  <xsl:value-of select="$max_sgnm_"/></xsl:message>-->				<xsl:variable name="ext_ports_">				<xsl:if test="not(/EDKSYSTEM/EXTERNALPORTS/PORT)">				<EXTPORT NAME="__none__" SIGNAME="__none_" NAMELEN="0" SIGLEN="0"/>			</xsl:if>			<xsl:if test="/EDKSYSTEM/EXTERNALPORTS/PORT">				<xsl:for-each select="/EDKSYSTEM/EXTERNALPORTS/PORT">					<EXTPORT  NAME="{@NAME}" SIGNAME="{@SIGNAME}" NAMELEN="{string-length(@NAME)}" SIGLEN="{string-length(@SIGNAME)}"/>				</xsl:for-each>			</xsl:if>		</xsl:variable>			<xsl:variable name="max_name_" select="math:max(exsl:node-set($ext_ports_)/EXTPORT/@NAMELEN)"/>		<xsl:variable name="max_sign_" select="math:max(exsl:node-set($ext_ports_)/EXTPORT/@SIGLEN)"/>			<xsl:variable name="h_font_" select="12"/>		<xsl:variable name="w_font_" select="12"/>			<xsl:variable name="w_num_"    select="($w_font_ * 5)"/>		<xsl:variable name="w_dir_"    select="($w_font_ * 3)"/>		<xsl:variable name="w_lsbmsb_" select="($w_font_ * 9)"/>		<xsl:variable name="w_attr_"   select="($w_font_ * 4)"/>		<xsl:variable name="w_name_"   select="($w_font_ * $max_name_)"/>		<xsl:variable name="w_sign_"   select="($w_font_ * $max_sign_)"/>			<xsl:variable name="w_table_" select="($w_num_ + $w_name_ + $w_dir_ + $w_sign_ + $w_attr_)"/>	<!--			<xsl:message>MAX NAME <xsl:value-of select="$max_name_"/></xsl:message>		<xsl:message>MAX SIG  <xsl:value-of select="$max_sign_"/></xsl:message>			<xsl:message>W NUM  <xsl:value-of select="$w_num_"/></xsl:message>		<xsl:message>W DIR  <xsl:value-of select="$w_dir_"/></xsl:message>		<xsl:message>W NAM  <xsl:value-of select="$w_name_"/></xsl:message>		<xsl:message>W SIG  <xsl:value-of select="$w_sign_"/></xsl:message>		<xsl:message>W ATT  <xsl:value-of select="$w_attr_"/></xsl:message>			<xsl:message>W TABLE  <xsl:value-of select="$w_table_"/></xsl:message>-->			 <symbol id="BlkDiagram_ExtPortsTable">		<rect  			x="0"  			y="0" 			width= "{$w_table_}" 			height="{$h_font_}"  style="fill:{$COL_RED}; stroke:none; stroke-width:1"/> 	</symbol>	 			</xsl:template><!-- ======================= END MAIN BLOCK =========================== --></xsl:stylesheet>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -