Skip to content

Commit ec4872d

Browse files
committed
bazel: trying out parallel synthesis
Signed-off-by: Øyvind Harboe <[email protected]>
1 parent ebb3eb0 commit ec4872d

File tree

1 file changed

+71
-35
lines changed

1 file changed

+71
-35
lines changed
Lines changed: 71 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,86 @@
1-
load("@bazel-orfs//:openroad.bzl", "orfs_macro")
2-
load("@bazel-orfs//:sweep.bzl", "orfs_sweep")
3-
load("//util:plot_congestion.bzl", "plot_congestion")
4-
5-
# Format densities, rounding to 2 decimal places.
6-
SWEEPS = {
7-
"PLACE_DENSITY_LB_ADDON": [str(0.20 + x * 0.01 + 0.005)[:4] for x in range(10)],
8-
"CORE_UTILIZATION": [str(40 + x * 5) for x in range(4)],
9-
}
10-
11-
SWEEP = "PLACE_DENSITY_LB_ADDON"
1+
load("@bazel-orfs//:openroad.bzl", "orfs_flow", "orfs_macro", "orfs_synth")
122

133
FAKERAMS = [
144
"fakeram7_64x21",
155
"fakeram7_256x34",
166
"fakeram7_2048x39",
177
]
188

9+
# BLACKBOXES are those listed in SYNTH_HIERARCHICAL=1
10+
#
11+
# 33.1. IC_DATA_ICACHE_TAG_HIGH12_ICACHE_TAG_LOW6_ICACHE_IC_DEPTH8' to `<abc-temp-dir>/input.blif'..
12+
13+
BLACKBOXES = [
14+
"IC_TAG_ICACHE_TAG_HIGH12_ICACHE_TAG_LOW6_ICACHE_TAG_DEPTH64",
15+
"dbg",
16+
"dec_decode_ctl",
17+
"dec_gpr_ctl_GPR_BANKS1_GPR_BANKS_LOG21",
18+
"dec_ib_ctl",
19+
"dec_tlu_ctl",
20+
"dec_trigger",
21+
"dma_ctrl",
22+
"exu_alu_ctl",
23+
"ifu_aln_ctl",
24+
"ifu_bp_ctl",
25+
"ifu_ifc_ctl",
26+
"ifu_mem_ctl",
27+
"lsu_bus_intf",
28+
"lsu_dccm_ctl",
29+
"lsu_ecc",
30+
"lsu_lsc_ctl",
31+
"lsu_stbuf",
32+
"lsu_trigger",
33+
"pic_ctrl",
34+
"ram_256x34",
35+
# When run with SYNTH_HIERARCHICAL=1, which should not be used here,
36+
# the error below is produced.
37+
#
38+
# ERROR: Missing cost information on instanced blackbox lsu_dccm_mem
39+
"lsu_dccm_mem",
40+
"exu_div_ctl",
41+
"lsu_bus_buffer",
42+
"ram_2048x39",
43+
"exu",
44+
"swerv_wrapper",
45+
]
46+
47+
[orfs_synth(
48+
name = "{name}_netlist_synth".format(name = name),
49+
arguments = {
50+
"SDC_FILE": "$(location :constraint.sdc)",
51+
"SYNTH_BLACKBOXES": " ".join([b for b in BLACKBOXES if b != name]),
52+
"SYNTH_HIERARCHICAL": "0",
53+
},
54+
data = [":constraint.sdc"],
55+
module_top = name,
56+
variant = "netlist",
57+
verilog_files = [
58+
"macros.v",
59+
"//designs/src/swerv:verilog",
60+
],
61+
deps = FAKERAMS,
62+
) for name in BLACKBOXES]
63+
64+
[filegroup(
65+
name = "{name}_netlist".format(name = name),
66+
srcs = ["{name}_netlist_synth".format(name = name)],
67+
output_group = "1_synth.v",
68+
) for name in BLACKBOXES]
69+
70+
# ca. 540 seconds for sequential synthesis, vs 90 seconds for netlist synthesis.
71+
filegroup(
72+
name = "netlists",
73+
srcs = [":{}_netlist".format(name) for name in BLACKBOXES],
74+
)
75+
1976
[orfs_macro(
2077
name = top,
2178
lef = "lef/{}.lef".format(top),
2279
lib = "lib/{}.lib".format(top),
2380
module_top = top,
2481
) for top in FAKERAMS]
2582

26-
orfs_sweep(
83+
orfs_flow(
2784
name = "swerv_wrapper",
2885
arguments = {
2986
"LIB_MODEL": "CCS",
@@ -41,30 +98,9 @@ orfs_sweep(
4198
"GND_NETS_VOLTAGES": "",
4299
},
43100
macros = FAKERAMS,
44-
other_variants = {"base": {}},
45101
sources = {
46102
"SDC_FILE": [":constraint.sdc"],
103+
"SYNTH_NETLIST_FILES": [":netlists"],
47104
},
48-
sweep = {
49-
value: {
50-
"arguments": {
51-
SWEEP: value,
52-
},
53-
"previous_stage": {
54-
"floorplan": "swerv_wrapper_synth",
55-
},
56-
}
57-
for value in SWEEPS[SWEEP]
58-
},
59-
verilog_files = [
60-
"macros.v",
61-
"//designs/src/swerv:verilog",
62-
],
63-
)
64-
65-
plot_congestion(
66-
name = "plot",
67-
srcs = [":swerv_wrapper_{value}_grt".format(value = value) for value in SWEEPS[SWEEP]],
68-
argument = SWEEP,
69-
values = SWEEPS[SWEEP],
105+
verilog_files = [],
70106
)

0 commit comments

Comments
 (0)