Skip to content

Commit cb32ece

Browse files
committed
flow: capture yosys/abc versions + bump submodule to v0.65 for same-version compare
The previous three-way `synth__*_netlist__hash` diagnostic on asap7/uart fired all three warnings, but the canonical-RTLIL header diff turned out to be dominated by a yosys version skew: `tools/install/yosys` reported `Yosys 0.63`, the bazel-pinned yosys reported `Yosys 0.65` (BCR PR registry override), and the `tools/yosys` submodule was at the v0.64 release commit — three versions across three places. Without surfacing the versions in `rules-base.json`, the version skew is invisible to `checkMetadata.py` and easy to misread as non-determinism. Two changes: * Add `synth__yosys__version` and `synth__abc__version` literal warning-level rule entries. - yosys version: `extractTagFromFile` on `1_2_yosys.log` line 1 (the yosys banner), regex `^Yosys (\S+)`. - abc version: `synth_preamble.tcl` runs `yosys-abc -c "version; quit"` via `exec` using the `YOSYS_EXE` env var that `flow/scripts/variables.mk` exports, extracts the "UC Berkeley, ABC <ver>" line and `puts` it to the same log; `genMetrics.py` extracts via `extractTagFromFile`. Now `[WARN] synth__yosys__version differs test: 0.65 == 0.63` appears directly above the netlist-hash warnings whenever the underlying binaries diverge. * Bump `tools/yosys` submodule from `8449dd470` (v0.64 release) to `b85cad634` (v0.65 release, fetched from github.com/YosysHQ/yosys.git since The-OpenROAD-Project fork hasn't synced 0.65 yet). `flow/designs/asap7/uart/rules-base.json` is regenerated from `make … metadata update_rules` against the fresh `tools/install/yosys` 0.65 build, so the baseline hashes belong to make-yosys-0.65 rather than the previous 0.63 build. Several timing thresholds tighten by ~30% (`cts__timing__setup__tns` -1190 → -826, `finish__timing__setup__ws` -46.9 → -35.8 etc.) — that's yosys 0.65's better QoR over 0.63, not a regression. Same-version verification: `tools/install/yosys/bin/yosys -V` and `bazel-out/.../external/yosys+/yosys -V` both report `Yosys 0.65`; `synth__yosys__version` and `synth__abc__version` both pass on bazel `_test`. But the three netlist hashes *still* differ — `cff062a8…` vs `51e1c96c…` on canonical, etc. A line-level diff on the canonicalize RTLIL (`autoidx 5145` is identical on both sides) shows a systematic `+3` offset on the `$<N>y` wire-counter names, indicating the bazel build performs ~3 extra wire-create operations earlier in the front-end that the make build does not. This is real bazel-vs-make build- environment non-determinism in yosys 0.65, distinct from the version skew that caused the earlier confusion. Next investigation should narrow which canonicalize step (`read_design_sources` / `hierarchy -check` / `opt_clean -purge`) contributes the +3 wires. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 09a27cf commit cb32ece

5 files changed

Lines changed: 77 additions & 9 deletions

File tree

‎flow/designs/asap7/uart/rules-base.json‎

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
{
2+
"synth__yosys__version": {
3+
"value": "0.65",
4+
"compare": "==",
5+
"level": "warning"
6+
},
7+
"synth__abc__version": {
8+
"value": "1.01",
9+
"compare": "==",
10+
"level": "warning"
11+
},
212
"synth__canonical_netlist__hash": {
3-
"value": "6e8e16e4f9bdb0e3756653c3bd31fb223f21b445",
13+
"value": "51e1c96c1cbd84acbe6094554dfc328512dada66",
414
"compare": "==",
515
"level": "warning"
616
},
717
"synth__preabc_netlist__hash": {
8-
"value": "4ab7b6700d9ca14e2ee4531aceb79b339aabca73",
18+
"value": "f1b261b2a091a9be65c846a11f71588d55210cee",
919
"compare": "==",
1020
"level": "warning"
1121
},
1222
"synth__netlist__hash": {
13-
"value": "95652d905a7cf9bc9c935a58e01a76e65327c8b3",
23+
"value": "11a8cf6937376ae7e00f0afeee5304fa944a145e",
1424
"compare": "==",
1525
"level": "warning"
1626
},
@@ -47,7 +57,7 @@
4757
"compare": ">="
4858
},
4959
"cts__timing__setup__tns": {
50-
"value": -1190.0,
60+
"value": -826.0,
5161
"compare": ">="
5262
},
5363
"cts__timing__hold__ws": {
@@ -63,11 +73,11 @@
6373
"compare": "<="
6474
},
6575
"globalroute__timing__setup__ws": {
66-
"value": -62.2,
76+
"value": -48.5,
6777
"compare": ">="
6878
},
6979
"globalroute__timing__setup__tns": {
70-
"value": -2090.0,
80+
"value": -1500.0,
7181
"compare": ">="
7282
},
7383
"globalroute__timing__hold__ws": {
@@ -95,11 +105,11 @@
95105
"compare": "<="
96106
},
97107
"finish__timing__setup__ws": {
98-
"value": -46.9,
108+
"value": -35.8,
99109
"compare": ">="
100110
},
101111
"finish__timing__setup__tns": {
102-
"value": -1230.0,
112+
"value": -707.0,
103113
"compare": ">="
104114
},
105115
"finish__timing__hold__ws": {

‎flow/scripts/synth_preamble.tcl‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,31 @@ yosys -import
33
source $::env(SCRIPTS_DIR)/util.tcl
44
erase_non_stage_variables synth
55

6+
# Emit the ABC version into the yosys log so `genMetrics.py` can pick
7+
# it up as `synth__abc__version` (a literal warning-level entry in
8+
# `rules-base.json`). Combined with the yosys version banner already
9+
# at the top of 1_2_yosys.log, this surfaces bazel-vs-make version
10+
# skew directly in `checkMetadata.py` output — the trap that caused
11+
# the earlier "front-end non-determinism" misdiagnosis. See
12+
# flow/README.md "Triaging a failing `_test`" → "Yosys-environment
13+
# false positive".
14+
if { [catch {
15+
# `flow/scripts/variables.mk` exports YOSYS_EXE — yosys-abc is its
16+
# sibling. `info nameofexecutable` returns "./yosys-abc" under
17+
# yosys' embedded tcl, which doesn't resolve at runtime; the
18+
# exported absolute path is the reliable handle.
19+
set _abc_path [file join [file dirname $::env(YOSYS_EXE)] yosys-abc]
20+
set _abc_raw [exec $_abc_path -c "version; quit" 2>@1]
21+
foreach _line [split $_abc_raw "\n"] {
22+
if { [regexp {^UC Berkeley,\s+ABC\s+(\S+)} $_line -> _abc_ver] } {
23+
puts "synth__abc__version: $_abc_ver"
24+
break
25+
}
26+
}
27+
} _err] } {
28+
puts "\[WARN\] synth__abc__version extraction failed: $_err"
29+
}
30+
631
# If using a cached, gate level netlist, then copy over to the results dir with
732
# preserve timestamps flag set. If you don't, subsequent runs will cause the
833
# floorplan step to be re-executed.

‎flow/util/genMetrics.py‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,29 @@ def extract_metrics(
288288
)
289289
metrics_dict["synth__netlist__hash"] = file_sha1(resultPath + "/1_2_yosys.v")
290290

291+
# Yosys + ABC version fingerprints — surface bazel-vs-make
292+
# version skew directly in `checkMetadata.py` output so a netlist
293+
# hash diff isn't first mistaken for non-determinism. The yosys
294+
# banner is the very first line of `1_2_yosys.log`; ABC's version
295+
# is `puts`-emitted by `synth_preamble.tcl` from
296+
# `yosys-abc -c "version; quit"` so it lands in the same log.
297+
extractTagFromFile(
298+
"synth__yosys__version",
299+
metrics_dict,
300+
r"^Yosys\s+(\S+)",
301+
logPath + "/1_2_yosys.log",
302+
t=str,
303+
required=False,
304+
)
305+
extractTagFromFile(
306+
"synth__abc__version",
307+
metrics_dict,
308+
r"^synth__abc__version:\s+(.+?)\s*$",
309+
logPath + "/1_2_yosys.log",
310+
t=str,
311+
required=False,
312+
)
313+
291314
# Clocks
292315
# =========================================================================
293316
clk_list = read_sdc(resultPath + "/2_floorplan.sdc")

‎flow/util/genRuleFile.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ def gen_rule_file(
7979
# surfaces as a [WARN] diagnostic in checkMetadata.py without
8080
# failing the build, matching how rules-base.json already
8181
# treats warning counts.
82+
"synth__yosys__version": {
83+
"mode": "literal",
84+
"compare": "==",
85+
"level": "warning",
86+
},
87+
"synth__abc__version": {
88+
"mode": "literal",
89+
"compare": "==",
90+
"level": "warning",
91+
},
8292
"synth__canonical_netlist__hash": {
8393
"mode": "literal",
8494
"compare": "==",

‎tools/yosys‎

Submodule yosys updated 258 files

0 commit comments

Comments
 (0)