Skip to content

Commit

Permalink
Update README to represent most recent changes in build system
Browse files Browse the repository at this point in the history
  • Loading branch information
mmicko committed Jan 23, 2025
1 parent 0c06051 commit 0e9da64
Showing 1 changed file with 39 additions and 30 deletions.
69 changes: 39 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,17 @@ Getting started
For iCE40 support, install [Project IceStorm](https://github.com/YosysHQ/icestorm) to `/usr/local` or another location, which should be passed as `-DICESTORM_INSTALL_PREFIX=/usr` to CMake. Then build and install `nextpnr-ice40` using the following commands:

```
cmake . -DARCH=ice40
make -j$(nproc)
sudo make install
cmake . -B build -DARCH=ice40
make -C build nextpnr-all-bba
make -C build -j$(nproc)
sudo make -C build install
```

On Windows, you may specify paths explicitly:

```
cmake . -DARCH=ice40 -DICESTORM_INSTALL_PREFIX=C:/ProgramData/icestorm -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -G "Visual Studio 15 2017 Win64" -DPython3_EXECUTABLE=C:/Python364/python.exe -DPython3_LIBRARY=C:/vcpkg/packages/python3_x64-windows/lib/python36.lib -DPython3_INCLUDE_DIR=C:/vcpkg/packages/python3_x64-windows/include/python3.6 .
cmake --build . --config Release
cmake . -B build -DARCH=ice40 -DICESTORM_INSTALL_PREFIX=C:/ProgramData/icestorm -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -G "Visual Studio 15 2017 Win64" -DPython3_EXECUTABLE=C:/Python364/python.exe -DPython3_LIBRARY=C:/vcpkg/packages/python3_x64-windows/lib/python36.lib -DPython3_INCLUDE_DIR=C:/vcpkg/packages/python3_x64-windows/include/python3.6
cmake --build build --config Release
```

To build a static release, change the target triplet from `x64-windows` to `x64-windows-static` and add `-DBUILD_STATIC=ON`.
Expand Down Expand Up @@ -98,9 +99,10 @@ such as pack, place, route, and write output files.)
For ECP5 support, install [Project Trellis](https://github.com/YosysHQ/prjtrellis) to `/usr/local` or another location, which should be passed as `-DTRELLIS_INSTALL_PREFIX=/usr/local` to CMake. Then build and install `nextpnr-ecp5` using the following commands:

```
cmake . -DARCH=ecp5 -DTRELLIS_INSTALL_PREFIX=/usr/local
make -j$(nproc)
sudo make install
cmake . -B build -DARCH=ecp5 -DTRELLIS_INSTALL_PREFIX=/usr/local
make -C build nextpnr-all-bba
make -C build -j$(nproc)
sudo make -C build install
```

- Examples of the ECP5 flow for a range of boards can be found in the [Project Trellis Examples](https://github.com/YosysHQ/prjtrellis/tree/master/examples).
Expand All @@ -110,9 +112,10 @@ sudo make install
For Nexus support, install [Project Oxide](https://github.com/gatecat/prjoxide) to `$HOME/.cargo` or another location, which should be passed as `-DOXIDE_INSTALL_PREFIX=$HOME/.cargo` to CMake. Then build and install `nextpnr-nexus` using the following commands:

```
cmake . -DARCH=nexus -DOXIDE_INSTALL_PREFIX=$HOME/.cargo
make -j$(nproc)
sudo make install
cmake . -B build -DARCH=nexus -DOXIDE_INSTALL_PREFIX=$HOME/.cargo
make -C build nextpnr-all-bba
make -C build -j$(nproc)
sudo make -C build install
```

- Examples of the Nexus flow for a range of boards can be found in the [Project Oxide Examples](https://github.com/gatecat/prjoxide/tree/master/examples).
Expand All @@ -124,9 +127,9 @@ Nexus support is currently experimental, and has only been tested with engineeri
The generic target allows running placement and routing for arbitrary custom architectures.

```
cmake . -DARCH=generic
make -j$(nproc)
sudo make install
cmake . -B build -DARCH=generic
make -C build -j$(nproc)
sudo make -C build install
```

An example of how to use the generic flow is in [generic/examples](generic/examples). See also the [Generic Architecture docs](docs/generic.md).
Expand All @@ -140,9 +143,10 @@ The himbaechel target allows running placement and routing for larger architectu
For Gowin support, install [Project Apicula](https://github.com/YosysHQ/apicula)

```
cmake . -DARCH="himbaechel" -DHIMBAECHEL_UARCH="gowin"
make -j$(nproc)
sudo make install
cmake . -B build -DARCH="himbaechel" -DHIMBAECHEL_UARCH="gowin"
make -C build nextpnr-all-bba
make -C build -j$(nproc)
sudo make -C build install
```

- Examples of the Gowin flow for a range of boards can be found in the [Project Apicula Examples](https://github.com/YosysHQ/apicula/tree/master/examples).
Expand All @@ -152,9 +156,10 @@ sudo make install
For NanoXplore NG-Ultra support, clone [Project Beyond DB](https://github.com/yosyshq-GmbH/prjbeyond-db) repo

```
cmake . -DARCH="himbaechel" -DHIMBAECHEL_UARCH="ng-ultra" -DHIMBAECHEL_PRJBEYOND_DB=/path/to/prjbeyond-db -DHIMBAECHEL_NGULTRA_DEVICES=ng-ultra
make -j$(nproc)
sudo make install
cmake . -B build -DARCH="himbaechel" -DHIMBAECHEL_UARCH="ng-ultra" -DHIMBAECHEL_PRJBEYOND_DB=/path/to/prjbeyond-db -DHIMBAECHEL_NGULTRA_DEVICES=ng-ultra
make -C build nextpnr-all-bba
make -C build -j$(nproc)
sudo make -C build install
```

*Please note that binary bitstream creation requires Impulse tool from NanoXplore.*
Expand All @@ -174,9 +179,10 @@ The nextpnr GUI is not built by default, to reduce the number of dependencies fo
To build nextpnr for multiple architectures at once, a semicolon-separated list can be used with `-DARCH`.

```
cmake . -DARCH="ice40;ecp5"
make -j$(nproc)
sudo make install
cmake . -B build -DARCH="ice40;ecp5"
make -C build nextpnr-all-bba
make -C build -j$(nproc)
sudo make -C build install
```

To build every available stable architecture, use `-DARCH=all`. To include experimental arches (currently nexus), use `-DARCH=all+alpha`.
Expand All @@ -186,9 +192,10 @@ To build every available stable architecture, use `-DARCH=all`. To include exper
To build a single nextpnr-himbachel executable for each of the supported microarchitectures, use `-DHIMBAECHEL_SPLIT`.

```
cmake . -DARCH="himbaechel" -DHIMBAECHEL_UARCH="gowin;ng-ultra"
make -j$(nproc)
sudo make install
cmake . -B build -DARCH="himbaechel" -DHIMBAECHEL_UARCH="gowin;ng-ultra"
make -C build nextpnr-all-bba
make -C build -j$(nproc)
sudo make -C build install
```

In such a build, instead of a single `nextpnr-himbaechel` binary, two binaries `nextpnr-himbaechel-gowin` and `nextpnr-himbaechel-ng-ultra` are built. Although they are installed together, each microarchitecture is completely independent of the other, and only needs its corresponding `.../share/himbaechel/<microarchitecture>/` chip database directory to run. Split build reduces the size of individual distributed artifacts (although the total size increases), and allows co-installation of artifacts of different versions.
Expand All @@ -212,15 +219,17 @@ Additional notes for building nextpnr
The following runs a debug build of the iCE40 architecture without GUI, without Python support, without the HeAP analytic placer and only HX1K support:

```
cmake . -DARCH=ice40 -DCMAKE_BUILD_TYPE=Debug -DBUILD_PYTHON=OFF -DICE40_HX1K_ONLY=1
make -j$(nproc)
cmake . -B build -DARCH=ice40 -DCMAKE_BUILD_TYPE=Debug -DBUILD_PYTHON=OFF -DICE40_HX1K_ONLY=1
make -C build nextpnr-all-bba
make -C build -j$(nproc)
```

To make static build release for iCE40 architecture use the following:

```
cmake . -DARCH=ice40 -DBUILD_PYTHON=OFF -DSTATIC_BUILD=ON
make -j$(nproc)
cmake . -B build -DARCH=ice40 -DBUILD_PYTHON=OFF -DSTATIC_BUILD=ON
make -C build nextpnr-all-bba
make -C build -j$(nproc)
```

The HeAP placer's solver can optionally use OpenMP for a speedup on very large designs. Enable this by passing `-DUSE_OPENMP=yes` to cmake (compiler support may vary).
Expand Down

0 comments on commit 0e9da64

Please sign in to comment.