Skip to content

Commit 13d62e8

Browse files
committed
synth: ABC_SCRIPT replaces the ABC script
ABC_SCRIPT replaces the ABC script synthesis runs, so that a design can vendor and change it, on both the abc and the abc_new path. abc_new now takes the script with -script like abc. It ignored the abc9.script scratchpad the flow set: without -script, abc_new resets that scratchpad to yosys' built-in speed script before mapping. The built-in script and abc_speed_gia_only.script are the same commands, so designs that do not set ABC_SCRIPT synthesize as before. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 5a76f84 commit 13d62e8

5 files changed

Lines changed: 22 additions & 4 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.| |
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: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,6 @@ 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
289-
set abc_args [lrange $abc_args 2 end]
290287
log_cmd abc_new {*}$abc_args
291288
delete {t:$specify*}
292289
}

‎flow/scripts/synth_preamble.tcl‎

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

192-
if { $::env(ABC_AREA) } {
192+
if { [env_var_exists_and_non_empty ABC_SCRIPT] } {
193+
set abc_script $::env(ABC_SCRIPT)
194+
} elseif {
195+
[env_var_equals SYNTH_WRAPPED_OPERATORS 1] ||
196+
[env_var_equals SWAP_ARITH_OPERATORS 1]
197+
} {
198+
set abc_script $::env(SCRIPTS_DIR)/abc_speed_gia_only.script
199+
} elseif { $::env(ABC_AREA) } {
193200
puts "Using ABC area script."
194201
set abc_script $::env(SCRIPTS_DIR)/abc_area.script
195202
} 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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,12 @@ 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.
1044+
stages:
1045+
- synth
10401046
PWR_NETS_VOLTAGES:
10411047
description: |
10421048
Used for IR Drop calculation.

0 commit comments

Comments
 (0)