• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Following a signal down through hierarchy with iterated...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 14404
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Following a signal down through hierarchy with iterated instances

Ivars
Ivars over 15 years ago

Hi,

I'm trying to write a procedure that will follow a signal down the hierarchy  and return a list of instances which were traversed.  I've been able to do this successfully, with the code below, as long as the path does not contain iterated instances. With iterated instances I'm struggling with how to map the signal name a one level to the name used at the next lower level.

 My basic approach is as follows:

 1) use dbFindSigByName to find the signal object assocaited with the desired signal at a given level of hierarchy.

2) from the signal object, use instTerms to determine which instance terminals the signal is connected to and at which index of that terminal the desired signal is located

3) for each instTerm, open the associated instance and use dbGetMemName to determine what name the original signal name was mapped to. 

 4) Repeat the whole procedure for the current instance with the mapped signal name until the desired stop cell is reached or it has descended into cell from a base cell library ("xxXxx"). At this point the instance path is printed out.

 When descending into an iterated instance the mapping step with dbGetMemName fails since it doesn't account for the iterated intances. For example, consider cellview where 3 iterated instances I<0:2>  have a net "upper<0:5>" connected to terminal "lower<0:1>". If I'm following the signal "upper<3>" down, I need to determine that "upper<3>" maps to "lower<1>" of instance I<1>. Are there any built-in functions to assist with this mapping or do I need to roll my own?

 Any help would be greatly appreciated.

 Thanks.

 Ivars

 

;; usage: traceSignal("signal<2>" "stopCellName") 

 procedure(traceSignal(sig_name  stop_cell @optional (cv geGetEditCellView()) (sList '() ) (iList '("") ) (cList '() ) )
  let( (net_l net net_d sig_d sig sig_l instTerm_l instTerm bit)
      if(sig_d = dbFindSigByName(cv sig_name) ;; get the signal object for the signal name
       then
       sList = cons(sig_name sList) ;; add signal name to hierarchical list
       foreach(instTerm_l sig_d~>memInstTerms
         instTerm = car(instTerm_l) ;; instance terminal to which signal connects
         bit = cadr(instTerm_l) ;; bit index of signal on instance terminal
         followDown(instTerm bit stop_cell sList iList cList)
         );foreach(instTerm
     else
       printf("Signal %s not found\n" sig_name)
     ); if(sig_d
      t
    );let
);procedure(traceSignal

procedure(followDown(instTerm bit stop_cell sList iList cList)
  let((cv term_name inst_name inst_base_name inst_num cell_name lib_name sig_name)
      term_name = instTerm~>name
      inst_name = instTerm~>inst~>name
      cell_name = instTerm~>inst~>cellName
      lib_name  = instTerm~>inst~>libName
      iList = cons( inst_name iList) ;; add instance name to hierarchical list
      cList = cons( cell_name cList) ;; add cell name to hierarchical list
     if(lib_name == "xxXxx" || cell_name == stop_cell
       then ;; don't descend any further
           printf("%s\n" buildString( reverse(sList) " -> " ))
           printf("%s\n" buildString( reverse(cList) " : " ))
           printf("%s\n" buildString( reverse(iList) "/" ))
       else
           getWarn()
           when(cv = dbOpenCellViewByType(lib_name cell_name "schematic" ) ;; descend hierarchy
                sig_name = dbGetMemName(term_name bit) ;; determine signal name at lower level
                traceSignal(sig_name stop_cell cv sList iList cList) ;; look for signal
                dbClose(cv)
        );when(cv
    ); if(lib_name
);let
);procedure(followDown

  • Cancel
  • dmay
    dmay over 15 years ago

    You'll hve to "roll your own", but this is all you really need:

    ; makes a list of lists of all instances and terminals of an iterated terminal.
    procedure( getInstAndTerm( memTerm)
      let( (
             ( term  car( memTerm))
             ( index cadr( memTerm))
             ( inst  car( memTerm)->inst)
             instNameMembers
             termNameMembers
             instTermPairs
           )

        instNameMembers = dbProduceMemName( inst->name)
        termNameMembers = dbProduceMemName( term->name)
        foreach( instMember instNameMembers
          foreach( termMember termNameMembers
            instTermPairs = tconc( instTermPairs list( instMember termMember))
          )
        )

        nth( index car( instTermPairs))
      )
    )


    In your example:

    sig = dbFindSigByName(geGetEditCellView() "upper<3>")
      db:0x2194a896
    mit = car(sig~>memInstTerms)
      (db:0x2194a912 3)
    Notice the bit number 3.
    it = getInstAndTerm(mit)
    ("I<1>" "lower<1>")

    So essentially, the inst term pairs are:
    0: I<0> lower<0>
    1: I<0> lower<1>
    2: I<1> lower<0>
    3: I<1> lower<1>
    4: I<2> lower<0>
    5: I<2> lower<1>

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Ivars
    Ivars over 15 years ago
    Derek, Thanks for the response. Your example worked. I'll incorporate it into my tracing function. Ivars
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information