Giter Club home page Giter Club logo

ice40-env's Introduction

open-source ice40 FPGA development environment

This repository amis to provide a full development environment for developing for the ice40 series of Lattice FPGAs.

Prerequisites

This section assumes you are using a Linux environment, e.g. Arch Linux. On any platform you'll need to install the following software:

  • Build system: ninja
  • Synthesis: yosys
  • Place'n'route: nextnpr
  • Bitstream creation: icestorm
  • programming (only for TinyFPGA-BX and compatible): tinyprog (FTDI-based boards can simply use the iceprog program, which is part of the tools above)

Below there are the steps for Arch Linux as of 2021-10-24.

# install tools available in the package repositories
sudo pacman -S yosys tinyprog ninja
# install icestorm for AUR
git clone https://aur.archlinux.org/icestorm-git.git
cd icestorm-git
makepkg -sri
cd ..
# install nextpnr from AUR
git clone https://aur.archlinux.org/nextpnr-ice40-nightly.git
cd nextpnr-ice40-nightly
# patch package build script (we have the non-nightly versions installed)
sed -i "s/yosys-nightly/yosys/" PKGBUILD
sed -i "s/icestorm-nightly/icestorm/" PKGBUILD
makepkg -sri
cd ..

Also, make sure, that your user has the permission to access the serial port, if your programmer uses the serial port. Depending on your Linux distribution you have to add yourself to either the dialout or uucp group.

Project layout

The project is rather simple: there is a build.ninja-file, which is the description for the ninja build system. This file also contains the basic project properties, like

  • the project name
  • information about the FPGA/board used
  • the Verilog input files

Therefore you'll have to edit this file at the start of the project and if you add/remove a Verilog file.

Furthermore there is the top-level module file top.v, which also contains a small example, which blinks an LED.

The constraints.pcf file assigns the names to the I/O ports used.

Note, that the PLL settings is auto-generated during the build process.

Building

To build the FPGA bitstream, simply execute

ninja
# or if you want to upload the code directly
ninja && tinyprog -p build/template.bin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.