Skip to content

Commit 4f1b14e

Browse files
oharboeclaude
andcommitted
synth: ABC_SCRIPT replaces the ABC script
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 abc_new's built-in default. 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 is dropped: without -script, abc_new resets that scratchpad to its built-in script, which is the same commands as abc_speed_gia_only.script. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 5a76f84 commit 4f1b14e

5 files changed

Lines changed: 23 additions & 3 deletions

File tree

‎docs/user/FlowVariables.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ configuration file.
9393
| <a name="ABC_AREA"></a>ABC_AREA| Strategies for Yosys ABC synthesis: Area/Speed. Default ABC_SPEED.| 0|
9494
| <a name="ABC_DRIVER_CELL"></a>ABC_DRIVER_CELL| Default driver cell used during ABC synthesis.| |
9595
| <a name="ABC_LOAD_IN_FF"></a>ABC_LOAD_IN_FF| During synthesis set_load value used.| |
96+
| <a name="ABC_SCRIPT"></a>ABC_SCRIPT| Replaces the ABC script synthesis runs, so that a design can vendor and change it. Ignored when SYNTH_WRAPPED_OPERATORS or SWAP_ARITH_OPERATORS is set: abc_new then maps each arithmetic operator with its own script.| |
9697
| <a name="ABSTRACT_SOURCE"></a>ABSTRACT_SOURCE| Which .odb file to use to create abstract| |
9798
| <a name="ADDER_MAP_FILE"></a>ADDER_MAP_FILE| Optional mapping file supplied to Yosys to map adders| |
9899
| <a name="ADDITIONAL_FILES"></a>ADDITIONAL_FILES| Additional files to be added to `make issue` archive.| |
@@ -340,6 +341,7 @@ configuration file.
340341
- [ABC_AREA](#ABC_AREA)
341342
- [ABC_DRIVER_CELL](#ABC_DRIVER_CELL)
342343
- [ABC_LOAD_IN_FF](#ABC_LOAD_IN_FF)
344+
- [ABC_SCRIPT](#ABC_SCRIPT)
343345
- [ADDER_MAP_FILE](#ADDER_MAP_FILE)
344346
- [ADDITIONAL_MEMORIES](#ADDITIONAL_MEMORIES)
345347
- [CACHED_REPORTS](#CACHED_REPORTS)

‎flow/scripts/synth.tcl‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,10 @@ if {
284284
} {
285285
log_cmd abc {*}$abc_args
286286
} else {
287-
scratchpad -set abc9.script $::env(SCRIPTS_DIR)/abc_speed_gia_only.script
288-
# crop out -script from arguments
287+
# abc_new maps each arithmetic operator module with the abc9_script
288+
# attribute synth_wrap_operators.tcl sets on it, and every other module
289+
# with its own default. An explicit -script overrides both, so it is
290+
# cropped from the arguments and ABC_SCRIPT does not apply here.
289291
set abc_args [lrange $abc_args 2 end]
290292
log_cmd abc_new {*}$abc_args
291293
delete {t:$specify*}

‎flow/scripts/synth_preamble.tcl‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,10 @@ proc read_design_sources { } {
189189
}
190190
}
191191

192-
if { $::env(ABC_AREA) } {
192+
if { [env_var_exists_and_non_empty ABC_SCRIPT] } {
193+
puts "Using ABC script $::env(ABC_SCRIPT)."
194+
set abc_script $::env(ABC_SCRIPT)
195+
} elseif { $::env(ABC_AREA) } {
193196
puts "Using ABC area script."
194197
set abc_script $::env(SCRIPTS_DIR)/abc_area.script
195198
} else {

‎flow/scripts/variables.json‎

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎flow/scripts/variables.yaml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,13 @@ ABC_AREA:
10371037
stages:
10381038
- synth
10391039
default: 0
1040+
ABC_SCRIPT:
1041+
description: |
1042+
Replaces the ABC script synthesis runs, so that a design can vendor and
1043+
change it. Ignored when SYNTH_WRAPPED_OPERATORS or SWAP_ARITH_OPERATORS
1044+
is set: abc_new then maps each arithmetic operator with its own script.
1045+
stages:
1046+
- synth
10401047
PWR_NETS_VOLTAGES:
10411048
description: |
10421049
Used for IR Drop calculation.

0 commit comments

Comments
 (0)