How does create_clock_straps decide whether it's building a mesh or a spine, and what does -margins actually control?
From PDVerse PnR Interview Handbook · pdVerse Mentor Guide
Short Answer
The -type option per direction decides the topology: stripe in both directions builds a mesh; one direction as user_route (with the orthogonal direction as detect for spine detection) builds a spine instead. -margins sets the margin within which a strap may move -- default 0, which means an exact position or no strap at all, a real constraint if you need flexible strap placement rather than fixed coordinates.
Technical Explanation
- The -type option per direction decides the topology: -type stripe in both directions builds a mesh (2D grid); one direction set to user_route with the orthogonal direction using detect builds a spine structure instead.
- -margins sets the margin within which a strap may move from its specified position -- the default is 0, meaning exact position or no strap at all, not a soft placement suggestion.
- -grid accepts either a single distance (one strap), an iterator list (start/end/increment for multiple straps in one direction), or a list-of-lists for both directions at once (horizontal specified first).
- -allow_floating true permits straps unconnected to orthogonal straps, which is NOT allowed by default -- floating straps require this explicit opt-in.
- -bias/-bias_to_nets/-bias_margins provide shielding by biasing strap position relative to PG nets or specific nets -- a signal-integrity feature layered on top of the basic mesh/spine geometry.
Formula Or Decision Rule
Mesh: both directions -type stripe. Spine: one direction -type user_route, detect on the orthogonal direction. -margins default 0 = exact position only.
What To Check
- Warning sign: create_clock_straps produces fewer straps than expected, or straps land at unexpected positions.
- Inspect: check the -margins value -- if left at default 0, straps that can't land at their exact specified position are simply not created, not moved nearby.
- Correct: set an explicit non-zero -margins value if flexible strap placement was actually the intent.
Command Checks & Actions
create_clock_straps -nets [get_nets clk1_mesh] -layers {M7 M8} -widths {2.4 2.4} -types {stripe stripe} -grids {{20 1200 100} {60 980 150}}Builds a mesh (both directions stripe).
create_clock_straps -types {stripe user_route}Builds a spine structure instead (mixed types).
route_clock_straps -nets clk1_meshRoutes to the created straps once geometry is defined.
Healthy, Suspicious & Hard-stop Results
- Expected: the resulting structure (mesh or spine) matches the intended -type configuration, and strap count/positions match expectations given the -margins setting.
- Investigate: fewer straps were created than the -grid specification implies -- check -margins first, since default 0 silently drops straps that can't land exactly.
- Stop: a mesh was intended but -type configuration was actually set for a spine (or vice versa) -- verify the per-direction -type values match the intended topology before routing proceeds.
Common Mistake
The Trap: Assuming -margins is a soft/optional placement hint -- its default of 0 means exact position or no strap, a hard constraint that needs explicit relaxation if flexible placement is actually needed.
What The Interviewer Is Testing
Whether you know the precise mechanism distinguishing mesh from spine construction (the -type option per direction) and that -margins defaults to a hard, not soft, constraint.
Practical Example
Debug Scenario: create_clock_straps with -grids specifying 12 straps in one direction produces only 8 in the built structure. Checking -margins, it was left at the default 0 -- meaning straps that couldn't land at their exact computed position (due to existing obstructions) were simply not created rather than nudged nearby.
Physical Design & Planning Handbook
Master ASIC Physical Design Planning & Floorplanning
Dive into 14 comprehensive chapters covering netlist sanity, FinFET grids, macro placement, power grids, CTS, and timing budgeting.
Continue practising