summaryrefslogtreecommitdiffstats
path: root/treemap/convert.xsl
blob: b0dd494c4314821fce38c4c72ecf816866c82ea5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output encoding="UTF-8"/>
<xsl:strip-space elements="*" />
<xsl:preserve-space elements="node" />

<xsl:template match="tree">

    <xsl:if test="@stringID='MAP_MODULE_HIERARCHY'">
        <xsl:apply-templates />
    </xsl:if>

</xsl:template>


<xsl:template match="node">
    
    <xsl:variable name="nodename">
        <xsl:value-of select="@value" />
    </xsl:variable>
    
    <xsl:variable name="nodeslices">
        <xsl:call-template name="slices" />
    </xsl:variable>

    <xsl:variable name="nodebrams">
        <xsl:call-template name="brams" />
    </xsl:variable>

<!--<node name="{$nodename}" size="{$nodeslices}" created="{substring(concat('0000',$nodebrams),1+string-length($nodebrams),4)}-01-01 00:00:00">-->
    <node name="{$nodename}" slices="{$nodeslices}" brams="{$nodebrams}">
        <xsl:apply-templates /> 
    </node>

</xsl:template>

<xsl:template name="slices">
    <xsl:for-each select="item">
            <xsl:if test="@stringID='MAP_SLICES'">
                <xsl:value-of select="@value" />
<!--                <xsl:value-of select="@ACCUMULATED" />-->
            </xsl:if>
    </xsl:for-each>
</xsl:template>

<xsl:template name="brams">
    <xsl:for-each select="item">
            <xsl:if test="@stringID='MAP_BRAM' or @stringID='MAP_BRAM_FIFO'">
                <xsl:value-of select="@value" />
<!--                <xsl:value-of select="@ACCUMULATED" />-->
            </xsl:if>
    </xsl:for-each>
</xsl:template>

</xsl:stylesheet>
OpenPOWER on IntegriCloud