Skip to content

Commit a878022

Browse files
authored
Merge pull request #2899 from Pinata-Consulting/synth-parallel
synthesis: support parallel synthesis and rename CACHED_NETLIST to SYNTH_NETLIST_FILES
2 parents d33aa7a + 911d67b commit a878022

File tree

14 files changed

+132
-11
lines changed

14 files changed

+132
-11
lines changed

docs/user/FlowVariables.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,11 @@ configuration file.
179179
| <a name="SKIP_REPORT_METRICS"></a>SKIP_REPORT_METRICS| If set to 1, then metrics, report_metrics does nothing. Useful to speed up builds.| | |
180180
| <a name="SLEW_MARGIN"></a>SLEW_MARGIN| Specifies a slew margin when fixing max slew violations. This option allows you to overfix.| | |
181181
| <a name="SYNTH_ARGS"></a>SYNTH_ARGS| Optional synthesis variables for yosys.| -flatten| |
182+
| <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.| | |
182183
| <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.| | |
183184
| <a name="SYNTH_HIERARCHICAL"></a>SYNTH_HIERARCHICAL| Enable to Synthesis hierarchically, otherwise considered flat synthesis.| 0| |
184185
| <a name="SYNTH_MEMORY_MAX_BITS"></a>SYNTH_MEMORY_MAX_BITS| Maximum number of bits for memory synthesis.| 4096| |
186+
| <a name="SYNTH_NETLIST_FILES"></a>SYNTH_NETLIST_FILES| Skips synthesis and uses the supplied netlist files. If the netlist files contains duplicate modules, which can happen when using hierarchical synthesis on indvidual netlist files and combining here, subsequent modules are silently ignored and only the first module is used.| | |
185187
| <a name="TAPCELL_TCL"></a>TAPCELL_TCL| Path to Endcap and Welltie cells file.| | |
186188
| <a name="TAP_CELL_NAME"></a>TAP_CELL_NAME| Name of the cell to use in tap cell insertion.| | |
187189
| <a name="TECH_LEF"></a>TECH_LEF| A technology LEF file of the PDK that includes all relevant information regarding metal layers, vias, and spacing requirements.| | |
@@ -208,9 +210,11 @@ configuration file.
208210
- [RESYNTH_TIMING_RECOVER](#RESYNTH_TIMING_RECOVER)
209211
- [SDC_FILE](#SDC_FILE)
210212
- [SDC_GUT](#SDC_GUT)
213+
- [SYNTH_BLACKBOXES](#SYNTH_BLACKBOXES)
211214
- [SYNTH_GUT](#SYNTH_GUT)
212215
- [SYNTH_HIERARCHICAL](#SYNTH_HIERARCHICAL)
213216
- [SYNTH_MEMORY_MAX_BITS](#SYNTH_MEMORY_MAX_BITS)
217+
- [SYNTH_NETLIST_FILES](#SYNTH_NETLIST_FILES)
214218
- [TIEHI_CELL_AND_PORT](#TIEHI_CELL_AND_PORT)
215219
- [TIELO_CELL_AND_PORT](#TIELO_CELL_AND_PORT)
216220
- [VERILOG_FILES](#VERILOG_FILES)

flow/BUILD.bazel

Whitespace-only changes.

flow/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ $(SDC_FILE_CLOCK_PERIOD): $(SDC_FILE)
437437
mkdir -p $(dir $@)
438438
echo $(ABC_CLOCK_PERIOD_IN_PS) > $@
439439

440-
YOSYS_DEPENDENCIES=$(DONT_USE_LIBS) $(WRAPPED_LIBS) $(DONT_USE_SC_LIB) $(DFF_LIB_FILE) $(VERILOG_FILES) $(CACHED_NETLIST) $(LATCH_MAP_FILE) $(ADDER_MAP_FILE) $(SDC_FILE_CLOCK_PERIOD)
440+
YOSYS_DEPENDENCIES=$(DONT_USE_LIBS) $(WRAPPED_LIBS) $(DONT_USE_SC_LIB) $(DFF_LIB_FILE) $(VERILOG_FILES) $(SYNTH_NETLIST_FILES) $(LATCH_MAP_FILE) $(ADDER_MAP_FILE) $(SDC_FILE_CLOCK_PERIOD)
441441

442442
.PHONY: yosys-dependencies
443443
yosys-dependencies: $(YOSYS_DEPENDENCIES)

flow/designs/asap7/aes/BUILD.bazel

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
load("@bazel-orfs//:openroad.bzl", "orfs_flow", "orfs_synth")
2+
3+
BLACKBOXES = [
4+
"aes_sbox",
5+
"aes_key_expand_128",
6+
"aes_cipher_top",
7+
]
8+
9+
[orfs_synth(
10+
name = "{name}_netlist_synth".format(name = name),
11+
arguments = {
12+
"SDC_FILE": "$(location :constraint.sdc)",
13+
"SYNTH_BLACKBOXES": " ".join([b for b in BLACKBOXES if b != name]),
14+
},
15+
data = [":constraint.sdc"],
16+
module_top = name,
17+
variant = "netlist",
18+
verilog_files = ["//designs/src/aes:verilog"],
19+
) for name in BLACKBOXES]
20+
21+
[filegroup(
22+
name = "{name}_netlist".format(name = name),
23+
srcs = ["{name}_netlist_synth".format(name = name)],
24+
output_group = "1_synth.v",
25+
) for name in BLACKBOXES]
26+
27+
filegroup(
28+
name = "netlists",
29+
srcs = [":{}_netlist".format(name) for name in BLACKBOXES],
30+
)
31+
32+
orfs_flow(
33+
name = "aes_cipher_top",
34+
arguments = {
35+
"ABC_AREA": "1",
36+
"CORE_UTILIZATION": "40",
37+
"CORE_ASPECT_RATIO": "1",
38+
"CORE_MARGIN": "2",
39+
"PLACE_DENSITY": "0.65",
40+
"TNS_END_PERCENT": "100",
41+
},
42+
sources = {
43+
"SDC_FILE": [":constraint.sdc"],
44+
"SYNTH_NETLIST_FILES": [":netlists"],
45+
},
46+
top = "aes_cipher_top",
47+
)

flow/designs/asap7/aes/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Parallel synthesis with SYNTH_BLACKBOXES
2+
3+
For large designs, it can be useful to split synthesis for the
4+
major blocks and combine the synthesized result.
5+
6+
SYNTH_HIERARCHICAL=1 and MAX_UNGROUP_SIZE can be used to adjust which
7+
modules are flattened and which are kept.
8+
9+
A module that is not flattened, can be built separately without any
10+
loss in quality of results and combined as shown below. The module
11+
that is built separately be built with and without SYNTH_HIERARCHICAL=1.
12+
13+
1. Synthesize aes_key_expand_128 module
14+
15+
make DESIGN_CONFIG=designs/asap7/aes/config.mk FLOW_VARIANT=blackbox clean_synth synth
16+
2. Synthesize top module, which could happen in parallel to 1 but with aes_key_expand_128 blacklisted:
17+
18+
make DESIGN_CONFIG=designs/asap7/aes/config.mk FLOW_VARIANT=top clean_synth synth
19+
3. Combine the synthesis results above:
20+
21+
make DESIGN_CONFIG=designs/asap7/aes/config.mk FLOW_VARIANT=combine clean_synth synth
22+
23+
4. View final result:
24+
25+
make DESIGN_CONFIG=designs/asap7/aes/config.mk FLOW_VARIANT=combine
26+
make DESIGN_CONFIG=designs/asap7/aes/config.mk FLOW_VARIANT=combine gui_final
27+
28+
![alt text](final.png)

flow/designs/asap7/aes/config.mk

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,17 @@ export PLACE_DENSITY = 0.65
1515
export TNS_END_PERCENT = 100
1616
export EQUIVALENCE_CHECK ?= 1
1717
export REMOVE_CELLS_FOR_EQY = TAPCELL*
18+
19+
ifeq ($(FLOW_VARIANT),top)
20+
export DESIGN_NAME = aes_cipher_top
21+
export SYNTH_BLACKBOXES = aes_key_expand_128
22+
else ifeq ($(FLOW_VARIANT),blackbox)
23+
export DESIGN_NAME = aes_key_expand_128
24+
else ifeq ($(FLOW_VARIANT),combine)
25+
export EQUIVALENCE_CHECK = 0
26+
# List blackbox twice to demonstrates that duplicate modules are ignored.
27+
export SYNTH_NETLIST_FILES = \
28+
$(WORK_HOME)/results/$(PLATFORM)/$(DESIGN_NICKNAME)/top/1_synth.v \
29+
$(WORK_HOME)/results/$(PLATFORM)/$(DESIGN_NICKNAME)/blackbox/1_synth.v \
30+
$(WORK_HOME)/results/$(PLATFORM)/$(DESIGN_NICKNAME)/blackbox/1_synth.v
31+
endif

flow/designs/asap7/aes/final.png

580 KB
Loading

flow/designs/gf12/bp_dual/config.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export RTLMP_FENCE_UY ?= 2300
1717

1818
export VERILOG_FILES = $(PLATFORM_DIR)/bp/bsg_ac_black_parrot_dual_core_v0/bsg_chip.sv2v.v \
1919
$(PLATFORM_DIR)/bp/IN12LP_GPIO18_13M9S30P.blackbox.v
20-
export CACHED_NETLIST = $(PLATFORM_DIR)/bp/bsg_ac_black_parrot_dual_core_v0/yosys/bp_dual_hier_yosys_netlist.v
20+
export SYNTH_NETLIST_FILES = $(PLATFORM_DIR)/bp/bsg_ac_black_parrot_dual_core_v0/yosys/bp_dual_hier_yosys_netlist.v
2121

2222
export SDC_FILE = $(PLATFORM_DIR)/bp/bsg_ac_black_parrot_dual_core_v0/bsg_chip.elab.v.sdc
2323

flow/designs/gf12/bp_quad/config.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export PLATFORM = gf12
55
export SYNTH_HIERARCHICAL = 1
66
export MAX_UNGROUP_SIZE ?= 1000
77

8-
export CACHED_NETLIST = $(PLATFORM_DIR)/bp/bsg_ac_black_parrot_quad_core_v0/bp_quad_block/yosys/bp_quad_yosys_netlist.v
8+
export SYNTH_NETLIST_FILES = $(PLATFORM_DIR)/bp/bsg_ac_black_parrot_quad_core_v0/bp_quad_block/yosys/bp_quad_yosys_netlist.v
99
export VERILOG_FILES = $(PLATFORM_DIR)/bp/bsg_ac_black_parrot_quad_core_v0/bp_quad_block/rtl/bsg_chip_block.sv2v.v
1010

1111

flow/designs/gf12/ca53/config.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export PLATFORM = gf12
33

44

55
export VERILOG_FILES = $(PLATFORM_DIR)/$(DESIGN_NAME)/rtl/ca53_cpu.v
6-
export CACHED_NETLIST = $(PLATFORM_DIR)/$(DESIGN_NAME)/rtl/ca53_cpu.v
6+
export SYNTH_NETLIST_FILES = $(PLATFORM_DIR)/$(DESIGN_NAME)/rtl/ca53_cpu.v
77

88
export SDC_FILE = $(PLATFORM_DIR)/$(DESIGN_NAME)/sdc/ca53_cpu.sdc
99

0 commit comments

Comments
 (0)