<?xml version="1.0" standalone="no"?>

<!DOCTYPE stylesheet [
	<!ENTITY HEXUPPER "ABCDEFxx0123456789">
	<!ENTITY HEXLOWER "abcdefxX0123456789">
	<!ENTITY HEXU2L " '&HEXLOWER;' , '&HEXUPPER;' ">
]>	

<xsl:stylesheet version="1.0"
           xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
           xmlns:exsl="http://exslt.org/common"
           xmlns:xlink="http://www.w3.org/1999/xlink">
         
<xsl:output method="html"/>
			
<!-- ======================= MAIN MEMORY MAP SECTION =============================== -->
<xsl:template name="WriteContents_MemoryMap">
<xsl:param name="table_width" select="600"/>

<xsl:variable name="procName" select="@INSTANCE"/>
	<xsl:if test="MEMORYMAP/MEMRANGE[(@INSTANCE)]">
		
	<TABLE BGCOLOR="{$COL_BLACK}" WIDTH="{$table_width}" COLS="5" cellspacing="1" cellpadding="2" border="0">
		<TR></TR>	
		<TD COLSPAN="5" width="100%" ALIGN="CENTER" BGCOLOR="{$COL_XLNX}">
			<A name="ANCHOR_{@INSTANCE}_MemoryMap"/>
			<SPAN style="color:{$COL_WHITE}; font: bold 10px Verdana,Arial,Helvetica,sans-serif">MEMORY MAP</SPAN>
		</TD>
		<TR></TR>
		<TD COLSPAN="5" width="100%" ALIGN="CENTER" BGCOLOR="{$COL_WHITE}"><SPAN style="color:{$COL_INFO}; font: bold 10px Verdana,Arial,Helvetica,sans-serif">D=DATA ADDRESSABLE &#160;&#160; I=INSTRUCTION ADDRESSABLE</SPAN></TD>
		<TR></TR>
		<TD COLSPAN="1" width="5%"  ALIGN="CENTER" BGCOLOR="{$COL_GRAY}"><SPAN style="color:{$COL_BLACK}; font: bold 12px Verdana,Arial,Helvetica,sans-serif">D</SPAN></TD>
		<TD COLSPAN="1" width="5%"  ALIGN="CENTER" BGCOLOR="{$COL_GRAY}"><SPAN style="color:{$COL_BLACK}; font: bold 12px Verdana,Arial,Helvetica,sans-serif">I</SPAN></TD>
		<TD COLSPAN="1" width="20%" ALIGN="CENTER" BGCOLOR="{$COL_GRAY}"><SPAN style="color:{$COL_BLACK}; font: bold 10px Verdana,Arial,Helvetica,sans-serif">BASE</SPAN></TD>
		<TD COLSPAN="1" width="20%" ALIGN="CENTER" BGCOLOR="{$COL_GRAY}"><SPAN style="color:{$COL_BLACK}; font: bold 10px Verdana,Arial,Helvetica,sans-serif">HIGH</SPAN></TD>
		<TD COLSPAN="1" width="50%" ALIGN="CENTER" BGCOLOR="{$COL_GRAY}"><SPAN style="color:{$COL_BLACK}; font: bold 10px Verdana,Arial,Helvetica,sans-serif">MODULE</SPAN></TD>
		<TR></TR>
		
		<xsl:for-each select="MEMORYMAP/MEMRANGE[(@INSTANCE)]">
			<xsl:sort data-type="number" select="@BASEDECIMAL" order="ascending"/>
			<TR></TR>
				<xsl:variable name="isdata">
					<xsl:if test="@IS_DATA='TRUE'">&#9632;</xsl:if>	
					<xsl:if test="not(@IS_DATA='TRUE')">&#160;</xsl:if>	
				</xsl:variable>
			
			<xsl:variable name="isinst">
				<xsl:if test="@IS_INSTRUCTION='TRUE'">
					&#9632;
				</xsl:if>	
				<xsl:if test="not(@IS_INSTRUCTION='TRUE')">
					&#160;
				</xsl:if>	
			</xsl:variable>
			
			<xsl:variable name="bupper" select ="@BASEVALUE"/>
			<xsl:variable name="hupper" select ="@HIGHVALUE"/>
			<xsl:variable name="iname"  select ="@INSTANCE"/>
			<TD COLSPAN="1" width="5%"  ALIGN="CENTER" BGCOLOR="{$COL_WHITE}"><SPAN style="color:{$COL_BLACK}; font: bold 14px Verdana,Arial,sans-serif"><xsl:value-of select="$isdata"/></SPAN></TD>
			<TD COLSPAN="1" width="5%"  ALIGN="CENTER" BGCOLOR="{$COL_WHITE}"><SPAN style="color:{$COL_BLACK}; font: bold 14px Verdana,Arial,sans-serif"><xsl:value-of select="$isinst"/></SPAN></TD>
			<TD COLSPAN="1" width="20%" ALIGN="CENTER" BGCOLOR="{$COL_WHITE}"><SPAN style="color:{$COL_BLACK}; font: normal 12px Verdana,Arial,Helvetica,sans-serif"><xsl:value-of select="translate($bupper,&HEXU2L;)"/></SPAN></TD>
			<TD COLSPAN="1" width="20%" ALIGN="CENTER" BGCOLOR="{$COL_WHITE}"><SPAN style="color:{$COL_BLACK}; font: normal 12px Verdana,Arial,Helvetica,sans-serif"><xsl:value-of select="translate($hupper,&HEXU2L;)"/></SPAN></TD>
			<TD COLSPAN="1" width="50%" ALIGN="RIGHT"  BGCOLOR="{$COL_WHITE}">
				<A HREF="#ANCHOR_{$iname}" style="text-decoration:none">
				<SPAN style="color:{$COL_BLACK}; vertical-align:sub; font: normal 8px Verdana,Arial,Helvetica,sans-serif"><xsl:value-of select="@BASENAME"/>:<xsl:value-of select="@HIGHNAME"/></SPAN><SPAN style="color:{$COL_XLNX}; font: bold 12px Verdana,Arial,Helvetica,sans-serif"><xsl:value-of select="@INSTANCE"/></SPAN>
				</A>
			</TD>
		</xsl:for-each>
	</TABLE>			
	</xsl:if>
</xsl:template>

</xsl:stylesheet>
