|
| 1 | +private/rules.bzl: SYNTH_STUB_OUTPUTS + OrfsInfo.lef/lib_pre_layout for synth |
| 2 | + |
| 3 | +--- a/private/rules.bzl |
| 4 | ++++ b/private/rules.bzl |
| 5 | +@@ -744,8 +744,21 @@ |
| 6 | + |
| 7 | + CANON_OUTPUT = "1_1_yosys_canonicalize.rtlil" |
| 8 | + SYNTH_OUTPUTS = ["1_2_yosys.v", "1_2_yosys.sdc", "1_synth.sdc", "mem.json"] |
| 9 | ++# Synth-stage stub artifacts: port-only LEF + Liberty emitted by |
| 10 | ++# synth_odb.tcl (when ORFS_WRITE_SYNTH_STUBS=1). Parents instantiating |
| 11 | ++# this design as a macro consume them at synth_odb time so they don't |
| 12 | ++# have to wait for our floorplan/place/cts to produce real LEF and |
| 13 | ++# post-place Liberty. Augmented in place by lefin when the real LEF |
| 14 | ++# is read at the parent's floorplan stage (load.tcl's |
| 15 | ++# ORFS_AUGMENT_STUB_MASTERS path). Filename is per-design to avoid |
| 16 | ++# lefin's `library (1_synth) already exists` error when a parent |
| 17 | ++# reads multiple sibling stubs (lefin derives library name from LEF |
| 18 | ++# basename). |
| 19 | + SYNTH_REPORTS = ["synth_stat.txt", "synth_mocked_memories.txt"] |
| 20 | + |
| 21 | ++def synth_stub_outputs(module_top): |
| 22 | ++ return ["{}_1_synth.lef".format(module_top), "{}_1_synth.lib".format(module_top)] |
| 23 | ++ |
| 24 | + def _yosys_parallel_synth(ctx, config, canon_output, synth_outputs, synth_logs, synth_reports, num_partitions, save_odb, all_arguments = {}): |
| 25 | + """Parallel synthesis: keep → kept-json → N partitions → merge. |
| 26 | + |
| 27 | +@@ -1123,7 +1136,10 @@ |
| 28 | + deps_inputs(ctx), |
| 29 | + ], |
| 30 | + ), |
| 31 | +- outputs = [synth_outputs["1_synth.odb"], synth_outputs["1_synth.sdc"]], |
| 32 | ++ outputs = [ |
| 33 | ++ synth_outputs["1_synth.odb"], |
| 34 | ++ synth_outputs["1_synth.sdc"], |
| 35 | ++ ] + [synth_outputs[n] for n in synth_stub_outputs(ctx.attr.module_top)], |
| 36 | + tools = yosys_and_flow_tools, |
| 37 | + ) |
| 38 | + |
| 39 | +@@ -1199,8 +1215,9 @@ |
| 40 | + |
| 41 | + synth_logs = declare_artifacts(ctx, "logs", ["1_2_yosys.log", "1_2_yosys_metrics.log"] + (["1_synth.log"] if save_odb else [])) |
| 42 | + |
| 43 | ++ stub_outputs = synth_stub_outputs(ctx.attr.module_top) if save_odb else [] |
| 44 | + synth_outputs = {} |
| 45 | +- for output in SYNTH_OUTPUTS + (["1_synth.odb"] if save_odb else []): |
| 46 | ++ for output in SYNTH_OUTPUTS + (["1_synth.odb"] + stub_outputs if save_odb else []): |
| 47 | + synth_outputs[output] = declare_artifact(ctx, "results", output) |
| 48 | + |
| 49 | + synth_reports = declare_artifacts(ctx, "reports", SYNTH_REPORTS) |
| 50 | +@@ -1415,9 +1432,17 @@ |
| 51 | + variant = ctx.attr.variant, |
| 52 | + odb = synth_outputs.get("1_synth.odb"), |
| 53 | + gds = None, |
| 54 | +- lef = None, |
| 55 | ++ # Port-only stub LEF + Liberty written by synth_odb.tcl |
| 56 | ++ # under ORFS_WRITE_SYNTH_STUBS=1. A parent that targets |
| 57 | ++ # this rule (instead of <name>_generate_abstract) for its |
| 58 | ++ # synth-stage deps consumes these stubs and schedules |
| 59 | ++ # without waiting for our floorplan/place/cts. lefin |
| 60 | ++ # augments stub masters with full geometry when the real |
| 61 | ++ # macro LEF is read at the parent's floorplan stage |
| 62 | ++ # (load.tcl's ORFS_AUGMENT_STUB_MASTERS path). |
| 63 | ++ lef = synth_outputs.get("{}_1_synth.lef".format(ctx.attr.module_top)), |
| 64 | + lib = None, |
| 65 | +- lib_pre_layout = None, |
| 66 | ++ lib_pre_layout = synth_outputs.get("{}_1_synth.lib".format(ctx.attr.module_top)), |
| 67 | + additional_gds = depset( |
| 68 | + [dep[OrfsInfo].gds for dep in ctx.attr.deps if dep[OrfsInfo].gds], |
| 69 | + ), |
0 commit comments