Skip to content

Commit 3451ca1

Browse files
authored
Merge pull request #4664 from oharboe/abc-script
synth: ABC_SCRIPT, a design's own script for the abc pass
2 parents f7dff2f + 694d065 commit 3451ca1

5 files changed

Lines changed: 25 additions & 2 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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,13 @@ if {
284284
} {
285285
log_cmd abc {*}$abc_args
286286
} else {
287+
# Not dead code: abc_new mistakes the "-script" in /OpenROAD-flow-scripts/...
288+
# paths for a given -script and drops its default (YosysHQ/yosys#6320).
287289
scratchpad -set abc9.script $::env(SCRIPTS_DIR)/abc_speed_gia_only.script
288-
# crop out -script from arguments
290+
# abc_new maps each arithmetic operator module with the abc9_script
291+
# attribute synth_wrap_operators.tcl sets on it, and every other module
292+
# with the script above. An explicit -script overrides both, so it is
293+
# cropped from the arguments and ABC_SCRIPT does not apply here.
289294
set abc_args [lrange $abc_args 2 end]
290295
log_cmd abc_new {*}$abc_args
291296
delete {t:$specify*}

‎flow/scripts/synth_preamble.tcl‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,10 @@ proc read_design_sources { } {
208208
}
209209
}
210210

211-
if { $::env(ABC_AREA) } {
211+
if { [env_var_exists_and_non_empty ABC_SCRIPT] } {
212+
puts "Using ABC script $::env(ABC_SCRIPT)."
213+
set abc_script $::env(ABC_SCRIPT)
214+
} elseif { $::env(ABC_AREA) } {
212215
puts "Using ABC area script."
213216
set abc_script $::env(SCRIPTS_DIR)/abc_area.script
214217
} 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)