From 0445c8f993f43877a3eb545e5022b748de8dc01d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Th=C3=B6rnblad?= Date: Fri, 22 Nov 2024 14:36:38 +0100 Subject: [PATCH] Add nextpnr flag '--exit-on-failed-target-frequency' --- contrib/Dockerfile | 20 ++++++++++++++++++-- hw/application_fpga/tools/run_pnr.sh | 1 + 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/contrib/Dockerfile b/contrib/Dockerfile index c0798f2..37ed248 100644 --- a/contrib/Dockerfile +++ b/contrib/Dockerfile @@ -100,8 +100,24 @@ WORKDIR /src # Add "Fix handling of RNG seed" #1369 RUN git cherry-pick --no-commit 6ca64526bb18ace8690872b09ca1251567c116de # Add early exit if place fails on timing -RUN sed -i 's/if (do_route) {/if (do_route \&\& !had_nonfatal_error) {/' common/kernel/command.cc -RUN sed -i 's/bool warn_on_failure = false/bool warn_on_failure = true/' common/kernel/timing.h +RUN sed -i \ + '345i \ \ \ \ general.add_options()("exit-on-failed-target-frequency",' \ + common/kernel/command.cc +RUN sed -i \ + '346i \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "exit if target frequency is not achieved (use together with "' \ + common/kernel/command.cc +RUN sed -i \ + '347i \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "--randomize-seed option)");' \ + common/kernel/command.cc +RUN sed -i \ + '348i \\' \ + common/kernel/command.cc +RUN sed -i \ + '662s/if (do_route) {/if (do_route \&\& (vm.count("exit-on-failed-target-frequency") ? !had_nonfatal_error : true)) {/' \ + common/kernel/command.cc +RUN sed -i \ + '244s/bool warn_on_failure = false/bool warn_on_failure = true/' \ + common/kernel/timing.h RUN cmake -DARCH=ice40 . \ && make -j$(nproc --ignore=2) \ && make install \ diff --git a/hw/application_fpga/tools/run_pnr.sh b/hw/application_fpga/tools/run_pnr.sh index 3c069d1..68f9e70 100755 --- a/hw/application_fpga/tools/run_pnr.sh +++ b/hw/application_fpga/tools/run_pnr.sh @@ -67,6 +67,7 @@ start_thread() { --log $LOG_FILE \ --randomize-seed \ --freq $FREQ \ + --exit-on-failed-target-frequency \ --ignore-loops \ --up5k \ --package $PACKAGE \