Skip to content

mpl: RTLMP_MIN_CHANNEL_SIZE defaults to "", pin-aware channels decided without writing ::env - #4925

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

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

Conversation

@oharboe

@oharboe oharboe commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

macro_place_util.tcl turned RTLMP_PIN_AWARE_CHANNELS off by writing 0 into the environment when RTLMP_MIN_CHANNEL_SIZE was empty, and then passed -pin_aware_channels from the variable it had just rewritten. This decides it where the option is added instead:

append_env_var additional_rtlmp_args RTLMP_MIN_CHANNEL_SIZE -min_channel_size 1
# Pin-aware channels trim the channels RTLMP_MIN_CHANNEL_SIZE asks for.
if { $::env(RTLMP_MIN_CHANNEL_SIZE) ne "" && $::env(RTLMP_PIN_AWARE_CHANNELS) } {
  lappend additional_rtlmp_args -pin_aware_channels
}

-pin_aware_channels is passed when a minimum channel size is set and RTLMP_PIN_AWARE_CHANNELS is on, which is what variables.yaml documents ("Requires RTLMP_MIN_CHANNEL_SIZE to also be set. Defaults to 1 whenever RTLMP_MIN_CHANNEL_SIZE is set"). The environment is no longer written.

RTLMP_MIN_CHANNEL_SIZE gets default: "": unset or empty, rtl_macro_placer chooses the channels and pin-aware trimming is off, as before. Seven platforms set it (?=) and 27 designs; none sets it empty.

No TclContract.md line: the Makefile Contract already says "A script never overwrites a variable that is set", and the optional-value rule is the one #4921 adds.

Why

Easier to read: the condition for -pin_aware_channels is on the line that adds it, instead of in an environment write three lines up. Failures are hard and early: a misspelled or erased RTLMP_MIN_CHANNEL_SIZE fails at the line that reads it. And fewer squirrels for AI to chase: a script that rewrites a user's variable makes the log and the configuration disagree, and an agent reading both chases the difference.

Test

gf180/uart-blocks, whose parent places the uart_rx block with rtl_macro_placer and sets RTLMP_MIN_CHANNEL_SIZE = 40 40; master vs this branch, logs (runtimes, memory and paths dropped) and every stage metric compared:

arm target rtl_macro_placer gets, before and after logs differing metrics differing
as configured, separate stages / KEEP_VARS=1 finish -min_channel_size "40 40" -pin_aware_channels 0 / 0 0 / 0
RTLMP_MIN_CHANNEL_SIZE= (empty) floorplan neither option 0 0
RTLMP_PIN_AWARE_CHANNELS=0 floorplan -min_channel_size "40 40" only 0 0

Unset in the tool's environment: master passes neither option; this branch stops at the read, can't read "::env(RTLMP_MIN_CHANNEL_SIZE)": no such variable, in 2_2_floorplan_macro.

tclint/tclfmt 0.9.0 are clean; flow/test test_generate_vars.py and test_make_issue.py pass; this merges cleanly with each of #4910-#4922, and with the other open Tcl cleanup branches.

🤖 Generated with Claude Code

macro_place_util.tcl turned RTLMP_PIN_AWARE_CHANNELS off by writing 0
into the environment when RTLMP_MIN_CHANNEL_SIZE was empty, then passed
-pin_aware_channels from the variable it had just rewritten. Decide it
where the option is added instead: -pin_aware_channels is passed when
RTLMP_MIN_CHANNEL_SIZE is set and RTLMP_PIN_AWARE_CHANNELS is on, which
is what variables.yaml documents. The environment is no longer written.

RTLMP_MIN_CHANNEL_SIZE gets `default: ""`: unset, rtl_macro_placer
chooses the channels, as before.

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 introduces changes to the macro placement utility script and variables configuration. It sets a default empty string value for RTLMP_MIN_CHANNEL_SIZE in variables.yaml and refactors how -pin_aware_channels is appended to the RTLMP arguments in macro_place_util.tcl, checking that RTLMP_MIN_CHANNEL_SIZE is not empty and RTLMP_PIN_AWARE_CHANNELS is active. There are no review comments, and the changes look correct, so I have no feedback to provide.

@oharboe
oharboe marked this pull request as ready for review December 1, 2026 11:20
@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 ca1fd16 · 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