nextpnr/machxo2
Catherine 574f504787 Find all components of Python at the same time.
This is explicitly recommended by the FindPython module documentation
and is required to avoid failed builds on some systems. See:
https://cmake.org/cmake/help/latest/module/FindPython.html
2025-01-13 03:29:43 +00:00
..
examples Update examples to synth_lattice 2023-08-30 16:27:17 +02:00
.gitignore machxo2: Update with Arch API changes 2021-02-12 10:36:59 +00:00
arch_place.cc use timing data 2023-10-02 14:49:17 +02:00
arch_pybindings.cc add write_bitstream to pybindings 2023-05-04 14:23:08 +02:00
arch_pybindings.h Fixing old emails and names in copyrights 2021-06-12 13:22:38 +01:00
arch.cc machxo2: less pessimistic delay prediction 2023-11-09 06:48:50 +01:00
arch.h clangformat 2023-10-28 17:10:42 +02:00
archdefs.h clangformat 2024-09-30 14:51:33 +02:00
baseconfigs.cc clangformat 2023-05-04 14:23:08 +02:00
bitstream.cc clangformat 2024-09-30 14:51:33 +02:00
bitstream.h Fixing old emails and names in copyrights 2021-06-12 13:22:38 +01:00
cells.cc ramw and dram changes according to @gatecat 2023-05-04 14:23:08 +02:00
cells.h clangformat 2023-05-04 14:23:08 +02:00
CMakeLists.txt Find all components of Python at the same time. 2025-01-13 03:29:43 +00:00
config.cc add new field handling in chip config format 2023-03-16 13:37:23 +01:00
config.h add new field handling in chip config format 2023-03-16 13:37:23 +01:00
constids.inc Load timing data 2023-10-02 14:49:17 +02:00
facade_import.py properly assign latest fuzzed data 2023-10-02 14:49:17 +02:00
family.cmake Support enabling XO3 and XO3D 2023-05-04 14:23:08 +02:00
gfx.cc Use TRELLIS primitives 2023-03-20 09:53:35 +01:00
gfx.h Add simple BEL graphics 2023-03-16 13:37:23 +01:00
globals.cc clangformat 2024-09-30 14:51:33 +02:00
lpf.cc Added LPF support 2023-05-04 14:23:08 +02:00
machxo2_available.h.in Fix out of tree builds and place h in generated 2023-03-16 13:37:23 +01:00
main.cc clangformat 2024-09-30 14:51:33 +02:00
pack.cc clangformat 2024-09-30 14:51:33 +02:00
README.md cmake: Make HeAP placer always-enabled 2023-03-17 10:38:11 +01:00

nextpnr-machxo2

Experimental FOSS Place And Route backend for the Lattice MachXO2 family of FPGAs. Fuzzing takes place as a subproject of prjtrellis.

Known to work:

  • Basic routing from pads to SLICEs and back!
  • Basic packing of one type of FF and LUT into half of a SLICE!
  • Using the internal oscillator OSCH as a clock
  • LOGIC SLICE mode

Things that probably work but are untested:

  • Any non-3.3V I/O standard that doesn't use bank VREFs.

Things remaining to do include (but not limited to):

  • More intelligent and efficient packing
  • Global Routing (exists in database/sim models, nextpnr-machxo2 doesn't use it yet)
  • Secondary High Fanout Nets
  • Edge Clocks (clock pads work, but not routed to global routing yet)
  • PLLs
  • Synchronous Release Global Set/Reset Interface (SGSR)
  • Embedded Function Block (EFB)
  • All DDR-related functionality
  • Bank VREFs
  • Embedded Block RAM (EBR)
  • CCU2 and DPRAM SLICE modes

Quick Start

The following commands are known to work on a near-fresh Linux Mint system (thank you securelyfitz!):

Prerequisites

sudo apt install cmake clang-format libboost-all-dev build-essential
qt5-default libeigen3-dev build-essential clang bison flex libreadline-dev
gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3
libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev
python3-setuptools python3-serial

Installation

Use an empty directory to hold all the cloned repositories. Upstream repos can be used as well (e.g. YosysHQ/prjtrellis, etc.).

git clone git@github.com:cr1901/prjtrellis.git
cd prjtrellis
git checkout facade
git submodule update --init --recursive
cd libtrellis
cmake -DCMAKE_INSTALL_PREFIX=/usr
make -j 8
sudo make install

cd ../../

git clone git@github.com:cr1901/yosys.git
cd yosys/
git checkout machxo2
make config-gcc
make
sudo make install

cd ../

git clone git@github.com:tinyfpga/TinyFPGA-A-Programmer.git
cd TinyFPGA-A-Programmer/
sudo python setup.py install

cd ../

git clone git@github.com:cr1901/nextpnr.git
cd nextpnr
git checkout machxo2
git submodule update --init --recursive
cmake . -DARCH=machxo2 -DBUILD_GUI=OFF  -DTRELLIS_INSTALL_PREFIX=/usr -DBUILD_PYTHON=OFF 
make

Although uncommon, the facade and machxo2 branches of the above repos are occassionally rebased; use git pull -f if necessary.

Demo

If you have a TinyFPGA Ax2 board with the TinyFPGA Programmer, the following script will build a blinky bitstream and load it onto the MachXO2; the gateware will flash the LED!

cd machxo2/examples/
sh demo.sh tinyfpga

The tinyfpga.v code used in demo.sh is slightly modified from the user's guide to accommodate (* LOC = "pin" *) constraints and the built-in user LED.