FPGA Development with the Lattice iCE40 HX1K (Nandland Go Board)




PROJECTS (from Nandland.com)

There are 10 projects from Russell Merrick's website (Russell is the designer and creator of the Nandland Go board) that run through the fundamental concepts of FPGA programming. His website and tutorials are highly recommended!

The following are my own notes and interpretation of his tutorials. For many of the easier designs, they follow his tutorials fairly closely, but for some of the more complex desings (specifically the VGA implementation) I have come up with my own interpretations and designs.

The following are my notes and source code for each project.




dev board image

The FPGA:

This board uses the Lattice iCE40 HX1K (the 1K in its name refers to 1280 Logic Cells, each Cell contains a 4-input LUT and d-flip-flop):
dev board image
This package variation has 25 pins per side (100 total)

Lattice Semiconductor:

dev board image






Demo Program

This dev board comes with a demo program to test out the peripherals. This program can be downloaded from Nandland.com (a bitmap FPGA image in the form of a .bin file):

Go_Board_Full_Test_bitmap.bin

The Demo program does the following:
  1. The board is powered by connecting it to a host computer (micro-USB to the board, and USB-A on the host side). The green power light on the board should light up.
  2. Each of the push buttons individually lights up a different LED.
  3. Push button 1 will start a demo of the two 7-segment displays, lighting up the various segments.
  4. Launching a terminal emulator like Tera Term will establish a UART connection to the board, and the demo program will accept keyboard input from the host, send it to the FPGA, and return each character to the host to be displayed in the terminal emulator.
  5. The VGA connector can be connected to a VGA monitor, and test patterns can be displayed using the keyboard numeric keys.

Setting up the Programmer Tool

In order to get the .bin program onto the Go Board, a subset of the toolchain needs to be installed. The Diamond Programmer needs to be installed in order to program the FPGA from the .bin file. Tera Term is needed to interact with the demo program:

dev board image
Technically, to load the demo .bin program, only the Diamond Programmer is needed:

Running the Demo

  1. Pressing each of the 4 push buttons will light up a different LED.
  2. Pressing push button 1 will also launch the two 7-segment displays demo
  3. Launch Tera Term on the host computer and configure the serial port
  4. dev board image
    dev board image
  5. Typing on the host computer's keyboard will send the characters to the FPGA demo program, and it will send it back to the host to be displayed on the terminal emulator's screen.
  6. Connect a VGA monitor to the Go Board and press keys 1-5 to see different test patterns on the screen
  7. dev board image






Setting up the Full Toolchain

The full toolchain for the Lattice iCE40 HX1K involves the following tools:
  1. design entry
  2. simulation
  3. synthesis
  4. place & route
  5. bitstream generation
  6. programming
Lattice FPGAs are in the unique position to have both proprietary tools (from Lattice itself) to open-source tools available (linux based). For the tools made by Lattice and other Proprietary (license required) companies:
  1. design entry [Lattice iCEcube2]
  2. simulation [Siemens ModelSim]
  3. synthesis [Lattice iCEcube2]
  4. place & route [Lattice iCEcube2]
  5. bitstream generation [Lattice iCEcube2]
  6. programming [Lattice Diamond Programmer]
Here's a summary of the toolsuite and where it will be installed on a Windows system (along with file sizes)
dev board image


The Lattice iCEcube2 IDE requires a license, which (at the time of this writing) is freely available for "hobbyists", though it still expires and is quite a pain to renew. If you start iCEcube2 and receive the following popup, it's time to renew:
dev board image
The steps to get this renewed are the following:
  1. Find the MAC address for your network interface by opening a command line and running "ipconfig /all"
  2. dev board image

  3. Look on the Lattice website for instructions on how to obtain a free license
  4. dev board image

  5. Write the following email
  6. dev board image

  7. Eventually you'll receive the following email:
  8. dev board image

  9. Follow the link to the Subscription Licensing Form
  10. dev board image

  11. They'll send you the .dat file in another email, along with instructions on where to "install" the license (i.e. where to put the .dat file on your system)
  12. dev board image

  13. Opening iCEcube2 should now be successful
  14. dev board image

  15. Since this license (.dat file) is stored locally on your machine (C:\licenses\FlexLM), and it's tied to your particular machine's MAC address, you'll have to download/install a different license for each machine you plan to develop on.






VHDL Overview

VHDL (VHSIC Hardware Description Language) is a hardware description language that can model the behavior and structure of digital systems at multiple levels of abstraction, ranging from the system level down to that of logic gates, for design entry, documentation, and verification purposes.

The language was developed for the US military VHSIC program in the 1980s, and has been standardized by the Institute of Electrical and Electronics Engineers (IEEE) as IEEE Std 1076.

The Very High Speed Integrated Circuit (VHSIC) Program was a United States Department of Defense (DOD) research program that ran from 1980 to 1990. Its mission was to research and develop very high-speed integrated circuits for the United States Armed Forces.

Overview of VHDL Syntax