Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nextpnr flag '--exit-on-failed-target-frequency' #294

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 32 additions & 16 deletions contrib/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,26 +72,26 @@ RUN git clone --depth=1 https://github.com/YosysHQ/icestorm /src
WORKDIR /src
RUN git checkout 738af822905fdcf0466e9dd784b9ae4b0b34987f \
&& make -j$(nproc --ignore=2) \
&& make install
RUN git describe --all --always --long --dirty > /usr/local/repo-commit-icestorm
&& make install \
&& git describe --all --always --long --dirty > /usr/local/repo-commit-icestorm
dehanj marked this conversation as resolved.
Show resolved Hide resolved
WORKDIR /
RUN rm -rf /src

# Custom iceprog for the RPi 2040-based programmer (will be upstreamed).
RUN git clone -b interfaces --depth=1 https://github.com/tillitis/icestorm /src
WORKDIR /src/iceprog
RUN make -j$(nproc --ignore=2) \
&& make PROGRAM_PREFIX=tillitis- install
RUN git describe --all --always --long --dirty > /usr/local/repo-commit-tillitis--icestorm
&& make PROGRAM_PREFIX=tillitis- install \
&& git describe --all --always --long --dirty > /usr/local/repo-commit-tillitis--icestorm
WORKDIR /
RUN rm -rf /src

RUN git clone -b 0.45 --depth=1 https://github.com/YosysHQ/yosys /src
WORKDIR /src
RUN git submodule update --init \
&& make -j$(nproc --ignore=2) \
&& make install
RUN git describe --all --always --long --dirty > /usr/local/repo-commit-yosys
&& make install \
&& git describe --all --always --long --dirty > /usr/local/repo-commit-yosys
WORKDIR /
RUN rm -rf /src

Expand All @@ -100,12 +100,28 @@ 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
RUN git describe --all --always --long --dirty > /usr/local/repo-commit-nextpnr
&& make install \
&& git describe --all --always --long --dirty > /usr/local/repo-commit-nextpnr
WORKDIR /
RUN rm -rf /src

Expand All @@ -114,8 +130,8 @@ WORKDIR /src
RUN sh autoconf.sh \
&& ./configure \
&& make -j$(nproc --ignore=2) \
&& make install
RUN git describe --all --always --long --dirty > /usr/local/repo-commit-iverilog
&& make install \
&& git describe --all --always --long --dirty > /usr/local/repo-commit-iverilog
WORKDIR /
RUN rm -rf /src

Expand All @@ -125,8 +141,8 @@ RUN autoconf \
&& ./configure \
&& make -j$(nproc --ignore=2) \
&& make test \
&& make install
RUN git describe --all --always --long --dirty > /usr/local/repo-commit-verilator
&& make install \
&& git describe --all --always --long --dirty > /usr/local/repo-commit-verilator
WORKDIR /
RUN rm -rf /src

Expand All @@ -140,8 +156,8 @@ RUN rm -rf /src

RUN git clone -b v1.9.1 https://github.com/cocotb/cocotb.git /src
WORKDIR /src
RUN pip install . --break-system-packages
RUN git describe --all --always --long --dirty > /usr/local/repo-commit-cocotb
RUN pip install . --break-system-packages \
&& git describe --all --always --long --dirty > /usr/local/repo-commit-cocotb
WORKDIR /
RUN rm -rf /src

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