Tutorial by Daniel Hertz, originally published on Maker.pro
We covered how to get started with the Arduino MKR Vidor 4000, showing you how to configure the FPGA on the board. For that purpose, we used a pre-compiled file. In this article, we will introduce you to the basics of working with the Quartus, the default IDE that comes with the FPGA and show you the necessary steps to create a basic Verilog project that can be compiled and uploaded to the Arduino.
During the set-up process, you’ll be asked to install support files for different Intel FPGAs. However, don’t install any boards for now. Instead, navigate to Intel’s download page and search for the FPGA family you want to use. Make sure to select the same version of Quartus that you installed on your computer:
The download page for Quartus Prime Lite.
Then, scroll down and select Cyclone V device support if you're using the Arduino MKR Vidor 4000. For now, just download the support files and wait for the installation of the IDE to finish.
Select Cyclone 10 LP device support.
Once it’s done, launch the device installer that came with the IDE. In it, select the folder where you just saved the support files. On the next page, pick the devices you want to install.
Select the devices you want to install.
When the assistant is done, start the Quartus IDE.
The user interface consists of six main elements in its default configuration.
The six main elements of Quartus IDE.
Launch the project wizard from the main menu-bar.
Select New Project Wizard in Quartus IDE.
The assistant will take you through the process step by step. On the first screen, simply click Next. Then, enter your project’s name and the name of the top-level design entity.
Enter your project's name and top-level entity.
On the third screen, choose Empty Project and click next. Skip the next screen, as we will add files to the project later. The fifth pane requires you to select the FPGA you’re using. In my case, it’s the 10CL016YU256C8G.
Select the FPGA you're using.
The exact model number is printed on the chip. Skip the sixth screen for now. This pane is only needed if you use other programs outside of the Quartus Toolchain that you need to integrate into the compile process. On the last screen, review the settings and click finish.
Once the new project is created, launch the Pin Planner.
Launch the Pin Planner in Quartus.
The Pin Planner with no pins assigned.
If you own a supported development board, you can load the pin assignments from a preset. Consult your device's manual for further information.
In my case, the pin assignment table was available from this official Arduino repository. Once you load it into your project and look at the pin planner, you should see something similar to this:
The Pin Planner with the pins for the Vidor 4000 uploaded.
As you saw in the previous section, it’s possible to add external files, allowing the project to use them. To keep this article short, I'll use the data provided by Arduino. Download the following elements from their GitHub repository:
The first element is the pin mapping. The second one contains their IPs you can use. Copy the files into the project folder. It should now look similar to this:
Downloading the elements from GitHub.
Then, in Quartus, link the newly copied files to your project so that the IDE can locate them. To do this, double click the files node in the project navigator.
Add the downloaded elements from GitHub to Quartus.
A new window will pop up. In it, select the aforementioned files.
Select your new files.
When done correctly, the IP catalog should now list the imported elements.
Downloaded files are now available in the IP catalog.
When everything is set up, create a new Verilog file that will serve as your top-level entity. Select New and then File from the main menu bar. In the window that opens up, choose Verilog HDL File and click OK.
Select Verilog HDL file.
When you first save this file, make sure to enter the name that you chose as the top-level entity earlier. Then, create a second file that'll contain your custom Verilog code, and save it as custom.v. Paste the contents of the Vidor FPGA Github into your file and make sure to change the module name, if necessary.
You should now be able to compile the entire project without any problems. To do so, you can either double-click the Compile Design task or you can use this button in the top menu bar (Shortcut: CTRL + L):
Compiling your design in Quartus.
Unfortunately, Quartus can’t upload the compiled files to the Vidor directly. However, I demonstrated how you can send the compiled project to the board in the Getting Started with Arduino MKR Vidor 4000 article.
You can find all of the Empty Vidor Project files by following the link.
This tutorial introduced you to the absolute basics of the Intel Quartus IDE. After reading it, you should be able to create a new project, link the pins of your FPGA, create new HDL files, import existing files, and compile your project. For additional tutorials, visit the Intel training catalog.