Repository navigation
get_timing_edges: return a flat edge list for -of_objects - #459
NopeCharon wants to merge 1 commit into
Conversation
get_timing_arcs_objects collected each instance's edges with "lappend edges [instance_edges $inst]", which appends the whole list as a single element. get_timing_edges -of_objects therefore returned one nested list per instance, so the result could not be passed to get_property, set_disable_timing or -filter, and llength reported one edge per instance. The lib cell branch nested the timing arc sets the same way. Use concat to build flat lists, as the other object list helpers do. The check that rejects -from/-to with -of_objects tested -from twice, so -to was silently ignored. Test -to as well. The graph test goldens recorded the wrong counts (one edge for every cell); update them to the real counts. Add graph_timing_edges_of_objects to check that the edges can be used with get_property, -filter and set_disable_timing, and that -to is rejected with -of_objects. Fixes The-OpenROAD-Project#456 Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
|
|
There was a problem hiding this comment.
Code Review
This pull request fixes a bug in get_timing_edges_cmd where -from was checked twice instead of checking both -from and -to when -of_objects is specified. It also flattens the returned lists of edges and arc sets in get_timing_arcs_objects by using concat instead of lappend, with corresponding updates to the test cases and a new test suite. The review feedback recommends replacing the concat operations inside loops with lappend using the expansion operator {*} to avoid O(N^2) complexity and improve performance on large designs.
| set edges {} | ||
| foreach inst $insts { | ||
| lappend edges [instance_edges $inst] | ||
| set edges [concat $edges [instance_edges $inst]] |
There was a problem hiding this comment.
Using concat in a loop to append elements to a list has {*} with lappend to append elements in-place with
lappend edges {*}[instance_edges $inst]
| set arc_sets {} | ||
| foreach libcell $libcells { | ||
| lappend arc_sets [$libcell timing_arc_sets] | ||
| set arc_sets [concat $arc_sets [$libcell timing_arc_sets]] |
Fixes #456.
get_timing_edges -of_objectsbuilt its result withlappend edges [instance_edges $inst], which adds each instance's whole edge list as one element. The command returned one nested list per instance, so the result couldn't be passed toget_property,set_disable_timingor-filter, andllengthcounted one edge per instance. The lib cell branch nested arc sets in the same way. Both branches now build flat lists withconcat, like the other object-list helpers intcl/CmdArgs.tcl.The check that rejects
-from/-towith-of_objectstested-fromtwice, so-towas silently ignored. It now tests-totoo, as the command help describes.Tests:
search_fanin_fanout.ok, which countsand1's edges) recorded one edge for every cell. They now show the real counts: 2 for two-input gates and 5 forDFF_X1. These count lines are the only golden changes.graph_timing_edges_of_objectstest readsfrom_pin,to_pinandsensefrom each returned edge, uses-filter, runsset_disable_timing/unset_disable_timingon the result, and checks that-of_objectswith-toraises error 540. On current master it fails at the firstget_property.ctest -L tcl: everything passes once the goldens are updated, and the 13 graph and fanin/fanout tests pass after the update.