hps_platform: add timeout for nextpnr-nexus; print seed
The use of a wall-clock `timeout` here is sort of unfortunate - at the
moment, it takes a minute or so to run to completion on my machine. Give
it 90 in total so it doesn't flakily time out on oversubscribed
builders. The intent is to provide a better experience than today's,
where we wait 8+ hours for this to be killed.
Folks have also asked "am I using the right seed" in the war-room chat a
few times since a seed change has been landed. Add a print to make that
question easier to answer.
BUG=b:286226088
TEST=emerge-brya before & after this would time out
Change-Id: Iec7709e8998e687ca61627d9320d141e25872626
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/hps-firmware/+/4609053
Reviewed-by: Sami Kyöstilä <[email protected]>
Commit-Queue: George Burgess <[email protected]>
Tested-by: George Burgess <[email protected]>
diff --git a/soc/hps_platform.py b/soc/hps_platform.py
index 636a967..186919f 100644
--- a/soc/hps_platform.py
+++ b/soc/hps_platform.py
@@ -138,6 +138,11 @@
"{{",
"yosys -l {build_name}.rpt {build_name}.ys",
(
+ # Keep a timeout on this, since there's no obvious way to control
+ # timing internally. The code that invokes this template provides no
+ # way to pass `timeout=` as a param, so unfortunately, this is the best
+ # that can be done.
+ "timeout --foreground --kill-after=5s --signal=TERM 90m "
"nextpnr-nexus "
"--json {build_name}.json "
"--pdc {build_name}.pdc "
diff --git a/soc/hps_soc.py b/soc/hps_soc.py
index e9fd960..8816cba 100644
--- a/soc/hps_soc.py
+++ b/soc/hps_soc.py
@@ -396,6 +396,7 @@
"seed": args.nextpnr_seed,
}
+ print(f"Building with seed {args.nextpnr_seed}")
start_time = time.time()
vns = builder.build(**builder_kwargs, run=not args.no_build)
run_time = time.time() - start_time