Create Netlist Hierarchy with XSLT

R

Rolf Kemper

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>
 
J

Joris Gillis

Hi,

Tempore 00:16:15 said:
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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top