Skip to content

Commit 24acdb3

Browse files
committed
flow: log synthesized-netlist hash in synth.sh + clarify column label
flow/scripts/flow.sh:20 invokes flow/util/genElapsedTime.py after every OpenROAD-stage run, which appends a one-line "Log Elapsed/s Peak Memory/MB sha1sum result" summary to the stage's log. get_hash() already understands .odb/.rtlil/.v, so it would naturally hash a yosys-stage's result file — but flow/scripts/synth.sh (which runs yosys) didn't call genElapsedTime.py, so the 1_2_yosys.v and 1_1_yosys_canonicalize.rtlil hashes weren't logged. Mirror flow.sh's epilogue inside synth.sh. Informational; sandbox edge-cases (no matching log; result not declared as a bazel action output) must not fail the synth action — route stderr into the log rather than silently dropping it, so a real bug in the helper is still discoverable after the fact. Also rename the column header in genElapsedTime.py from "sha1sum .odb [0:20)" → "sha1sum result [0:20)" since the column has always shown whichever of .odb/.rtlil/.v existed — calling it ".odb" was misleading for the yosys rows the new synth.sh epilogue emits. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 4014255 commit 24acdb3

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

‎flow/scripts/synth.sh‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,15 @@ touch $2
55
$YOSYS_EXE -V > $(realpath $2)
66
$PYTHON_EXE "$SCRIPTS_DIR/run_command.py" --log "$(realpath $2)" --append --tee -- \
77
$YOSYS_EXE $YOSYS_FLAGS -c $1
8+
9+
# Log result hash, mirroring flow.sh's epilogue for OpenROAD stages.
10+
# genElapsedTime.py understands .odb/.rtlil/.v so it hashes the yosys
11+
# output (1_2_yosys.v, 1_1_yosys_canonicalize.rtlil) automatically.
12+
# Informational; sandbox edge-cases (no matching log, result not declared
13+
# as a bazel action output) must not fail the synth action — but route
14+
# stderr into the log rather than silently dropping it, so a real bug
15+
# in the helper is still discoverable after the fact.
16+
stage=$(basename "$2" .log)
17+
"$PYTHON_EXE" "$UTILS_DIR/genElapsedTime.py" --match "$stage" -d "$LOG_DIR" \
18+
2>>"$(realpath "$2")" \
19+
| tee -a "$(realpath "$2")" || true

‎flow/util/genElapsedTime.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def print_log_dir_times(logdir, args):
9999
if first and not args.noHeader:
100100
print(
101101
format_str
102-
% ("Log", "Elapsed/s", "Peak Memory/MB", "sha1sum .odb [0:20)")
102+
% ("Log", "Elapsed/s", "Peak Memory/MB", "sha1sum result [0:20)")
103103
)
104104
first = False
105105
print(

0 commit comments

Comments
 (0)