Ubuntu (or another APT-manged Linux distro) is the preferred environment for running Cascade and interfacing with the DE10-Nano. MacOS can run Cascade natively for software simulations, but is not supported by Intel's Quartus FPGA compiler to target the DE10-Nano. Windows is currently not supported by Cascade. Therefore, you will likely need to install Linux in order to access all the features of Cascade needed for this lab. For most students, this will involve running Linux from within a VirtualBox VM. While it is also possible to install Linux natively or with commercial VM software, you do so at your own risk. If you already have admin privileges on a native Ubuntu installation or on macOS, you can skip the VirtualBox VM sections.
To install VirtualBox on Windows, simply run VirtualBox-*-Win.exe. On macOS, open VirtualBox-*-OSX.dmg and run VirtualBox.pkg from the newly-mounted disk image. The installer is pretty straightforward, just follow the directions and opt to install USB drivers if prompted. After VirtualBox is installed, open it and install the Extension Pack. If VirtualBox does not prompt you do to this automatically, you can open the downloaded extension pack with VirtualBox to install it or install it through the Extensions pane in the Settings / Preferences dialog.
To verify everything worked, launch the VM. The default username and password are "cascade". The VM should already have Cascade, Quartus, and the VirtualBox Guest Additions installed. A clone of the Cascade source code is provided in "~/cascade" for convenience. The Quartus installation is in "~/intelFPGA_lite/19.1/". There are links to both these locations on the Desktop as well. You may want to install updates, pull the latest copy of Cascade, and do a clean build and install to make sure you have the latest bug fixes before starting.
chmod +x QuartusLiteSetup*.run
and then running it. The installer
should automatically detect and install the Cyclone V device files.tar -xvf . Quartus-lite-*-linux.tar
and run it with ./setup.sh
. Only install device files
for the Cyclone V FPGAs as those are the only ones you need.sudo apt install libgetopt-simple-perl
cd ~/intelFPGA_lite/19.1/quartus/linux64/perl/bin
mv perl perl_old
ln -s /usr/bin/perl
Once you've got your Linux installation working, you will be able to use all the Verilog capabilities necessary to write your code for the lab. However, since the hardware you describe with your code is being simulated in software, you may find it runs slower than desired. For this purpose, Cascade can take advantage of the FPGA on the DE10-Nano to run your hardware as intended. This required getting Linux working on the DE10 (to run Cascade), configuring your VM to be able to connect to the DE10, and configuring Linux on your VM to do the JIT compliation to convert your Verilog to an actual hardware configuration.
Due to the complexity of getting Cascade running on a DE10-Nano, we have compiled a microSD card image that contains everything you need to get Cascade running on the DE10. Before proceeding make sure you have:
Card Reader
or similar.
Next, determine which device Linux has assigned to your SD card reader. It is
extremely important that you get this right as overwriting the wrong device can
cause you to lose all the files in your VM and make it unusable. Open the Disks
utility and select the entry on the right corresponding to your microSD reader.
On the right window, look for Device /dev/sdX#
and note the
letter corresponding to the microSD reader.
Once you've identified the microSD device name,
open a terminal and navigate to the directory you downloaded the image to.
We will use the dd
utility to update the image.
The next steps will overwrite the microSD card, so make sure you don't have
any files you want to keep on it!
First, make sure all partitions on the SD card are unmounted. Run:
sudo umount /dev/sdX*
Then, we'll use the dd
utility to copy the image over,
4 megabytes at a time, decompressing the image as we go:
tar xzOf cs378h.tar.gz | sudo dd of=/dev/sdX bs=4M
When dd
is done, it will output something similar to:
463+1 records in
463+1 records out
1945317376 bytes (1.9 GB, 1.8 GiB) copied, 55.269 s, 35.2 MB/s
The microSD card is now initialized with Linux and ready to go. Insert it into the slot on the underside of the DE10 with the pins facing toward the board.
In order to access the DE-10 from your VM, you'll want to configure device
filters under the the VM's settings→Ports→USB pane. You can add a
filter by clicking the plus button and selecting a currently-detected USB device
to capture. The Micro-USB cable should show up as Linux 4...
or as
Netchip RNDIS/Ethernet
. It is important to add a filter for this
device now because your OS may prevent you from passing it through if it's not
captured as soon as it's attached. After you've started your VM, reconnect this
cable and check the Devices→USB menu to look for a check mark to make sure
it was captured properly. If it wasn't, you may need to reconnect the cable
until it is.
In the virtual machine, you should be able to now SSH into the Ubuntu
installation running on the ARM cores of the DE10. The username and password
are both set to fpga
, and the IP address will be
192.168.7.1
. In a terminal, connect using:
ssh fpga@192.168.7.1
Type yes to trust the device if prompted, and enter the password: "fpga".
In the VM (not in a SSH session to the FPGA) type:
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward > /dev/null
sudo iptables -P FORWARD ACCEPT
sudo iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.0/24
This will enable network address translation and forward packets coming from
192.168.7.*
, which includes the FPGA. From an SSH session with
the FPGA you can verify network connectivity by running something like the
following command and looking for responses to your packets:
ping google.com
To turn off forwarding, you can type:
echo 0 | sudo tee /proc/sys/net/ipv4/ip_forward > /dev/null
sudo iptables -t nat -F POSTROUTING
If you want to use a traditional Ethernet connection, connecting the DE10
to a router via an Ethernet cable works as well. However, if you are doing
this from within the CS building, you will have to authenticate before being
allowed to connect. This can be done by running the following command after
inserting your UTCS username and password into the appropriate slots:
curl -d "username=XX&password=YY" https://horatio.cs.utexas.edu/login.cgi
In order for Cascade to compile programs for the DE10's FPGA,
it will need access to your Quartus installation.
Run quartus_server and specify the path to where specifically Quartus is installed.
The command should look something like this:
quartus_server --path ~/Desktop/intelFPGA_lite/18.1/quartus/ --port 9900
.
When invoking Cascade on the DE10, you should run something like this:
sudo cascade --march de10 --quartus_host X.X.X.X --quartus_port 9900
.
The IP address of your VM should be something like
192.168.7.2
or 192.168.7.5
.
If you're using Ethernet with your DE10, you'll need your machine's IP address.
If you get a connection error, you may need to restart the
quartus_server application on your Linux VM and change its port.