• 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. Blogs
  2. Digital Design
  3. Encounter Puzzler #2: Finding Registers Beneath a Hiera…
BobD
BobD

Community Member

Blog Activity
Options
  • Subscribe by email
  • More
  • Cancel
CDNS - RequestDemo

Have a question? Need more information?

Contact Us
dbGet
encounter
Digital Implementation
puzzler
tcl

Encounter Puzzler #2: Finding Registers Beneath a Hierarchy

20 Sep 2010 • 1 minute read

I hope you enjoyed our first Encounter Puzzler: Where Did My Fences Go?  The source of inspiration for this week's puzzler came from an internal alias that we have here at Cadence where folks ask and answer questions about Encounter.  An applications engineer received a request from a customer and wanted to know: How can I select all of the registers beneath a given logical hierarchy?

 

The image above shows the scenario.  To clarify exactly what we're talking about, here's a sample Verilog netlist:

module testcase();
 DFFX1 \i_a/i0 ();
 BUFX1 i1();
 a i_a();
 b i_b();
endmodule

module a();
 a_sub i_a_sub();
 DFFX1 i2();
 BUFX1 i3();
endmodule

module a_sub();
 DFFX1 i0();
 BUFX1 i1();
endmodule

module b();
 DFFX1 i0();
 BUFX1 i1();
endmodule 

Given this netlist, we'd like to select all of the registers beneath the hierarchical instance i_a.  In this case, the script should therefore select i_a/i2 and i_a/i_a_sub/i0.

Tips:

  • The first thing that comes to mind is using dbGet, but there are a number of ways this could be done including Advanced Timing TCL Scripting Commands.
  • In this context "registers" are just another word for sequential elements.  They're marked as such in the .lib and can be keyed off in the db.
  • Consider using dbSelectObj -or- selectInst to select the instances.
  • Beware of the \i_a/i0 instance at the top level of the design -- it is not beneath the hierarchical instance i_a. I threw that in there to keep things interesting.

This is a little more open-ended than our last puzzler.  Leave a comment below with your solution -- I'll look forward to seeing what you come up with.  I'll post some solutions and further discussion this coming Friday.

Check back on Friday for the answer.  Or better yet subscribe to the Digital Implementation blogs to get new content delivered to your inbox or favorite feed reader. 

Bob Dwyer


CDNS - RequestDemo

Try Cadence Software for your next design!

Free Trials

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

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