Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request removes the 'unbraced-expr' ignore rule from the tclint configuration and updates various SDC and Tcl files to use braced expressions, improving performance and linting compliance. The review feedback suggests simplifying several of the newly modified multi-line expressions in 'flow/util/cell-veneer/wrap_stdcells.tcl' to improve readability and remove unnecessary line continuations.
…gnore
Brace the ~250 remaining unbraced `expr` calls: the designs'
constraint.sdc files, the ariane, bsg_chip and mempool_group SDCs, and
flow/util/cell-veneer/{lefdef,wrap_stdcells,wrap}.tcl. Then remove
"unbraced-expr" from the ignore list in tclint.toml, so tclint keeps
the rule from here on.
A braced expression is compiled once and is not substituted twice. No
site relied on the double substitution: every value is a number.
Sites in flow/scripts and flow/platforms are braced by the sibling pull
request; this one is meant to be merged after it, until then tclint
reports those.
Two lines are touched beyond bracing: a nested `[expr round(...)]`
inside another braced expr is now plain `round(...)` (tclint reports
it as redundant), and a few long lines are wrapped to the 100 column
limit.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Øyvind Harboe <[email protected]>
aad1a85 to
3cc4dee
Compare
…lands The nine sites The-OpenROAD-Project#4914 braces still trip the check here, so this PR leaves the ignore in place and stays green on its own; dropping it is a one-line follow-up once both have merged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Øyvind Harboe <[email protected]>
🔍 QoR checkMetrics reflect the PR merge build — i.e. what will land on the target branch. Commit 62 design(s) checked — 0 with regression(s), 0 without a comparable baseline. ✅ QoR is compared against the master build at this PR's merge base |
Independent of #4914; overlaps #4913. #4914 braces the nine
exprsites inflow/scriptsandflow/platformsand adds the contract line "Everyexpris braced"; this PR braces the rest.unbraced-exprstays in thetclint.tomlignore here, so this PR is green on its own; removing it is a one-line follow-up once both have landed. #4913 (eq/ne) touches the same lines inflow/util/cell-veneer/lefdef.tclandwrap_stdcells.tcl; whichever lands second is rebased.What
255 unbraced
exprcalls in 60 files, found by tclint 0.9.0 with the ignore removed:constraint.sdcfiles (plusariane.sdc,bsg_chip.sdc,mempool_group.sdc, microwatt):set_input_delay [expr $clk_period * $clk_io_pct] ...becomes[expr { $clk_period * $clk_io_pct }].flow/util/cell-veneer/{lefdef,wrap_stdcells,wrap}.tcl.tclint.tomlis unchanged:"unbraced-expr"stays ignored until tcl: brace every expr in flow/scripts and platforms #4914 and this PR have both landed.Mechanical otherwise. Two things beyond bracing: a nested
[expr round(...)]inside an already bracedexpris plainround(...)(tclint flags it as redundant), and a handful of lines went over the 100 column limit and are wrapped. tclfmt 0.9.0 is applied.Why
expris the safe kind.exprdoes not substitute twice, so a value with an operator or a space in it fails at theexprinstead of quietly computing something else.exprin a constraint file is a "is this a bug?" detour for a human or an agent reading it. All of them are gone.Double substitution
Checked every site for reliance on it. None: every operand is a number (
clk_period,clk_io_pct, DEF units, LEF coordinates), none is a string holding an operator.Test evidence
tclint .andtclfmt --check .(0.9.0) are clean over the whole repo with the ignore removed, except the nine tcl: brace every expr in flow/scripts and platforms #4914 sites..sdcfiles, run under tclsh with every unknown command recorded with its arguments: identical log before and after for all 57.make floorplanbefore/after on eight designs, one or more per platform (nangate45 gcd, asap7 gcd/uart/ethmac, sky130hd gcd, sky130hs gcd, ihp-sg13g2 gcd, gf180 gcd): the SDC OpenROAD writes at every stage (2_*.sdc) is byte-identical, and logs and stage metrics have no differences beyond run-specific paths. Only the copy of the source SDC (1_2_yosys.sdc) differs, as it should.wrap.tcl -macroand the standard-cell wrapper path (move_m2_pins_to_edge,test_harness) run on small synthetic LEFs (right/left/blocked padding cases): generated LEF and DEF are byte-identical before and after. (build_wrapperscallsmove_m2_pins_to_edgewith a wrong argument count on master; unrelated, left alone.)🤖 Generated with Claude Code