Skip to content

flow: CORNERS defaults to "" and is read without a helper - #4923

Open
oharboe wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:tcl-corners
Open

oharboe wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:tcl-corners

Conversation

@oharboe

@oharboe oharboe commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

What

CORNERS selects multi-corner analysis: empty means one unnamed scene from LIB_FILES, a list such as slow fast names one scene per corner. It now has default: "" in variables.yaml (stages stay All stages), and the scripts read it plainly:

  • read_liberty.tcl (2), generate_abstract.tcl, report_metrics.tcl, write_binary_libs.tcl: [env_var_exists_and_non_empty CORNERS] becomes $::env(CORNERS) ne "". Each picks one of two branches (per-corner scenes, or the single scene), so the test stays.
  • read_liberty.tcl, the AUTO_MEMORIES loop: the test around foreach corner $::env(CORNERS) is gone; a loop over an empty list does nothing.

FlowVariables.md renders default: "" as it renders no default, so it is unchanged. The rule this follows is already proposed in #4912 (a variable with a default is read as $::env(X)) and #4920 (an optional list is iterated without a test; one whose emptiness selects a step is tested with ne ""), so no new TclContract.md line.

No behavior change: an unset CORNERS and an empty one already took the same branch. The two in-tree designs that set it (ihp-sg13g2/i2c-gpio-expander and its I2cDeviceCtrl block) take the per-corner branch as before.

Why

  • Easier to read: $::env(CORNERS) ne "" says what it tests, and the helper call does not.
  • Hard, early failures: a misspelled or erased CORNERS fails at the line that reads it, instead of quietly falling back to the single-scene analysis.
  • Fewer squirrels for AI to chase: an agent asking "what if CORNERS is unset here?" in five scripts now has one answer, in variables.yaml.

Test

Full flows, master vs this branch, logs (runtimes, memory and paths dropped) and every stage metric compared:

design flow covers logs differing metrics differing
ihp-sg13g2/i2c-gpio-expander, CORNERS = slow fast; its I2cDeviceCtrl block, slow typ fast separate / KEEP_VARS=1 multi-scene: define_scene per corner, per-corner power in the reports, write_timing_model -scene for the block's abstract; the abstract's _slow/_typ/_fast.lib and .lef and all 23 reports byte-identical 0 / 0 (of 41) 0 / 0
ihp-sg13g2/gcd separate / KEEP_VARS=1 single scene 0 / 0 (of 18) 0 / 0
nangate45/gcd separate / KEEP_VARS=1 single scene 0 / 0 (of 20) 0 / 0

Unset (removed from OpenROAD's environment, ihp-sg13g2/gcd): master runs on as if it were empty; this branch stops at the read, can't read "::env(CORNERS)": no such variable, in read_liberty.tcl line 5 (floorplan) and in write_binary_libs.tcl line 5.

tclint/tclfmt 0.9.0 are clean on the changed files; this merges cleanly with #4910-#4920.

🤖 Generated with Claude Code

CORNERS selects multi-corner analysis: empty means one unnamed scene
from LIB_FILES, a list names the scenes. It now defaults to "" in
variables.yaml, and the six tests of it in read_liberty.tcl,
generate_abstract.tcl, report_metrics.tcl and write_binary_libs.tcl
read it as `$::env(CORNERS) ne ""` instead of through
env_var_exists_and_non_empty. The AUTO_MEMORIES loop in
read_liberty.tcl iterates the list without a test: foreach over an
empty list does nothing.

No behavior change: an unset CORNERS and an empty one already took the
same branch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Øyvind Harboe <[email protected]>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request defines a default empty string value for the CORNERS variable in flow/scripts/variables.yaml. In accordance with the repository style guide, it replaces the redundant env_var_exists_and_non_empty checks with direct environment variable checks ($::env(CORNERS) ne '') in generate_abstract.tcl, read_liberty.tcl, report_metrics.tcl, and write_binary_libs.tcl. I have no further feedback to provide as the changes are correct and adhere to the guidelines.

@openroad-ci

openroad-ci commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

🔍 QoR check

Metrics reflect the PR merge build — i.e. what will land on the target branch.

Commit db406b8 · Jenkins build #1 · Baseline: build · View build on dashboard

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 58710a4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants