Skip to content

Commit f29247e

Browse files
committed
lint: black + tclfmt fixes from CI
Two formatter-only fixes the GitHub Actions Lint workflows flagged on PR #4231 ("lint" Python/black and "Tclint" Tcl/tclfmt jobs): flow/util/genMetrics.py Two `for metric in (...)` tuples were wrapped across two lines; black 26.5 folds them onto a single line. No semantic change. flow/scripts/synth_preamble.tcl tclfmt 0.7.0 re-indents the `if { [catch { ... } _err] } { ... }` block onto a multi-line `if {` form with 4-space body indentation; the original used a 2-space body inside `[catch { ... }]`. No semantic change. Both files come from earlier commits on this branch: 3e57288 flow: drill down — non-determinism enters in read_design_sources (introduced the genMetrics.py loops and the synth_preamble.tcl catch block) Re-running the formatters locally produces no further diffs: black --check flow/util/genMetrics.py -> 1 unchanged tclfmt --check flow/scripts/synth_preamble.tcl -> clean tclint flow/scripts/synth_preamble.tcl -> clean Signed-off-by: Øyvind Harboe <oyvind@ascenium.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 03ed40d commit f29247e

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

flow/scripts/synth_preamble.tcl

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,22 @@ proc write_state_hash { metric } {
3636
# the earlier "front-end non-determinism" misdiagnosis. See
3737
# flow/README.md "Triaging a failing `_test`" → "Yosys-environment
3838
# false positive".
39-
if { [catch {
40-
# `flow/scripts/variables.mk` exports YOSYS_EXE — yosys-abc is its
41-
# sibling. `info nameofexecutable` returns "./yosys-abc" under
42-
# yosys' embedded tcl, which doesn't resolve at runtime; the
43-
# exported absolute path is the reliable handle.
44-
set _abc_path [file join [file dirname $::env(YOSYS_EXE)] yosys-abc]
45-
set _abc_raw [exec $_abc_path -c "version; quit" 2>@1]
46-
foreach _line [split $_abc_raw "\n"] {
47-
if { [regexp {^UC Berkeley,\s+ABC\s+(\S+)} $_line -> _abc_ver] } {
48-
puts "synth__abc__version: $_abc_ver"
49-
break
39+
if {
40+
[catch {
41+
# `flow/scripts/variables.mk` exports YOSYS_EXE — yosys-abc is its
42+
# sibling. `info nameofexecutable` returns "./yosys-abc" under
43+
# yosys' embedded tcl, which doesn't resolve at runtime; the
44+
# exported absolute path is the reliable handle.
45+
set _abc_path [file join [file dirname $::env(YOSYS_EXE)] yosys-abc]
46+
set _abc_raw [exec $_abc_path -c "version; quit" 2>@1]
47+
foreach _line [split $_abc_raw "\n"] {
48+
if { [regexp {^UC Berkeley,\s+ABC\s+(\S+)} $_line -> _abc_ver] } {
49+
puts "synth__abc__version: $_abc_ver"
50+
break
51+
}
5052
}
51-
}
52-
} _err] } {
53+
} _err]
54+
} {
5355
puts "\[WARN\] synth__abc__version extraction failed: $_err"
5456
}
5557

flow/util/genMetrics.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,7 @@ def extract_metrics(
285285
# (1_1_yosys_canonicalize.log or 1_2_yosys.log). `canonical`
286286
# and post-ABC come straight from `file_sha1` of the
287287
# already-emitted RTLIL / Verilog.
288-
for metric in ("synth__post_read_sources__hash",
289-
"synth__post_hierarchy__hash"):
288+
for metric in ("synth__post_read_sources__hash", "synth__post_hierarchy__hash"):
290289
extractTagFromFile(
291290
metric,
292291
metrics_dict,
@@ -298,8 +297,7 @@ def extract_metrics(
298297
metrics_dict["synth__canonical_netlist__hash"] = file_sha1(
299298
resultPath + "/1_1_yosys_canonicalize.rtlil"
300299
)
301-
for metric in ("synth__post_synth_main__hash",
302-
"synth__preabc_netlist__hash"):
300+
for metric in ("synth__post_synth_main__hash", "synth__preabc_netlist__hash"):
303301
extractTagFromFile(
304302
metric,
305303
metrics_dict,

0 commit comments

Comments
 (0)