This article explains how to install JavaRock and executes a sample program on DE0-Nano. JavaRock is a high-level synthesis tool, which generates VHDL and Verilog HDL code from Java code. DE0-Nano is a FPGA board, which is developed by Terasic Technologies Inc.
This article is organized as it is followed:
- About Host Machine
This section shows the set up. It uses a virtual machine (Ubuntu 12.04LTS, 32bit version) runs on a Windows PC. The applications use here are also listed.
- Configuring Ubuntu and Editing Files
This section explains how to install the development tools on Windows as well as Ubuntu and how to modify the configuration files for working with DE0-Nano.
- Writing to DE0-Nano
It shows how to transfer the program from Ubuntu to DE0-Nano and to run a sample program on DE0-Nano. This sample program lets an LED blink.
These are details of the host machine.
OS:
- Host OS: Windows 7 (64bit version, hereafter “Windows”)
- Guest OS: Ubuntu 12.04 LTS (32bit version, hereafter “Ubuntu”)
Applications:
- VMware Player (Windows, 64bit version)
- DE0-Nano System Builder (Windows)
- Quartus II 12.0sp1 (Ubuntu, hereafter “Quartus”)
Create Ubuntu image on VMware Player. Its disk size is 20GB.
DE0-Nano System Builder is an application, which generates the project file (qpf) and pin-assignment configuration file (qsf) for FE0-Nano, which is a product of Terasic Technologies Inc. DE0-Nano System Builder runs only on Windows.
Quartus is a design and development tool for FPGA and CPLD. This is created by Altera Corporation.
Quartus is installed on Ubuntu. 12.0sp1 version of Quartus is used for this project. This is not the newest version of Quartus, but this version is recommended by the creator of JavaRock. Please download Quartus 12.0sp1.
This part explains how to set up the guest OS of Ubuntu.
Install the development tool and OpenJDK. The former is used for installing Quartus, and OpenJDK, which enables JavaRock.
Code>
To make Ubuntu recognize the USB-Blaster, add the rule file of USB-Blaster (51-usbblaster.rules) to the rule file of udev (/etc/udev/rule.d). The USB-Blaster is a device, which is used for transferring programs from Ubuntu to DE0-Nano via USB connection. Udev is to manage device files, adding or deleting them.
After adding the rule file of USB-Blaster, please reboot udev. Just adding the file does not make this change effective.
code>
The diagram shown below shows the organization of working directories, which are used for this article, of Ubuntu.
Code>
To increase boot speed of Quartus, PATH of Quartus is added to bashrc. Also, JavaRock's PATH to its execution file are added to bashrc. This lets JavaRock Build program easier. Both PATHs are added to the end of bashrc.
Code>
The files added for this article are shown below.
test.sh and test.java are edited as they are shown below. In this article, the sample makes only one LED blink, and unnecessary parts in these files are erased or commented out.
Code>
Code>
After the modification of test.sh and test.java are completed, please execute test.sh. Then, make sure that test.vhd, led.vhd, and counter.vhd are located at the directory of de0-nano.
Code>
For the details of test.qpf and test.qsf, please download these attached files below and look them at for the reference.
test.qsf is modified to match the variables in a part of entity test of test.vhd. The original test.qsf does not match the pin-assignment of test.vhd. Based up the orignal test.qsf, the generated program will not run sucessfully.
Also the generated vhd files (test.vhd, led.vhd, and counter.vhd) are modified as they can read by the compiler.
test.qpf test.qsf
Code>
Code>
Steps to write the generated files to DE0-Nano are shown below. All steps are done within Ubuntu.
1. Start up Quartus Quartus is needed for writing the generated project file, and its build image, and post-build image to DE0-Nano.
Code>
Pic>
2. Read the project file Read test.qpf (a project file) from Open Project.
Pic>
3. Compile the Project Click “Start Complication” that is located at “Processing” of the menu bar. This compiles the generated files inside the project.
4. Check the pin-assignments Click “Pin Planner” that is the part of “Assignments” of the menu bar. You can see the configuration of pins, and you can check whether the configuration of pins is the same as your pin-assignments or not.
The configuration (allocation) of pins for this article is shown below.
Pic>
5. Start up Programmer Click “Programmer” that is categorized as the part of “Tool.” The function of “Programmer” is to write the generated image to DE0-Nano. In other words, it is “programming” to DE0-Nano. You can select a device, which is used for writing the image file to the board. In this article, USB-Blaster is selected.
If the pop-up window indicates “NO Hardware,” click “Hardware Settings” and select a device that is listed inside “Current Selected Hardware. For this article, it should be “USB-Blaster.”
Caution: If USB-Blaster DOES NOT appear at the selection, please check the rule file of udev.
Pic>
6. Transfer the image to DE0-Nano Click “Start” that is located inside “Programmer”. The generated image is transferred to DE0-Nano.
Please check the “Progress” reaches at 100% (Successful). If does it so, in this case, LED0 at DE0-Nano starts blinking.
Pic>
Pic>