Repository navigation
synth: ABC_SCRIPT, a design's own script for the abc pass - #4664
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the ABC_SCRIPT environment variable, allowing users to specify a custom ABC script for synthesis. The changes include updating the synthesis preamble script to support this variable and documenting it across configuration and markdown files. The feedback suggests validating that the specified script file exists and warning the user when ABC_SCRIPT is silently ignored due to SYNTH_WRAPPED_OPERATORS or SWAP_ARITH_OPERATORS being enabled, as well as documenting this limitation.
2c68084 to
13d62e8
Compare
🔍 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. |
|
@vvbandeira retrigger? looks like CI outage |
Does not look like CI issues, what I am seeing is a lot of metrics failing. |
Oops... sorry. I looked at the "Error response from daemon: failed to resolve reference "us-docker.pkg.dev/foss-fpga-tools-ext-openroad/openroad/flow-ubuntu22.04-builder:13d62e8a3": us-docker.pkg.dev/foss-fpga-tools-ext-openroad/openroad/flow-ubuntu22.04-builder:13d62e8a3: not found" and concluded it was a CI outage. |
ABC_SCRIPT replaces the ABC script synthesis runs, abc_speed.script or abc_area.script, so that a design can vendor and change it. It applies to the abc path only. The abc_new path, which SYNTH_WRAPPED_OPERATORS and SWAP_ARITH_OPERATORS select, maps each arithmetic operator module with the abc9_script attribute synth_wrap_operators.tcl sets on it, and every other module with the abc9.script scratchpad. An explicit -script overrides both, so it stays cropped from abc_new's arguments; passing one lost the adder architecture the operator swap chose (asap7/riscv32i setup WS -2.5 ps to -123 ps at CTS). The scratchpad abc9.script setting before abc_new stays, with a comment: abc_new installs its own default only when it sees no -script, and it looks for one by searching its arguments for the text "-script", which every /OpenROAD-flow-scripts/... liberty path contains (YosysHQ/yosys#6320). Without the line, every SWAP_ARITH_OPERATORS design fails synthesis. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
TL;DR:
ABC_SCRIPTlets a design use its own ABC script for the classicabcpass, for example a vendored and modifiedabc_speed.script. Designs that don't set it synthesize exactly as before.ABC_SCRIPTreplacesabc_speed.scriptorabc_area.scriptand takes precedence overABC_AREA.abc_new(SYNTH_WRAPPED_OPERATORS,SWAP_ARITH_OPERATORS).abc_newmaps each arithmetic operator module with theabc9_scriptattributesynth_wrap_operators.tclsets, and an explicit-scriptwould override that. An earlier revision passed one, and asap7/riscv32i setup WS went from -2.5 ps to -123 ps at CTS.-scriptstays cropped fromabc_new's arguments.scratchpad -set abc9.script …abc_speed_gia_only.scriptbeforeabc_newstays, and now has a comment. It looks dead:abc_newinstalls its own default script when no-scriptis given. But it decides that by searching its arguments for the text "-script", and every liberty path here is under/OpenROAD-flow-scripts/(abc_new: a "-script" anywhere in the arguments, such as in a liberty path, disables the default script YosysHQ/yosys#6320). Without the line, everySWAP_ARITH_OPERATORSdesign fails synthesis. It can go once ORFS's yosys has the fix.🤖 Generated with Claude Code