Altera Field Programmable Gate Arrays (FPGAs) are popular devices used world wide and can be found on many high-end and not so high-end development kits and boards. Some of the less expensive evaluations kits (and favourites of ours) that are ideal for rapid prototyping of their mid-range FPGAs include the DE0-Nano, the BeMicro CV and the BeMicro Max.
The application software used to program Altera's FPGAs is known as Quartus and is available for both the Windows and Linux platforms, although sadly, just like Xilinx's Vivado, it is not available for OS X. In this blog post we overcome the hurdles required to run Quartus on Linux's OpenSuse 13.1 (Bottle), as the time approaches to put one of our BeMicro CVs to work.
The Quartus or Quartus II software, as it is officially known, is available from Altera's website (www.alter.com) and as far as we know is not available from a Linux repository. Two versions are available a subscription edition and a web edition. The subscription edition is a huge investment and is typically used on commercial projects that are likely to see a return in the investment. Hence, evaluation kit users are more likely to install the web edition, that is license free, which could be a first for EDA vendors, maybe? Altera's SDK for OpenCL will be covered in a separate post.
Navigating to the download page offers one the option of downloading the latest version of Quartus II, which at the time of the release of this blog post is Quartus II version 14.1. A choice of operating system is also available, which for the purpose of this article is Linux. We also have Windows versions installed, however for the purpose of writing software to interact with our FPGAs we prefer Linux. Downloaders are also offered a choice of download methods, we typically use the direct download one. However, if your Internet connection doesn't cut the mustard you may wish to consider the Akamai DLM3 download manager.
What do you get for your money? Well, since you haven't paid for the software the answer is not the full monty! Although Quartus software development goes hand in hand with selling FPGAs, Altera are not a registered charity and expect users to pay for their premium device support and service. Generally, the web edition of the software offers support for all devices found on the budget evaluation kits and boards, which are typically at the cheaper end of the price bracket.
I wonder what happened to Cyclone III support? It might be that a previous version of the Quartus software should be downloaded to work with Cyclone III based FPGA boards. It should be noted that multiple versions of Quartus can be installed on the same PC.
Once downloaded the installation of the software is relatively easy, as can be seen later on, by navigating to the download folder. The downloaded file does not have executable permissions, so it is left to the installer to provide them before commencing with the install. This can be down by issuing the following command in the download directory.
To run the now executable script we typically do so as root, again in the download directory.
An installation dialogue window, as seen in the image below, now appears and it is only necessary to click on Next buttons to complete the installation process. Before we show the full dialogue process we will continue with the more important parts of what one should do when the software is installed and it doesn't actually work!
On completion of the installation you can navigate to the installation directory, which in our case is in the /opt/altera directory (you do not need to be root) and start Quartus by typing the following commands ...
This then launches the Quartus II, version 14.1 software, as seen in the image below, but we are not yet fully in business! At this stage you can play around with the software only, but you cannot configure any devices.
The reasons we are not yet fully in business is because we still need to create device rules, udev rules, for Altera's USB Blaster. This is used to program the FPGAs on our development boards and evaluation kits with a configuration file generated by Quartus. Also, we still need to take care of something exotically named the jtagd deamon.
Firstly, for Linux to recognise the USB Blaster we need to create udev rules by issuing the following command to navigate to the dev rules directory ...
... then create a file called ...
... next add the following device rules to the file, created previously ... (N.B SYSFS has been deprecated and no longer works)
Next we configure the jtagd daemon, which Quartus uses as an intermediary between itself and a configurable device. The daemon is configured so that it has access to the list of FPGA descriptors and runs as root. The descriptors can be found in the Quartus installation directory, which in our case is the file.
This file must be added to the jtagd configuration directory, which if it does not exist you must create, like so ...
To check that you are capable of following even the most simple of instructions you can type the following ..
This should produce a list of incomprehensible numbers of the parts, as required by the jtagd. Finally, we need a way for jtagd to start at boot by typically placing it in the rc.d system or placing the following line in the /etc/rc.local file. However, starting with openSUSE 12 systemd is a replacement for the popular Sysv init daemon and the jtagd needs to be started at boot relative to the systemd. I do not yet have time to understand how to do this, but the jtagd can be started manually after each system boot and the jtag chain can be tested by issuing the following two commands.
When the BeMicro CV deevelopment board is attached to the Linux machine's USB port I get the following output ...
... and finally, apart from the issue of starting the jtag daemon at boot, we are open for business.
The full installation procedure is detailed below.
The installation starts with welcoming screen informing you, in case you forgot, that you are installing the freebie Quartus II Web Edition.
License agreements, one day I promise to read not just the first couple of lines, but get a law degree and read the full thing, but for now I merely accept and click on next.
I prefer for all my EDA software to reside in the /opt directory, as it is easier to manage and create backups and as Altera is an EDA application I do the same.
The web edition includes the Nios II Embedded Development Suite (EDS). However, I not sure whether I would ever need it, as most Cyclone V FPGAs have embedded SoC variants consisting of the dual ARM Cortex A9s .
The total installation will require about 5 GB of disk space, if you agree to using that amount of disk space then click on next ...
... then we are up and running with the installation process proper.
It doesn't take too long to install either. At the end of the installation you have options to create a desktop shortcut, on Linux?, launch the application or provide feedback. You decide!
Next, the application launches and you are happy, until you realise that no devices have been installed. So you have to begin an additional installation process to install the devices you require and are permissible under the Quartus web edition. In Quartus you can navigate to Tools->Install Devices to begin the process.
Another installation dialogue, but this time for the devices.
The next dialogue is quite confusing, as it indicates that you need to use the text entry field, shown in the screenshot above, to point to the download directory on your hard drive to install the devices. I couldn't find the devices on my drive and realised that they need to be downloaded separately.
So back to Altera's website and the page corresponding to the devices available for Quartus' web edition can be found.
The device files downloaded appeared as .qdz files in my download folder. I could now correctly locate the download folder and clicking on next advanced the dialogue window.
Here, I checked all the available devices, although I am currently only interested in the Cyclone IV and V devices and moved on by clicking on next.
Approximately, another 2.5 GB of disk space would be required. I agreed and clicked on next.
Again, the installation was quick and pain free ...
... and finally complete.
Starting Quartus again from the command line in a terminal window, offers users to buy a Quartus software subscription edition license or run the Quartus II (web edition). After a long and hard decision, arrived at by intensely debating with myself, I decided that the web edition was good enough for my purposes ...
... and checked the Run the Quartus II software option before clicking okay .
That's it really. I still got the niggling problem of starting the jtagd at boot, but I am hoping to solve that problem either by googling and relying on someone else putting in the hard work or if all else fails putting in the hard work myself.