Skip to content

Commit

Permalink
Add nextpnr flag '--exit-on-failed-target-frequency'
Browse files Browse the repository at this point in the history
* Add flag so we can keep nextpnr standard behavior and if
  this flag is used we can get a fast exit if timing fails
  on placement.

* Update run_pnr.sh script to use this flag
  • Loading branch information
jthornblad committed Nov 13, 2024
1 parent 330146b commit 399415d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
20 changes: 18 additions & 2 deletions contrib/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions hw/application_fpga/tools/run_pnr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ start_thread() {
--log $LOG_FILE \
--randomize-seed \
--freq $FREQ \
--exit-on-failed-target-frequency \
--ignore-loops \
--up5k \
--package $PACKAGE \
Expand Down

0 comments on commit 399415d

Please sign in to comment.