Skip to content

Commit 3688126

Browse files
committed
made it easier to enable wrapped operator synthesis and operator mapping
Signed-off-by: Cho Moon <[email protected]>
1 parent f084b07 commit 3688126

File tree

6 files changed

+33
-6
lines changed

6 files changed

+33
-6
lines changed

flow/scripts/floorplan.tcl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ if { [env_var_exists_and_non_empty FOOTPRINT_TCL] } {
101101
# tie driving multiple buffers that drive multiple outputs.
102102
repair_tie_fanout_helper
103103

104+
if { [env_var_exists_and_non_empty SWAP_ARITH_OPERATORS] } {
105+
estimate_parasitics -placement
106+
replace_arith_modules
107+
}
108+
104109
if { [env_var_equals REMOVE_ABC_BUFFERS 1] } {
105110
# remove buffers inserted by yosys/abc
106111
remove_buffers

flow/scripts/load.tcl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,19 @@ proc load_design { design_file sdc_file } {
1818
}
1919
}
2020
read_verilog $::env(RESULTS_DIR)/$design_file
21-
link_design $::env(DESIGN_NAME)
21+
if { [env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] ||
22+
[env_var_exists_and_non_empty SWAP_ARITH_OPERATORS] } {
23+
link_design -hier $::env(DESIGN_NAME)
24+
} else {
25+
link_design $::env(DESIGN_NAME)
26+
}
2227
} elseif { $ext == ".odb" } {
23-
read_db $::env(RESULTS_DIR)/$design_file
28+
if { [env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] ||
29+
[env_var_exists_and_non_empty SWAP_ARITH_OPERATORS] } {
30+
read_db -hier $::env(RESULTS_DIR)/$design_file
31+
} else {
32+
read_db $::env(RESULTS_DIR)/$design_file
33+
}
2434
} else {
2535
error "Unrecognized input file $design_file"
2636
}

flow/scripts/resize.tcl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ if { [env_var_exists_and_non_empty EARLY_SIZING_CAP_RATIO] } {
1414
log_cmd set_opt_config -set_early_sizing_cap_ratio $env(EARLY_SIZING_CAP_RATIO)
1515
}
1616

17+
if { [env_var_exists_and_non_empty SWAP_ARITH_OPERATORS] } {
18+
replace_arith_modules
19+
}
20+
1721
repair_design_helper
1822

1923
# hold violations are not repaired until after CTS

flow/scripts/synth.tcl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@ json -o $::env(RESULTS_DIR)/mem.json
5656
exec -- $::env(PYTHON_EXE) $::env(SCRIPTS_DIR)/mem_dump.py \
5757
--max-bits $::env(SYNTH_MEMORY_MAX_BITS) $::env(RESULTS_DIR)/mem.json
5858

59-
if { ![env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] } {
60-
synth -top $::env(DESIGN_NAME) -run fine: {*}$synth_full_args
61-
} else {
59+
if { [env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] ||
60+
[env_var_exists_and_non_empty SWAP_ARITH_OPERATORS] } {
6261
source $::env(SCRIPTS_DIR)/synth_wrap_operators.tcl
62+
} else {
63+
synth -top $::env(DESIGN_NAME) -run fine: {*}$synth_full_args
6364
}
6465

6566
# Get rid of indigestibles

flow/scripts/synth_wrap_operators.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ set deferred_cells {
1010
{
1111
\$macc
1212
MACC_{CONFIG}_{Y_WIDTH}{%unused}
13-
{BASE -map +/choices/han-carlson.v}
1413
{BOOTH -max_iter 1 -map ../flow/scripts/synth_wrap_operators-booth.v}
14+
{BASE -map +/choices/han-carlson.v}
1515
}
1616
}
1717

flow/scripts/variables.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,13 @@ SYNTH_WRAPPED_OPERATORS:
269269
the flow.
270270
stages:
271271
- synth
272+
SWAP_ARITH_OPERATORS:
273+
description: >
274+
Improve timing QoR by swapping ALU and MULT arithmetic operators.
275+
stages:
276+
- synth
277+
- floorplan
278+
- place
272279
FLOORPLAN_DEF:
273280
description: |
274281
Use the DEF file to initialize floorplan.

0 commit comments

Comments
 (0)