Skip to content

floorplan: the floorplan methods default to "" and are read plainly - #4924

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

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

Conversation

@oharboe

@oharboe oharboe commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

What

A design picks one floorplan method: CORE_UTILIZATION, DIE_AREA with CORE_AREA, FLOORPLAN_DEF, or FOOTPRINT; FOOTPRINT_TCL adds pad placement on top. The six variables now have default: "" in variables.yaml, and:

  • floorplan.tcl tells the methods apart with $::env(X) ne "" instead of env_var_exists_and_non_empty. Its check stays as it is: more than one method is an error ("mutually exclusive"), none is an error ("No floorplan initialization method specified").
  • global_place_skip_io.tcl reads FLOORPLAN_DEF the same way (place is on its stages: list).
  • test_global_connections.py runs floorplan.tcl with an environment of its own; it now gives the methods it does not use as "".

Left as they are: FOOTPRINT and FOOTPRINT_TCL are also read at place (global_place.tcl, pins_fixed_in_floorplan in util.tcl), but their stages: lists do not have place yet, so the staged flow erases them there and a plain read would fail. #4917 adds place to both; those reads can go plain after it. source_env_var_if_exists FOOTPRINT_TCL stays with its helper.

FlowVariables.md renders default: "" as it renders no default, so it is unchanged. The platform configs that test FOOTPRINT_TCL in make (ihp-sg13g2) are read before the defaults are exported, so they see what they saw before. The rule is already proposed in #4912 (a variable with a default is read as $::env(X)) and #4918/#4919 (ne "" where emptiness skips a step), so no new TclContract.md line.

No behavior change.

Why

  • Easier to read: four ne "" tests in a row say "which of these is set".
  • Hard, early failures: a misspelled or erased method variable fails at the line that reads it.
  • Fewer squirrels for AI to chase: "what if CORE_AREA is unset rather than empty?" has one answer now.

Test

Full flows, master vs this branch, logs (runtimes, memory and paths dropped) and every stage metric compared, one design per method in the tree:

design method flow logs differing metrics differing
nangate45/gcd CORE_UTILIZATION separate / KEEP_VARS=1, to 6_report 0 / 0 (of 20) 0 / 0
ihp-sg13g2/gcd CORE_UTILIZATION separate / KEEP_VARS=1, to 6_report 0 / 0 (of 18) 0 / 0
asap7/uart DIE_AREA + CORE_AREA separate / KEEP_VARS=1, to 6_report 0 / 0 (of 20) 0 / 0
ihp-sg13g2/i2c-gpio-expander (+ its block) DIE_AREA + CORE_AREA + FOOTPRINT_TCL (pad.tcl sourced) separate / KEEP_VARS=1, to 6_report 0 / 0 (of 41) 0 / 0
nangate45/aes FLOORPLAN_DEF (read_def -floorplan_initialize, and "FLOORPLAN_DEF is set. Skipping global placement without IOs" at place) separate / KEEP_VARS=1, to place 0 / 0 (of 13) 0 / 0

No configuration in the tree sets FOOTPRINT, so that branch is not run.

The check stays, rerunning 2_1_floorplan on nangate45/gcd, master and this branch alike:

  • none (CORE_UTILIZATION=): Error: No floorplan initialization method specified, exit 1.
  • two (CORE_UTILIZATION plus DIE_AREA and CORE_AREA): Error: Floorplan initialization methods are mutually exclusive, pick one., exit 1.
  • DIE_AREA without CORE_AREA next to CORE_UTILIZATION: the utilization method, as before.

Unset (FLOORPLAN_DEF removed from OpenROAD's environment): master runs on; this branch stops at the read, can't read "::env(FLOORPLAN_DEF)": no such variable, floorplan.tcl line 57.

test_global_connections.py (with load_stage_input stubbed, which it lacks on master too) passes on master and on this branch; without its new CORE_UTILIZATION entry it stops at the read, floorplan.tcl line 60. tclint/tclfmt 0.9.0 are clean on the changed files, black on the test; this merges cleanly with #4910-#4923.

🤖 Generated with Claude Code

DIE_AREA, CORE_AREA, CORE_UTILIZATION, FLOORPLAN_DEF, FOOTPRINT and
FOOTPRINT_TCL now default to "" in variables.yaml. floorplan.tcl tells
the methods apart with `$::env(X) ne ""` instead of
env_var_exists_and_non_empty, and keeps its check that exactly one is
given; global_place_skip_io.tcl reads FLOORPLAN_DEF the same way.

FOOTPRINT and FOOTPRINT_TCL are also read at place (global_place.tcl,
pins_fixed_in_floorplan in util.tcl), where their stages: list does not
reach yet; those reads keep the helper until `place` is on their list.

test_global_connections.py runs floorplan.tcl with an environment of
its own: it gives the methods it does not use as "".

No behavior change.

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 explicit empty string defaults for several floorplan-related variables in flow/scripts/variables.yaml and updates the test environment in test_global_connections.py accordingly. This allows the Tcl scripts floorplan.tcl and global_place_skip_io.tcl to safely use direct $::env(VAR) ne "" checks instead of the env_var_exists_and_non_empty helper, adhering to the repository's style guidelines. There are no review comments, and I have no feedback to provide.

@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 38512a5 · 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