2018-06-02 19:23:50 +08:00
|
|
|
nextpnr -- a portable FPGA place and route tool
|
|
|
|
===============================================
|
|
|
|
|
|
|
|
Supported Architectures
|
|
|
|
-----------------------
|
|
|
|
|
|
|
|
- iCE40
|
2018-07-11 17:15:29 +08:00
|
|
|
- ECP5
|
2018-06-02 19:23:50 +08:00
|
|
|
|
2018-06-02 19:57:08 +08:00
|
|
|
Prequisites
|
|
|
|
-----------
|
|
|
|
|
|
|
|
- CMake 3.3 or later
|
2018-06-12 23:36:19 +08:00
|
|
|
- Modern C++11 compiler (`clang-format` required for development)
|
2018-06-07 02:44:54 +08:00
|
|
|
- Qt5 or later (`qt5-default` for Ubuntu 16.04)
|
2018-06-02 19:57:08 +08:00
|
|
|
- Python 3.5 or later, including development libraries (`python3-dev` for Ubuntu)
|
2018-07-09 02:24:30 +08:00
|
|
|
- on Windows make sure to install same version as supported by [vcpkg](https://github.com/Microsoft/vcpkg/blob/master/ports/python3/CONTROL)
|
2018-06-07 02:44:54 +08:00
|
|
|
- Boost libraries (`libboost-dev` or `libboost-all-dev` for Ubuntu)
|
2018-06-02 19:57:08 +08:00
|
|
|
- Icestorm, with chipdbs installed in `/usr/local/share/icebox`
|
2018-06-08 17:24:32 +08:00
|
|
|
- Latest git Yosys is required to synthesise the demo design
|
2018-07-06 19:59:59 +08:00
|
|
|
- For building on Windows with MSVC, usage of vcpkg is advised for dependency installation.
|
|
|
|
- For 32 bit builds: `vcpkg install boost-filesystem boost-program-options boost-thread boost-python qt5-base`
|
|
|
|
- For 64 bit builds: `vcpkg install boost-filesystem:x64-windows boost-program-options:x64-windows boost-thread:x64-windows boost-python:x64-windows qt5-base:x64-windows`
|
2018-07-07 16:31:04 +08:00
|
|
|
- For building on macOS, brew utility is needed.
|
|
|
|
- Install all needed packages `brew install cmake python boost boost-python3 qt5`
|
|
|
|
- Do not forget to add qt5 in path as well `echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.bash_profile`
|
2018-07-11 17:15:29 +08:00
|
|
|
- For ECP5 support, you must download [Project Trellis](https://github.com/SymbiFlow/prjtrellis), then follow its instructions to
|
|
|
|
download the latest database and build _libtrellis_.
|
|
|
|
|
|
|
|
|
2018-06-02 19:23:50 +08:00
|
|
|
Building
|
|
|
|
--------
|
|
|
|
|
2018-07-11 16:23:23 +08:00
|
|
|
- Specifying target architecture is mandatory use ARCH parameter to set it. It is semicolon separated list.
|
|
|
|
- Use `cmake . -DARCH=all` to build all supported targets
|
|
|
|
- For example `cmake . -DARCH=ice40` would build just ICE40 support
|
2018-06-02 19:57:08 +08:00
|
|
|
- Use CMake to generate the Makefiles (only needs to be done when `CMakeLists.txt` changes)
|
2018-07-12 23:22:44 +08:00
|
|
|
- For an iCE40 debug build, run `cmake -DARCH=ice40 -DCMAKE_BUILD_TYPE=Debug .`
|
|
|
|
- For an iCE40 debug build with HX1K support only, run `cmake -DARCH=ice40 -DCMAKE_BUILD_TYPE=Debug -DICE40_HX1K_ONLY=1 .`
|
|
|
|
- For an iCE40 and ECP5 release build, run `cmake -DARCH="ice40;ecp5" .`
|
2018-06-13 19:14:51 +08:00
|
|
|
- Add `-DCMAKE_INSTALL_PREFIX=/your/install/prefix` to use a different install prefix to the default `/usr/local`
|
2018-07-12 23:22:44 +08:00
|
|
|
- For MSVC build with vcpkg use `-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake` using your vcpkg location
|
2018-07-06 19:59:59 +08:00
|
|
|
- For MSVC x64 build adding `-G"Visual Studio 14 2015 Win64"` is needed.
|
2018-07-11 17:15:29 +08:00
|
|
|
- For ECP5 support, you must also specify the path to Project Trellis using `-DTRELLIS_ROOT=/path/trellis`
|
2018-06-02 19:57:08 +08:00
|
|
|
- Use Make to run the build itself
|
2018-06-22 19:22:14 +08:00
|
|
|
- For all binary targets, just run `make`
|
|
|
|
- For just the iCE40 CLI&GUI binary, run `make nextpnr-ice40`
|
2018-07-12 23:22:44 +08:00
|
|
|
- To build binary without Python support, use `-DBUILD_PYTHON=OFF`
|
|
|
|
- To build binary without GUI, use `-DBUILD_GUI=OFF`
|
|
|
|
- For minimal binary without Python and GUI, use `-DBUILD_PYTHON=OFF -DBUILD_GUI=OFF`
|
2018-06-02 19:57:08 +08:00
|
|
|
- For just the iCE40 Python module, run `make nextpnrpy_ice40`
|
|
|
|
- Using too many parallel jobs may lead to out-of-memory issues due to the significant memory needed to build the chipdbs
|
2018-06-13 19:14:51 +08:00
|
|
|
- To install nextpnr, run `make install`
|
2018-06-02 19:57:08 +08:00
|
|
|
|
2018-06-25 01:43:21 +08:00
|
|
|
Testing
|
|
|
|
-------
|
|
|
|
|
2018-07-12 23:22:44 +08:00
|
|
|
- To build test binaries as well, use `-DBUILD_TESTS=OFF` and after run `make tests` to run them, or you can run separate binaries.
|
|
|
|
- To use code sanitizers use the `cmake` options:
|
|
|
|
- `-DSANITIZE_ADDRESS=ON`
|
|
|
|
- `-DSANITIZE_MEMORY=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++`
|
|
|
|
- `-DSANITIZE_THREAD=ON`
|
|
|
|
- `-DSANITIZE_UNDEFINED=ON`
|
2018-06-25 02:10:15 +08:00
|
|
|
- Running valgrind example `valgrind --leak-check=yes --tool=memcheck ./nextpnr-ice40 --json ice40/blinky.json`
|
|
|
|
|
2018-06-02 19:57:08 +08:00
|
|
|
Running
|
|
|
|
--------
|
|
|
|
|
2018-06-08 17:24:32 +08:00
|
|
|
- To run the CLI binary, just run `./nextpnr-ice40` (you should see command line help)
|
|
|
|
- To start the UI, run `./nextpnr-ice40 --gui`
|
|
|
|
- The Python module is called `nextpnrpy_ice40.so`. To test it, run `PYTHONPATH=. python3 python/python_mod_test.py`
|
2018-06-12 23:36:19 +08:00
|
|
|
- Run `yosys blinky.ys` in `ice40/` to synthesise the blinky design and
|
|
|
|
produce `blinky.json`.
|
2018-06-13 19:14:51 +08:00
|
|
|
- To place-and-route the blinky using nextpnr, run `./nextpnr-ice40 --hx1k --json ice40/blinky.json --pcf ice40/blinky.pcf --asc blinky.asc`
|
2018-06-08 17:24:32 +08:00
|
|
|
|
2018-07-11 17:15:29 +08:00
|
|
|
- For an ECP5 blinky, first synthesise using `yosys blinky.ys` in `ecp5/synth`.
|
|
|
|
- Then run ECP5 place-and route using
|
|
|
|
`./nextpnr-ecp5 --json ecp5/synth/blinky.json --basecfg ecp5/synth/ulx3s_empty.config --bit ecp5/synth/ulx3s.bit`
|
|
|
|
- Note that `ulx3s_empty.config` contains fixed/unknown bits to be copied to the output bitstream
|
|
|
|
- You can also use `--textcfg out.config` to write a text file describing the bitstream for debugging
|
|
|
|
|
2018-06-08 17:24:32 +08:00
|
|
|
Notes
|
|
|
|
-------
|
|
|
|
|
|
|
|
- All code is formatted using `clang-format` according to the style rules in `.clang-format` (LLVM based with
|
|
|
|
increased indent widths and brace wraps after classes).
|
|
|
|
- To automatically format all source code, run `make clangformat`.
|