Repository navigation
synth: ABC_LIBERTY_ARGS, extra arguments for ABC's read_lib - #4730
dvanblerkom wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Daniel Van Blerkom <vanblerkom@gmail.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a new configuration variable, ABC_LIBERTY_ARGS, which allows passing extra arguments to ABC's read_lib via Yosys's abc -liberty_args during synthesis. The changes include updating the synthesis script (synth.tcl), documenting the variable in FlowVariables.md, and defining it in both variables.json and variables.yaml. The review feedback recommends replacing the British spelling 'minimises' with the American spelling 'minimizes' in the variable's description across the documentation and configuration files to maintain consistency with the rest of the codebase.
| | --- | --- | --- | | ||
| | <a name="ABC_AREA"></a>ABC_AREA| Strategies for Yosys ABC synthesis: Area/Speed. Default ABC_SPEED.| 0| | ||
| | <a name="ABC_DRIVER_CELL"></a>ABC_DRIVER_CELL| Default driver cell used during ABC synthesis.| | | ||
| | <a name="ABC_LIBERTY_ARGS"></a>ABC_LIBERTY_ARGS| Extra arguments for ABC's read_lib, passed with Yosys's abc -liberty_args. Without -S/-G, ABC's mapping library gives every cell a delay of 1, so mapping minimises gate count, not delay. "-a -G 250" derives a delay for each cell from the liberty tables (all cells, gain 250). Ignored when SYNTH_WRAPPED_OPERATORS or SWAP_ARITH_OPERATORS is set: abc_new has no such option.| | |
There was a problem hiding this comment.
To maintain consistency with the rest of the codebase and documentation, please use the American English spelling "minimizes" instead of "minimises".
| | <a name="ABC_LIBERTY_ARGS"></a>ABC_LIBERTY_ARGS| Extra arguments for ABC's read_lib, passed with Yosys's abc -liberty_args. Without -S/-G, ABC's mapping library gives every cell a delay of 1, so mapping minimises gate count, not delay. "-a -G 250" derives a delay for each cell from the liberty tables (all cells, gain 250). Ignored when SYNTH_WRAPPED_OPERATORS or SWAP_ARITH_OPERATORS is set: abc_new has no such option.| | | |
| | <a name="ABC_LIBERTY_ARGS"></a>ABC_LIBERTY_ARGS| Extra arguments for ABC's read_lib, passed with Yosys's abc -liberty_args. Without -S/-G, ABC's mapping library gives every cell a delay of 1, so mapping minimizes gate count, not delay. "-a -G 250" derives a delay for each cell from the liberty tables (all cells, gain 250). Ignored when SYNTH_WRAPPED_OPERATORS or SWAP_ARITH_OPERATORS is set: abc_new has no such option.| | |
| ] | ||
| }, | ||
| "ABC_LIBERTY_ARGS": { | ||
| "description": "Extra arguments for ABC's read_lib, passed with Yosys's\nabc -liberty_args. Without -S/-G, ABC's mapping library gives every\ncell a delay of 1, so mapping minimises gate count, not delay.\n\"-a -G 250\" derives a delay for each cell from the liberty tables\n(all cells, gain 250). Ignored when SYNTH_WRAPPED_OPERATORS or\nSWAP_ARITH_OPERATORS is set: abc_new has no such option.\n", |
There was a problem hiding this comment.
To maintain consistency with the rest of the codebase and documentation, please use the American English spelling "minimizes" instead of "minimises".
| "description": "Extra arguments for ABC's read_lib, passed with Yosys's\nabc -liberty_args. Without -S/-G, ABC's mapping library gives every\ncell a delay of 1, so mapping minimises gate count, not delay.\n\"-a -G 250\" derives a delay for each cell from the liberty tables\n(all cells, gain 250). Ignored when SYNTH_WRAPPED_OPERATORS or\nSWAP_ARITH_OPERATORS is set: abc_new has no such option.\n", | |
| "description": "Extra arguments for ABC's read_lib, passed with Yosys's\nabc -liberty_args. Without -S/-G, ABC's mapping library gives every\ncell a delay of 1, so mapping minimizes gate count, not delay.\n\"-a -G 250\" derives a delay for each cell from the liberty tables\n(all cells, gain 250). Ignored when SYNTH_WRAPPED_OPERATORS or\nSWAP_ARITH_OPERATORS is set: abc_new has no such option.\n", |
| description: | | ||
| Extra arguments for ABC's read_lib, passed with Yosys's | ||
| abc -liberty_args. Without -S/-G, ABC's mapping library gives every | ||
| cell a delay of 1, so mapping minimises gate count, not delay. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Daniel Van Blerkom <vanblerkom@gmail.com>
TL;DR:
ABC_LIBERTY_ARGSpasses extra arguments to ABC'sread_libthrough Yosys'sabc -liberty_args(YosysHQ/yosys#5721). Without-S/-G, the mapping library ABC builds from the liberty files gives every cell a delay of 1.0, so the speed script maps for gate count rather than delay. WithABC_LIBERTY_ARGS="-a -G 250", ABC derives a delay for each cell from the liberty tables. Designs that don't set the variable synthesize exactly as before.abccall.abc_new(SYNTH_WRAPPED_OPERATORS,SWAP_ARITH_OPERATORS) has no-liberty_args, so it is not added to the sharedabc_args.read_lib -w <lib>; write_genlib x.genlibwritesPIN * UNKNOWN 1 999 1.00 0.00 1.00 0.00for every gate. Afterread_lib -a -G 250each pin carries its own delay.-G 250on 12 designs (NanGate45, post-synthesis STA).variables.jsonandFlowVariables.mdare regenerated.Results
Setup WNS / TNS in ns at CTS,
cts__design__instance__arearelative to master. One run per configuration.ABC_LIBERTY_ARGS="-a -G 250"ABC_AREA=1)ABC_AREA=1)abc_area.script(map -B 0.9) produces the same netlist either way.How this was tested
make synthused this branch'sflow/scriptson master cca3a71, with Yosys 0.68+ from theopenroad/orfs:26Q4-102-gef421749aimage. Floorplan to CTS ran in that image's ORFS on the resulting netlist (SYNTH_NETLIST_FILES). Master's later stages need a newer OpenROAD than that image has. The stages after synthesis are the same for both columns.Not done: asap7, gf180, ihp-sg13g2, and the CI metrics rules (no design sets the variable, so nothing changes there).
Possible follow-up, not in this PR: make
-a -G 250the default for the speed script. That would change the QoR of every design using the classicabcpath, so it needs a CI-wide run first.🤖 Generated with Claude Code