- FPGA Development Board: RZ-EasyFPGA A2.2 from AliExpress, featuring the Altera Cyclone IV.
- OS: Ubuntu 18.04 LTS (bionic)
- Get the Quartus Lite installer, ModelSim installer (optional), and the Cyclone IV development Package from the Altera website.
- Get it here: https://www.altera.com/products/design-software/fpga-design/quartus-prime/download.html
- You gotta click on Lite Edition > (Select version and OS) > Individual files and download: Quartus Prime (includes Nios II EDS) and Cyclone IV device support. Files are about 500MB - 2000MB.
- Install Quartus. Root not required
- Command:
$ chmod +x QuartusLiteSetup-18.0.0.614-linux.run $ ./QuartusLiteSetup-18.0.0.614-linux.run
- Place in ~/.intelFPGA_lite/18.0 (Note the dot before 'intel').
- Try running Quartus and verify that it launches. Command:
~/.intelFPGA_lite/18.0/quartus/bin$ ./quartus
- If you get an error like
libpng12.so.0: cannot open shared object file: No such file or directory
then go to http://mirrors.edge.kernel.org/ubuntu/pool/main/libp/libpng/ and download/install latest for ubuntu amd64. Example:
$ wget -q -O /tmp/libpng12.deb http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb $ sudo dpkg -i /tmp/libpng12.deb $ rm /tmp/libpng12.deb
- If you get an error like
- Open Quartus.
- Create a new Project
- File → New → New Quartus Prime Project
- General Settings:
- Working directory should be '<path_to_your_dev_folder>/helloWorld'.
- Set name and top-level-design entity to 'HelloWorld'.
- Create an Empty Project
- For Design Files, add that Cyclone IV file you downloaded, cyclone-17.0.0.595.qdz (or similar).
- Family, Device and Board Settings
- Family: Cyclone IV E
- Device: All
- Target Device: Specific device selected in 'Available devices' list.
- Name Filter: EP4CE6E22C8
- Select the EP4CE6E22C8, not the 'EP4CE6E22C8L'.
- EDA Tools Settings
- None for now but it would be nice to get ModelSim-Altera working for Simulation.
- You should now have a blank HelloWorld project staring at you.
- Add a main source file. Select File > New > Verilog HDL File. Name it 'HelloWorld.v' and save it.
- Add the following code to HelloWorld.v:
module HelloWorld ( input clk, output led1, led2, led3, led4 ); reg [25:0] dig; // Custom order of LEDs to distinguish from default program assign {led1, led4, led3, led2} = dig[25:22]; always @(posedge clk) dig <= dig+1; endmodule
- Hit the "Start Compilation" button (blue play button) and sanity check that the project compiles.
- Open Assignment Editor. Create a text file somewhere called 'assignments.txt'. Populate it with this:
To, Assignment Name, Value
clk, Location, PIN_23
led1, Location, PIN_87
led2, Location, PIN_86
led3, Location, PIN_85
led4, Location, PIN_84
- Click 'Assignments > Import Assignments' and load up your text file to overwrite the assignment editor. (I couldn't figure out how to do this through the Quartus editor). Your pin assignments should populate automatically.
- Compile the project again.
- Click on 'Programmer' to open the programmer window. Configure the programmer.
- Hardware Setup: USB_blaster [3-2]
- Mode: JTAG
- File: (Select HelloWorld.sof, which should be the only option).
- Make sure "Program/Configure" is checked.
- Make sure your development board is connected to power source, connected via USB-Blaster to PC, and turned on.
- Flash the circuit by clicking 'Start'.
- The LEDs on the board should start doing a little jig, different from the standard clock sequence.
When flashing to the board, you click Start and nothing happens. Start by running jtagconfig.
peach@peach01:~/.intelFPGA_lite/18.0/quartus/bin$ ./jtagconfig
- Run solution here (https://stackoverflow.com/questions/18704913/unable-to-lock-chain-insufficient-port-permissions).
- Then, restart the JTAG daemon.
sudo killall -9 jtagd
- Restart the PC.
In case you see this error message, your USB Blaster works, but you can't to connect to the JTAG chain. A possible cause can be a missing 32 Bit version of libudev. Download libudev1:i368 and create a symbolic link.
$ sudo apt-get install libudev1:i386
$ sudo ln -sf /lib/x86_64-linux-gnu/libudev.so.1 /lib/x86_64-linux-gnu/libudev.so.0
Another source also suggests you have the board powered on and USB Blaster connected to the board before hooking it up to the computer. The expected output is
~/.intelFPGA_lite/18.0/quartus/bin$ ./jtagconfig
1) USB-Blaster [3-2]
020F10DD 10CL006(Y|Z)/10CL010(Y|Z)/..
The RZ-EasyFPGA A2.2 is a great value at an inexpensive price.
Very good prototyping capability wit the standard interface connectors and the headers.
My design comments:
1- The RESET line is using a global clock input.
2- The device has another global reset input pin but that one is tied to an LED output
3- The other 4 global clock inputs are for the 4 push button inputs. At least CLK2 looks available.
4- These inputs are also tied to the 4 toggle switches which have redundant pull-up resistors.
5- The Verilog code examples provide designs for all of the hardware except the SDRAM.