Create Netlist Hierarchy with XSLT

Discussion in 'XML' started by Rolf Kemper, Jan 12, 2005.

  1. Rolf Kemper

    Rolf Kemper Guest

    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>
     
    Rolf Kemper, Jan 12, 2005
    #1
    1. Advertising

  2. Rolf Kemper

    Joris Gillis Guest

    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-view.cgi?userid=38041)
    Deserta faciunt et innovationem appelant
     
    Joris Gillis, Jan 15, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Neil Zanella

    netlist: what is it?

    Neil Zanella, Jul 24, 2003, in forum: VHDL
    Replies:
    0
    Views:
    1,989
    Neil Zanella
    Jul 24, 2003
  2. Simon S.  IBM
    Replies:
    3
    Views:
    3,593
    B. Joshua Rosen
    Feb 21, 2004
  3. rajan

    assign statement in netlist

    rajan, Aug 26, 2004, in forum: VHDL
    Replies:
    4
    Views:
    5,354
    Kholdoun TORKI
    Sep 1, 2004
  4. poofpoof
    Replies:
    2
    Views:
    607
    poofpoof
    Aug 13, 2004
  5. Harlan Messinger
    Replies:
    1
    Views:
    382
Loading...

Share This Page