All Projects → YosysHQ → Prjtrellis

YosysHQ / Prjtrellis

Licence: other
Documenting the Lattice ECP5 bit-stream format.

Labels

Projects that are alternatives of or similar to Prjtrellis

1bitSDR
Minimal SDR with Lattice MachXO2 FPGA. And a port to Cyclone3 by Steven Groom
Stars: ✭ 53 (-80.51%)
Mutual labels:  verilog
super-miyamoto-sprint
Homebrew game for homebrew FPGA game console
Stars: ✭ 48 (-82.35%)
Mutual labels:  verilog
sv-tests
Test suite designed to check compliance with the SystemVerilog standard.
Stars: ✭ 148 (-45.59%)
Mutual labels:  verilog
FPGA-USB-Device
FPGA-based USB-device controller to implement USB-CDC, USB-HID, etc.
Stars: ✭ 29 (-89.34%)
Mutual labels:  verilog
VGChips
Video Game custom chips reverse-engineered from silicon
Stars: ✭ 86 (-68.38%)
Mutual labels:  verilog
intfftk
Fully pipelined Integer Scaled / Unscaled Radix-2 Forward/Inverse Fast Fourier Transform (FFT) IP-core for newest Xilinx FPGAs (Source language - VHDL / Verilog). GNU GPL 3.0.
Stars: ✭ 43 (-84.19%)
Mutual labels:  verilog
zx-sizif-512
ZX Spectrum CPLD-based clone for rubber case
Stars: ✭ 92 (-66.18%)
Mutual labels:  verilog
Edalize
An abstraction library for interfacing EDA tools
Stars: ✭ 270 (-0.74%)
Mutual labels:  verilog
docker
Scripts to build and use docker images including GHDL
Stars: ✭ 27 (-90.07%)
Mutual labels:  verilog
blarney
Haskell library for hardware description
Stars: ✭ 81 (-70.22%)
Mutual labels:  verilog
verilogAST-cpp
C++17 implementation of an AST for Verilog code generation
Stars: ✭ 14 (-94.85%)
Mutual labels:  verilog
dpll
A collection of phase locked loop (PLL) related projects
Stars: ✭ 55 (-79.78%)
Mutual labels:  verilog
ofdm
Chisel Things for OFDM
Stars: ✭ 23 (-91.54%)
Mutual labels:  verilog
Deep-DarkFantasy
Global Dark Mode for ALL apps on ANY platforms.
Stars: ✭ 16 (-94.12%)
Mutual labels:  verilog
Fake-SDcard
Imitate SDcard using FPGAs.
Stars: ✭ 26 (-90.44%)
Mutual labels:  verilog
hwt
VHDL/Verilog/SystemC code generator, simulator API written in python/c++
Stars: ✭ 145 (-46.69%)
Mutual labels:  verilog
Speech256
An FPGA implementation of a classic 80ies speech synthesizer. Done for the Retro Challenge 2017/10.
Stars: ✭ 51 (-81.25%)
Mutual labels:  verilog
Cores
Various HDL (Verilog) IP Cores
Stars: ✭ 271 (-0.37%)
Mutual labels:  verilog
Verilog Pcie
Verilog PCI express components
Stars: ✭ 252 (-7.35%)
Mutual labels:  verilog
32-Verilog-Mini-Projects
Implementing 32 Verilog Mini Projects. 32 bit adder, Array Multiplier, Barrel Shifter, Binary Divider 16 by 8, Booth Multiplication, CRC Coding, Carry Select and Carry Look Ahead Adder, Carry Skip and Carry Save Adder, Complex Multiplier, Dice Game, FIFO, Fixed Point Adder and Subtractor, Fixed Point Multiplier and Divider, Floating Point IEEE 7…
Stars: ✭ 66 (-75.74%)
Mutual labels:  verilog

Project Trellis

For FPGA Toolchain Users

Project Trellis enables a fully open-source flow for ECP5 FPGAs using Yosys for Verilog synthesis and nextpnr for place and route. Project Trellis itself provides the device database and tools for bitstream creation.

Getting Started

Install the dependencies for Project Trellis:

  • Python 3.5 or later, including development libraries (python3-dev on Ubuntu)
  • A modern C++14 compiler (Clang is recommended)
  • CMake 3.5 or later
  • Boost
  • Git
  • Recent OpenOCD for device programming (--enable-ftdi required if building from source)

Clone the Project Trellis repository and download the latest database:

 git clone --recursive https://github.com/YosysHQ/prjtrellis

Install libtrellis and associated tools. You must run cmake from the libtrellis directory. Out-of-tree builds are currently unsupported when coupled with nextpnr:

cd libtrellis
cmake -DCMAKE_INSTALL_PREFIX=/usr .
make
sudo make install

Clone and install latest git master versions (Yosys 0.8 is not sufficient for ECP5 development) of Yosys and nextpnr according to their own instructions. Ensure to include the ECP5 architecture when building nextpnr; and point it towards your prjtrellis folder. (for example: cmake -DARCH=ecp5 -DTRELLIS_INSTALL_PREFIX=/usr .)

You should now be able to build the examples.

Current Status

The following features are currently working in the Yosys/nextpnr/Trellis flow.

  • Logic slice functionality, including carries
  • Distributed RAM inside logic slices
  • All internal interconnect
  • Basic IO, including tristate, using TRELLIS_IO primitives; LPF files and DDR inputs/outputs
  • Block RAM, using either inference in Yosys or manual instantiation of the DP16KD primitive
  • Multipliers using manual instantiation of the MULT18X18D primitive. Inference and more advanced DSP features are not yet supported.
  • Global networks (automatically promoted and routed in nextpnr)
  • PLLs
  • Transcievers (DCUs)

Development Boards

Project Trellis supports all ECP5 devices and should work with any development board. The following boards have been tested and confirmed working:

For Developers

Project Trellis documents the Lattice ECP5 bit-stream format and internal architecture. Current documentation is located in machine-readable format in prjtrellis-db and is also published online as HTML.

This repository contains both tools and scripts which allow you to document the bit-stream format of Lattice ECP5 series FPGAs.

More documentation can be found published on prjtrellis ReadTheDocs site - this includes;

This follows the lead of Project X-Ray - which is documenting the bitstream format for the Xilinx Series 7 devices.

Quickstart Guide

Currently Project Trellis is tested on Arch Linux, Ubuntu 17.10 and Ubuntu 16.04.

Install the dependencies:

  • Lattice Diamond 3.10 (only required if you want to run fuzzers, not required as an end user or to explore the database)
  • Python 3.5 or later, including development libraries (python3-dev on Ubuntu)
  • A modern C++14 compiler (Clang is recommended)
  • CMake 3.5 or later
  • Boost

For a generic environment:

source environment.sh

Optionally, modify user_environment.sh and rerun the above command if needed.

Build libtrellis:

cd libtrellis
cmake .
make

(Re-)creating parts of the database, for example LUT interconnect:

cd fuzzers/ECP5/001-plc2_routing
TRELLIS_JOBS=`nproc` python3 fuzzer.py

Process

The documentation is done through a "black box" process were Diamond is asked to generate a large number of designs which then used to create bitstreams. The resulting bit streams are then cross correlated to discover what different bits do.

This follows the same process as Project X-Ray - more documentation can be found here.

Parts

Minitests

There are also "minitests" which are small tests of features used to build fuzers.

Fuzzers

Fuzzers are the scripts which generate the large number of bitstream.

They are called "fuzzers" because they follow an approach similar to the idea of software testing through fuzzing.

Tools

Miscellaneous tools for exploring the database and experimenting with bitstreams.

Util

Python libraries used for fuzzers and other purposes

libtrellis

libtrellis is a library for manipulating ECP5 bitstreams, tiles and the Project Trellis databases. It is written with C++, with Python bindings exposed using pybind11 so that fuzzers and utilities can be written in Python.

Database

Instead of downloading the compiled part database, it can also be created from scratch. However, this procedure takes several hours, even on a decent workstation. First, the empty reference bitstreams and the tile layout must be created based on the initial knowledge provided in the metadata directory. Then, running all fuzzers in order will produce a database which documents the bitstream format in the database directory.

UMG and UM5G devices may be stripped from devices.json to ceate the database only for non-SERDES chip variants. Obviously, SERDES related fuzzers are not able to run in this case.

source environment.sh
./create-empty-db.sh
cd fuzzers/ECP5/001-plc2_routing
TRELLIS_JOBS=`nproc` python3 fuzzer.py
... (run more fuzzers)

Credits

Thanks to @tinyfpga for the original inspiration, and @mithro for the name and initial support.

Thanks to @q3k, @emard and @tinyfpga for their donations of ECP5 hardware that have made real-world testing and demos possible.

Contributing

There are a couple of guidelines when contributing to Project Trellis which are listed here.

Sending

All contributions should be sent as GitHub Pull requests.

License

All code in the Project Trellis repository is licensed under the very permissive ISC Licence. A copy can be found in the COPYING file.

All new contributions must also be released under this license.

Code of Conduct

By contributing you agree to the code of conduct. We follow the open source best practice of using the Contributor Covenant for our Code of Conduct.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].