Skip to content

Commit a498113

Browse files
oharboeclaude
andcommitted
designs: forced-engine flow variants and asap7 OpenROAD-SYN suites
Every design() gets manual full-flow variants that pin the synthesis engine regardless of the config.mk default: <name>_syn_* forces SYNTH_USE_SYN=1 so any design can be tested under OpenROAD-SYN before its config.mk switches, and <name>_yosys_* forces the yosys engine so the baseline stays reproducible after a switch (asap7/gcd today). Designs with a rules-base.json get two QoR gates per variant, both checking the design's regular rules file with the regular checkMetadata.py — the local counterpart of the Jenkins/dashboard signal: <name>_<engine>_test runs the full flow against all rules; <name>_<engine>_synth_test is the minutes-scale iteration tier, checking only the synth__/constraints__ subset while sharing its synthesis action with the full-flow test. //flow/designs/asap7:syn_test and :syn_synth_test aggregate the 14 suite designs (fastest first, known failures included by design — the suites are a status signal, not a green-only gate; slow designs are documented in SYN_SLOW_DESIGNS and reproduced individually). gcd's single-process comparison consumes the generated gcd_yosys_* variant instead of hand-rolling its own yosys-engine flow. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 8ca0388 commit a498113

3 files changed

Lines changed: 182 additions & 8 deletions

File tree

‎flow/designs/asap7/BUILD‎

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# OpenROAD-SYN test suites for asap7 — the local counterpart of the
2+
# Jenkins QoR signal (https://dashboard.precisioninno.com/).
3+
#
4+
# Every design gets manual forced-engine flow variants from the
5+
# config.mk DSL (see flow/designs/design.bzl): <name>_syn_* pins
6+
# SYNTH_USE_SYN=1 and <name>_yosys_* pins the yosys engine, regardless
7+
# of the config.mk default. Designs with a rules-base.json get two QoR
8+
# gates per variant, both checking the design's regular rules file with
9+
# the regular checkMetadata.py — congruent with what Jenkins measures:
10+
#
11+
# bazelisk test --keep_going //flow/designs/asap7:syn_synth_test
12+
# Fast tier: synthesis only, checks the synth__/constraints__ subset
13+
# of rules-base.json. Minutes-scale; QoR-only (no LEC), so it cannot
14+
# prove correctness — use it to iterate, not to conclude.
15+
#
16+
# bazelisk test --keep_going //flow/designs/asap7:syn_test
17+
# Full flow, all rules-base.json gates. The real signal; shares its
18+
# synthesis action with the fast tier.
19+
#
20+
# Sharpening the loop on one design or stage:
21+
#
22+
# bazelisk test //flow/designs/asap7/jpeg:jpeg_encoder_syn_synth_test
23+
# bazelisk test //flow/designs/asap7/jpeg:jpeg_encoder_syn_test
24+
# bazelisk build //flow/designs/asap7/jpeg:jpeg_encoder_syn_route
25+
# bazelisk test //flow/designs/asap7/gcd:gcd_yosys_test # yosys A/B
26+
#
27+
# Both suites deliberately include designs that fail OpenROAD-SYN today
28+
# — they are a status signal, not a green-only gate. A design can fail
29+
# by not synthesizing at all, or by missing rules-base.json gates that
30+
# its regular flow meets.
31+
32+
# Design directory -> DESIGN_NAME (bazel target prefix), ordered
33+
# fastest-first so --keep_going runs surface quick failures early.
34+
# Known failures / quirks are listed last. "minimal" is excluded: it
35+
# has no VERILOG_FILES and thus no generated design targets.
36+
#
37+
# Known OpenROAD-SYN failures today:
38+
# - mock-alu: SDC references yosys-style register names (*io_out_REG*)
39+
# absent from the SYN netlist.
40+
# - riscv32i: slang rejects procedural assignment to nets (dmem.v).
41+
# - mock-cpu: slang rejects endianness-mismatched part-select
42+
# (wptr_full.v).
43+
# - aes-block: hierarchical BLOCKS; synthesizes, but SYN area blows past
44+
# the yosys-derived rules-base.json gate.
45+
SYN_TEST_DESIGNS = {
46+
"gcd": "gcd", # smoketest, fast
47+
"uart": "uart",
48+
"mock-alu": "MockAlu",
49+
"riscv32i": "riscv_top",
50+
"aes": "aes_cipher_top",
51+
"aes_lvt": "aes_cipher_top",
52+
"aes-mbff": "aes_cipher_top",
53+
"jpeg": "jpeg_encoder",
54+
"jpeg_lvt": "jpeg_encoder",
55+
"ethmac": "ethmac",
56+
"ethmac_lvt": "ethmac",
57+
"mock-cpu": "mock_cpu",
58+
"gcd-ccs": "gcd", # CCS liberty
59+
"aes-block": "aes_cipher_top", # hierarchical BLOCKS
60+
}
61+
62+
# Designs whose OpenROAD-SYN run is too slow (or does not terminate) for
63+
# the suites. Their generated per-design targets stay tags=["manual"]
64+
# like all forced-engine targets, but they are deliberately left out of
65+
# the suites so those remain runnable; reproduce individually, e.g.
66+
# bazelisk build //flow/designs/asap7/ibex:ibex_core_syn_synth
67+
#
68+
# - ibex: sv_elaborate/synthesize/repair_design complete in seconds, but
69+
# report_metrics ("Report metrics stage 1, synth...") spins in STA for
70+
# hours (observed >2h on 48 threads with no progress).
71+
# - cva6: synthesize itself takes ~73s, but repair_design -pre_placement
72+
# was still running after 10+ minutes when the status sweep was cut
73+
# off; not yet characterized to completion.
74+
# - swerv_wrapper: largest design in the suite; not yet run to
75+
# completion under OpenROAD-SYN in this environment.
76+
# - riscv32i-mock-sram: hierarchical BLOCKS (fakeram) — the syn variant
77+
# first needs the block's full PnR flow for its abstract; not yet run
78+
# to completion.
79+
SYN_SLOW_DESIGNS = {
80+
"cva6": "cva6",
81+
"ibex": "ibex_core",
82+
"riscv32i-mock-sram": "riscv_top",
83+
"swerv_wrapper": "swerv_wrapper",
84+
}
85+
86+
# Explicitly listed manual tests DO run through a test_suite (the manual
87+
# tag only exempts them from wildcard expansion); the suites themselves
88+
# are manual so `bazelisk test //flow/...` does not pull them in either.
89+
test_suite(
90+
name = "syn_test",
91+
tags = ["manual"],
92+
tests = [
93+
"//flow/designs/asap7/{pkg}:{name}_syn_test".format(
94+
name = name,
95+
pkg = pkg,
96+
)
97+
for pkg, name in SYN_TEST_DESIGNS.items()
98+
],
99+
)
100+
101+
test_suite(
102+
name = "syn_synth_test",
103+
tags = ["manual"],
104+
tests = [
105+
"//flow/designs/asap7/{pkg}:{name}_syn_synth_test".format(
106+
name = name,
107+
pkg = pkg,
108+
)
109+
for pkg, name in SYN_TEST_DESIGNS.items()
110+
],
111+
)

‎flow/designs/asap7/gcd/BUILD‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ load("@orfs_designs//:designs.bzl", "DESIGNS")
33
load("@rules_shell//shell:sh_test.bzl", "sh_test")
44
load("//flow/designs:design.bzl", "design")
55

6-
# SYNTH_USE_SYN is make-only for now: bazel-orfs's synth stage always
7-
# runs the yosys flow and neither stages the Verilog sources nor sets
8-
# VERILOG_FILES for the OpenROAD synthesis step, so the built-in
9-
# synthesizer opt-in must not reach the bazel arguments.
6+
# gcd's regular flow follows config.mk onto OpenROAD-SYN
7+
# (SYNTH_USE_SYN=1). The single-process comparison below deliberately
8+
# exercises the yosys netlist path (single_flow.tcl seeds from
9+
# 1_2_yosys.v), so it consumes the forced-yosys gcd_yosys_* variant the
10+
# config.mk DSL emits for every design (see flow/designs/design.bzl).
1011
design(
1112
config = "config.mk",
12-
local_arguments = ["SYNTH_USE_SYN"],
1313
)
1414

1515
# Stage-boundary .odb/.sdc stems shared by the normal per-stage flow
@@ -56,7 +56,7 @@ SINGLE_FLOW_EXTRA_OUTS = [
5656
# this package.
5757
orfs_run(
5858
name = "gcd_single_flow",
59-
src = ":gcd_synth",
59+
src = ":gcd_yosys_synth",
6060
outs = [
6161
"results/asap7/gcd/single/{}.{}".format(stem, ext)
6262
for stem in SINGLE_FLOW_STAGES.values()
@@ -79,11 +79,13 @@ orfs_run(
7979
variant = "single",
8080
)
8181

82-
# Normal-flow stage outputs, one filegroup per compared file.
82+
# Normal-flow stage outputs, one filegroup per compared file. Taken from
83+
# the yosys-engine variant above so both sides of the byte-compare start
84+
# from the same yosys netlist.
8385
[
8486
filegroup(
8587
name = "gcd_base_{}_{}".format(stage, ext),
86-
srcs = [":gcd_" + stage],
88+
srcs = [":gcd_yosys_" + stage],
8789
output_group = "{}.{}".format(stem, ext),
8890
)
8991
for stage, stem in SINGLE_FLOW_STAGES.items()

‎flow/designs/design.bzl‎

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""BUILD boilerplate for flow/designs/."""
22

3+
load("@bazel-orfs//:openroad.bzl", "orfs_flow")
34
load("@orfs_designs//:designs.bzl", "orfs_design")
45

56
# Per filegroup target: extensions included in the filegroup.
@@ -51,6 +52,65 @@ def _export_design_files():
5152
visibility = ["//visibility:private"],
5253
)
5354

55+
def _engine_variant_targets(
56+
name,
57+
platform,
58+
verilog_files,
59+
arguments,
60+
user_arguments,
61+
sources,
62+
user_sources,
63+
macros,
64+
stage_data,
65+
tags): # buildifier: disable=unused-variable
66+
"""Forced-engine flow variants for one design (orfs_design extra hook).
67+
68+
Emits, always tagged "manual" (even for CI designs, so only explicit
69+
invocations such as //flow/designs/asap7:syn_test run them), two full
70+
flows that pin the synthesis engine regardless of the config.mk
71+
default:
72+
73+
- variant "syn": SYNTH_USE_SYN=1 (OpenROAD-SYN) — lets any design be
74+
tested under OpenROAD-SYN before its config.mk officially switches.
75+
- variant "yosys": SYNTH_USE_SYN=0 — keeps the yosys baseline
76+
reproducible after a design officially switches (e.g. asap7/gcd).
77+
78+
When the design has a rules-base.json each variant gets the same QoR
79+
gates as the regular flow, congruent with the Jenkins/dashboard
80+
signal because they check the same rules file with the same script:
81+
82+
- <name>_<engine>_test: the full flow gated on all of rules-base.json
83+
(the real, dashboard-equivalent gate).
84+
- <name>_<engine>_synth_test: the fast tier — synthesis plus a check
85+
of only the synth__/constraints__ subset of rules-base.json.
86+
QoR-only (no LEC), but a minutes-scale iteration signal that shares
87+
its synth action with the full-flow variant.
88+
89+
The generated <name>_<engine>_update targets must NOT be run: they
90+
would overwrite the design's rules-base.json with the forced engine's
91+
numbers.
92+
"""
93+
for engine, use_syn in [("syn", "1"), ("yosys", "0")]:
94+
orfs_flow(
95+
name = name,
96+
verilog_files = verilog_files,
97+
pdk = "//flow:" + platform,
98+
arguments = arguments | {"SYNTH_USE_SYN": use_syn},
99+
user_arguments = user_arguments,
100+
# sources carries the auto-detected rules-base.json as
101+
# RULES_JSON, which gates the variant's tests.
102+
sources = sources,
103+
user_sources = user_sources,
104+
macros = macros,
105+
stage_data = stage_data,
106+
variant = engine,
107+
tags = ["manual"],
108+
test_kwargs = {"tags": ["manual"]},
109+
# Sibling packages consume stage outputs (e.g. asap7/gcd's
110+
# single-process comparison seeds from the yosys netlist).
111+
visibility = ["//visibility:public"],
112+
)
113+
54114
def design(config = "config.mk", user_arguments = [], user_sources = [], local_arguments = []):
55115
"""Standard BUILD body for flow/designs/<platform>/<design>/.
56116
@@ -75,6 +135,7 @@ def design(config = "config.mk", user_arguments = [], user_sources = [], local_a
75135
user_sources = user_sources,
76136
local_arguments = local_arguments,
77137
blender = True,
138+
extra = _engine_variant_targets,
78139
)
79140

80141
def files(group, extra_srcs = None):

0 commit comments

Comments
 (0)