|
| 1 | +From fbed7c49ffe59cd66e7587c8692dd41c4c498dcd Mon Sep 17 00:00:00 2001 |
| 2 | +From: =?UTF-8?q?=C3=98yvind=20Harboe?= <oyvind.harboe@zylin.com> |
| 3 | +Date: Fri, 15 May 2026 14:52:56 +0200 |
| 4 | +Subject: [PATCH] flow.bzl: pull synth into generate_metadata data deps |
| 5 | +MIME-Version: 1.0 |
| 6 | +Content-Type: text/plain; charset=UTF-8 |
| 7 | +Content-Transfer-Encoding: 8bit |
| 8 | + |
| 9 | +`orfs_generate_metadata`'s action only sees files that reach it via |
| 10 | +the floorplan→cts forwarding chain (`forwarded_names = [CANON_OUTPUT]`) |
| 11 | +plus whatever's passed in `data =`. The chain forwards |
| 12 | +`1_1_yosys_canonicalize.rtlil` but not the post-ABC netlist, so |
| 13 | +`genMetrics.py` reads `1_2_yosys.v` from a path that does not exist |
| 14 | +in the sandbox and `synth__netlist__hash` lands in `metadata.json` |
| 15 | +as `N/A`. |
| 16 | + |
| 17 | +The metadata test rule then surfaces: |
| 18 | + |
| 19 | + [WARN] synth__netlist__hash differs test: N/A == <make-sha> |
| 20 | + |
| 21 | +— a useful tell only by accident, since any non-match yields N/A. |
| 22 | + |
| 23 | +Add the synth step as a data dependency to the metadata step; |
| 24 | +synth's DefaultInfo already exposes every result file (canon RTLIL, |
| 25 | +`1_2_yosys.v`, `1_2_yosys.sdc`, `1_synth.sdc`, …) so this one line |
| 26 | +is enough. Touching every downstream stage's `forwarded_names` to |
| 27 | +thread the netlist through floorplan→final would work too but is |
| 28 | +considerably more invasive. |
| 29 | + |
| 30 | +Verified on `//flow/designs/asap7/uart:uart_test`: bazel-side hash |
| 31 | +moves from `N/A` to `ab8b0b69a2897be911f6f1bd7d0de1649160bc2a` |
| 32 | +(make-side baseline `95652d905a7cf9bc9c935a58e01a76e65327c8b3`). |
| 33 | + |
| 34 | +Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> |
| 35 | +--- |
| 36 | + private/flow.bzl | 8 ++++++++ |
| 37 | + 1 file changed, 8 insertions(+) |
| 38 | + |
| 39 | +diff --git a/private/flow.bzl b/private/flow.bzl |
| 40 | +index b59d059..1519eb8 100644 |
| 41 | +--- a/private/flow.bzl |
| 42 | ++++ b/private/flow.bzl |
| 43 | +@@ -769,6 +769,14 @@ def _orfs_pass( |
| 44 | + data = [ |
| 45 | + # Need 2_floorplan.sdc |
| 46 | + _step_name(name, variant, "floorplan"), |
| 47 | ++ # Need 1_2_yosys.v for `synth__netlist__hash` and any |
| 48 | ++ # other genMetrics.py field that reads synth results |
| 49 | ++ # past the canonicalize RTLIL. Only canonicalize is |
| 50 | ++ # threaded through `forwarded_names = [CANON_OUTPUT]` |
| 51 | ++ # along the floorplan→cts chain; the post-ABC netlist |
| 52 | ++ # is not. Pulling synth's outputs in via `data =` |
| 53 | ++ # gives metadata access without touching every stage. |
| 54 | ++ _step_name(name, variant, "synth"), |
| 55 | + ], |
| 56 | + kwargs = kwargs, |
| 57 | + ) |
| 58 | +-- |
| 59 | +2.51.0 |
| 60 | + |
0 commit comments