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:
DFFX1 \i_a/i0 ();
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.
- 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.