Skip to content

Commit 9f0ac4d

Browse files
authored
Merge pull request #3329 from The-OpenROAD-Project-staging/secure-hier-flow-enh
made it easier to enable wrapped operator synthesis and operator mapping
2 parents 9638e97 + ad681d7 commit 9f0ac4d

File tree

7 files changed

+43
-6
lines changed

7 files changed

+43
-6
lines changed

docs/user/FlowVariables.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ configuration file.
219219
| <a name="SKIP_PIN_SWAP"></a>SKIP_PIN_SWAP| Do not use pin swapping as a transform to fix timing violations (default: use pin swapping).| |
220220
| <a name="SKIP_REPORT_METRICS"></a>SKIP_REPORT_METRICS| If set to 1, then metrics, report_metrics does nothing. Useful to speed up builds.| |
221221
| <a name="SLEW_MARGIN"></a>SLEW_MARGIN| Specifies a slew margin when fixing max slew violations. This option allows you to overfix.| |
222+
| <a name="SWAP_ARITH_OPERATORS"></a>SWAP_ARITH_OPERATORS| Improve timing QoR by swapping ALU and MULT arithmetic operators.| |
222223
| <a name="SYNTH_ARGS"></a>SYNTH_ARGS| Optional synthesis variables for yosys.| |
223224
| <a name="SYNTH_BLACKBOXES"></a>SYNTH_BLACKBOXES| List of cells treated as a black box by Yosys. With Bazel, this can be used to run synthesis in parallel for the large modules of the design.| |
224225
| <a name="SYNTH_GUT"></a>SYNTH_GUT| Load design and remove all internal logic before doing synthesis. This is useful when creating a mock .lef abstract that has a smaller area than the amount of logic would allow. bazel-orfs uses this to mock SRAMs, for instance.| |
@@ -255,6 +256,7 @@ configuration file.
255256
- [MIN_BUF_CELL_AND_PORTS](#MIN_BUF_CELL_AND_PORTS)
256257
- [SDC_FILE](#SDC_FILE)
257258
- [SDC_GUT](#SDC_GUT)
259+
- [SWAP_ARITH_OPERATORS](#SWAP_ARITH_OPERATORS)
258260
- [SYNTH_BLACKBOXES](#SYNTH_BLACKBOXES)
259261
- [SYNTH_GUT](#SYNTH_GUT)
260262
- [SYNTH_HDL_FRONTEND](#SYNTH_HDL_FRONTEND)
@@ -322,6 +324,7 @@ configuration file.
322324
- [SKIP_LAST_GASP](#SKIP_LAST_GASP)
323325
- [SKIP_PIN_SWAP](#SKIP_PIN_SWAP)
324326
- [SKIP_REPORT_METRICS](#SKIP_REPORT_METRICS)
327+
- [SWAP_ARITH_OPERATORS](#SWAP_ARITH_OPERATORS)
325328
- [TAPCELL_TCL](#TAPCELL_TCL)
326329
- [TIEHI_CELL_AND_PORT](#TIEHI_CELL_AND_PORT)
327330
- [TIELO_CELL_AND_PORT](#TIELO_CELL_AND_PORT)
@@ -346,6 +349,7 @@ configuration file.
346349
- [PLACE_PINS_ARGS](#PLACE_PINS_ARGS)
347350
- [ROUTING_LAYER_ADJUSTMENT](#ROUTING_LAYER_ADJUSTMENT)
348351
- [SKIP_REPORT_METRICS](#SKIP_REPORT_METRICS)
352+
- [SWAP_ARITH_OPERATORS](#SWAP_ARITH_OPERATORS)
349353
- [TIE_SEPARATION](#TIE_SEPARATION)
350354

351355
## cts variables

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: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,23 @@ 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 {
22+
[env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] ||
23+
[env_var_exists_and_non_empty SWAP_ARITH_OPERATORS]
24+
} {
25+
link_design -hier $::env(DESIGN_NAME)
26+
} else {
27+
link_design $::env(DESIGN_NAME)
28+
}
2229
} elseif { $ext == ".odb" } {
23-
read_db $::env(RESULTS_DIR)/$design_file
30+
if {
31+
[env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] ||
32+
[env_var_exists_and_non_empty SWAP_ARITH_OPERATORS]
33+
} {
34+
read_db -hier $::env(RESULTS_DIR)/$design_file
35+
} else {
36+
read_db $::env(RESULTS_DIR)/$design_file
37+
}
2438
} else {
2539
error "Unrecognized input file $design_file"
2640
}

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: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,13 @@ 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 {
60+
[env_var_exists_and_non_empty SYNTH_WRAPPED_OPERATORS] ||
61+
[env_var_exists_and_non_empty SWAP_ARITH_OPERATORS]
62+
} {
6263
source $::env(SCRIPTS_DIR)/synth_wrap_operators.tcl
64+
} else {
65+
synth -top $::env(DESIGN_NAME) -run fine: {*}$synth_full_args
6366
}
6467

6568
# 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)