Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Create Netlist Hierarchy with XSLT

Reply
Thread Tools

Create Netlist Hierarchy with XSLT

 
 
Rolf Kemper
Guest
Posts: n/a
 
      01-12-2005
Dear All,

may be some one has a good idea for the follwoing problem.

In the xml data below you see a kind of abstract netlist as we use it
for chip design. Where the H tag stands for a logical hierarchy level,
the M tag for a physical macro and the p tag for a pin of the macro
which has to be bound to a Net ( named by @Net).
The existing netlist is described without the Hierarchy. Hence, I must
know which nets I have to pass trough the Hierarchy interface (H
tags).

Imagine I'm on the node <H id=5>
Then all nets which are above are ancestor::*/M/p/@Net
The Nets in and below this Level are decendant::*/p/@Net

What I would need is a list of Nets which are in the ancestor nets AND
in the decendant nets. This nets are exactly the ones we need in the
interface.

ancestor::/M/p[@Net=descedant::*/p]/@Net does not return any net.
I feel the approach to have = betwenn to nodesets may be bad.

What is the right solution here ???
I would expect the Nets A,C and D

Thanks a lot for your help
Rolf

########################## DATA ############################
<TOP>
<H id="1">
<M id="2">
<p net="A"/>
<p net="B"/>
<p net="E"/>
</M>
<H id="3">
<M id="4">
<p net="C"/>
<p net="B"/>
</M>
<H id="5">
<M id="6">
<p net="D"/>
<p net="C"/>
</M>
<H id="7">
<M id="8">
<p net="A"/>
<p net="C"/>
</M>
</H>
</H>
<M id="9">
<p net="D"/>
<p net="A"/>
</M>
<H id="10">
<M id="11">
<p net="B"/>
<p net="E"/>
</M>
</H>
<M id="12">
<p net="E"/>
<p net="B"/>
</M>
</H>
</H>
</TOP>
 
Reply With Quote
 
 
 
 
Joris Gillis
Guest
Posts: n/a
 
      01-15-2005
Hi,

Tempore 00:16:15, die Thursday 13 January 2005 AD, hinc in foro {comp.text.xml} scripsit Rolf Kemper <>:

> Imagine I'm on the node <H id=5>
> Then all nets which are above are ancestor::*/M/p/@Net
> The Nets in and below this Level are decendant::*/p/@Net
>
> What I would need is a list of Nets which are in the ancestor nets AND
> in the decendant nets. This nets are exactly the ones we need in the
> interface.
>
> ancestor::/M/p[@Net=descedant::*/p]/@Net does not return any net.
> I feel the approach to have = betwenn to nodesets may be bad.

IMHO, that approach is perfect, in fact the solution is very close.

The following Xpath will return 'ACDA':
ancestor::*/M/p/@net[.=current()/descendant::*/p/@net]

While this Xpath will return exactly 'ACD', your desired output:
ancestor::*/M/p/@net[.=current()/descendant::*/p/@net][not(ancestor::[position() &gt; 3]/M/p/@net=.)]

regards,
--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-v...i?userid=38041)
Deserta faciunt et innovationem appelant
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XSLT: Creating partly expanded navigation menu from full hierarchy Harlan Messinger XML 1 10-12-2007 05:45 PM
assign statement in netlist rajan VHDL 4 09-01-2004 11:13 AM
XSLT : hierarchy recursive problem...help poofpoof XML 2 08-13-2004 11:31 AM
Random logic verilog gate netlist generator Simon S. IBM VHDL 3 02-21-2004 04:06 PM
netlist: what is it? Neil Zanella VHDL 0 07-24-2003 05:34 PM



Advertisments
 



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 57