Repository navigation
Conversation
UNSET_ABC9_BOX_CELLS now defaults to "" in variables.yaml, and synth_stdcells.tcl runs `setattr -mod -unset abc9_box` only when it names something: `$::env(UNSET_ABC9_BOX_CELLS) ne ""` instead of `info exists`. Before, a set but empty value ran setattr with no selection. Yosys's default selection leaves out the liberty cells, which are all boxed modules at that point, so the command did nothing; the explicit test says so instead of relying on it. No behavior change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Øyvind Harboe <[email protected]>
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds a default empty string value to the UNSET_ABC9_BOX_CELLS variable in flow/scripts/variables.yaml and updates the conditional check in flow/scripts/synth_stdcells.tcl to verify that the environment variable is not empty instead of just checking its existence. I have no feedback to provide.
oharboe
marked this pull request as ready for review
December 1, 2026 11:22
Member
🔍 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
UNSET_ABC9_BOX_CELLSnow hasdefault: ""invariables.yaml, andsynth_stdcells.tclrunssetattr -mod -unset abc9_boxonly when the variable names something:$::env(UNSET_ABC9_BOX_CELLS) ne ""instead of[info exists ::env(UNSET_ABC9_BOX_CELLS)].What an empty value did before
With
info exists, a set but empty value ransetattr -mod -unset abc9_boxwith no selection, which is yosys's current selection. At that point only the liberty cells are loaded, and they are all boxed modules (-lib,-wb), which yosys's default selection leaves out. So the command did nothing: checked with yosys 0.68 on the asap7 libraries, 56 cells carryabc9_boxbefore and after, and a nangate45/gcd and asap7/gcd yosys synthesis with the variable empty gives the same netlist as with it unset. The empty case worked by that rule of yosys's;ne ""says it instead.One more thing the same check shows, not changed here: a plain cell name selects no boxed module either, so
UNSET_ABC9_BOX_CELLS=XOR2xp5_ASAP7_75t_Rleaves itsabc9_boxset;=XOR2xp5_ASAP7_75t_Rclears it. No configuration in the tree sets the variable.FlowVariables.mdrendersdefault: ""as it renders no default, so it is unchanged. The rule is already proposed in #4912 (a variable with a default is read as$::env(X)) and #4920 (an optional list whose emptiness skips a step is tested withne ""), so no newTclContract.mdline.No behavior change.
Why
ne ""says "only if it names cells";info existsleft the reader to find out what an empty selection means tosetattr.abc9_boxfrom every cell?" took a yosys run to answer; now the script answers it.Test
The script on its own, in yosys 0.68 with two asap7 libraries (
synth_stdcells.tclsourced, then the cells that carryabc9_boxcounted):UNSET_ABC9_BOX_CELLSabc9_boxcan't read "::env(UNSET_ABC9_BOX_CELLS)": no such variableXOR2xp5_ASAP7_75t_RXOR2xp5)XOR2xp5)=XOR2xp5_ASAP7_75t_RXOR2xp5)XOR2xp5)Flows, master vs this branch, logs (runtimes, memory and paths dropped) and every stage metric compared:
KEEP_VARS=1, to6_reportSYNTH_USE_SYN=0(asap7 synthesizes withsynby default, which does not read this script)The yosys netlists (
1_2_yosys.v) are identical apart from the source paths insrcattributes. With the variable empty, nangate45/gcd and asap7/gcd synthesize the same netlist as with it unset, on master and on this branch. With it unset, this branch stops synthesis at the read, as in the table.tclint/tclfmt0.9.0 are clean on the changed file; this merges cleanly with #4910-#4924.🤖 Generated with Claude Code