CS378H: Concurrency: Honors: Lab #5: FPGAs: Windows Environment Instructions
This document provides instructions for bringing up the Cascade Lab Development
environment on a Windows machine. The instructions have been verified on Windows 10 devices.
Things you will need:
- Laptop or Desktop running Windows connected to the Internet
- The DE-10 FPGA board
- BOTH USB cables that come with your DE-10 FPGA board
- An ethernet cable for the DE-10 to your Windows machine
What it should look like
The connections that concern you are circled in red.
Note that there is an ethernet cable in addition to the power cable and two USB cables.
There is a surprising number of ways to misconfigure the hardware in the lab. Even your
illustrious instructor got it wrong more than once, so when things seem to be going wrong,
check your connections. You'll likely find you need to replug things from time to time
to get all the hardware and connections in the right state.
VirtualBox
- Download and install VirtualBox. You can get a Windows installer here: https://download.virtualbox.org/virtualbox/5.2.20/VirtualBox-5.2.20-125813-Win.exe
- Run it by double-clicking on VirtualBox-5.2.20-125813-Win.exe after the download.
- You can take most of the installer defaults, but I strongly recommend
installing USB device software. (Should be an option for the installer)
Linux
With VirtualBox set up, you'll need to download a Linux ISO to set up Linux.
We recommend Ubuntu as we have tested Cascade with both the 16.04 and 18.04
Long Term Support releases, though any recent Ubuntu release should work.
Ubuntu can be downloaded from
ubuntu.com/download/desktop.
The instructors have tried 16.04 and 18.10. The win10 instructions were
developed using 18.04, so the downloaded ISO installer is called ubuntu-18.10-desktop-amd64.iso.
Create and Configure a VM
- In virtual box create a new VM (Machine/New menu).
- Choose a name (e.g. "cascade-lab").
- The VM type should be Linux.
- Version is Ubuntu 64-bit.
- The default memory is a bit small. I recommend at least 4GB memory.
- Hard disk option: create a virtual hard disk. You probably want it to be
dynamically sized. There is an option to split it into sub-files of
2GB or less, which you can select or not depending on whether you
plan to copy your VM from host to host a lot. Smaller files can make this easier.
10GB may not be enough space after you install all the tools you need like
Quartus (the Intel FPGA compiler), whose installer takes a whopping 6GB alone.
My VM started with 26GB.
- Power on your machine by double clicking on it in the left pane in VirtualBox.
- The "Select start-up disk" dialog will come up. Select a file option and to point it to your
Linux ISO:
ubuntu-18.10-desktop-amd64.iso
- An ubuntu installer should boot up. Press the "Install Ubuntu" button. Choose to Download
updateds while installing Ubuntu. Whether you
want a normal or minimal installation is up to you. These instructions have been tried
with both.
- Choose "Erase disk and install Ubuntu, and press "Install Now".
- When the "who are you" dialog comes up, be sure to choose something you'll remember!
These instructions took user "cascade", computer name "cascade-minimal",
and password "fpga378lab". Log in automatically or not is up to you.
- You can log into your VM after clicking "Restart Now".
- After the installer completes and you've logged in,
install the guest additions. You
can install them even on a live VM using the VirtualBox
Devices menu, where there is an item: "Insert Guest Additions CD".
If you click on this, a CD will mount in your guest with the installer,
and you can either go find the appropriate *.run file in /mnt, or let
the OS auto-installer run it (a dialog will come up when you click
that menu item). There is a nice tutorial on using guest additions for
host/guest file sharing here.
- The system will probably prompt you about installing updates. It shouldn't matter
whether you do or not, but for completeness sake, I took the updates, so the instructions
below assume them but probably do not depend on them.
- Start a terminal in your guest
- You will need to install gcc, g++, and git (best option is "sudo apt-get install gcc g++ git")
- Download the latest quartus lite edition from Intel (you'll have to register with Intel!)
The download TAKES FOREVER, as even the lite edition installer is a full 6GB.
- You can install the quartus tools by untar'ing the file you download into your guest home
directory and typing
sudo ./setup.sh
:
cd ~
tar -xvf Quartus-lite-18.1.0.625-linux.tar
(fpgasoftware.intel.com/static/quick_start_guide/quick_start_guide_18.1_en.pdf) (https://www.terasic.com.tw/cgi-bin/page/archive_download.pl?Language=English&No=1046&FID=f1f656bb5f040121c36f2f93f6b107ff)
- deselected all but Cyclone Variants
- After the installation completes, you may wish to delete the untar'ed
installer files to recover some space and make your VM image more portable.
- You will need to install and build cascade in the VM as well (see below).
Install and Build Cascade
Cascade's README has good directions on how to install it on Linux:
github.com/vmware/cascade/blob/master/README.md.
It is worth noting that you may not need to install libncurses-dev on Ubuntu
(or it may go by another name, like libncurses5-dev). Building and testing your
Cascade installation will take some time (around a half hour to an hour for
"make check"):
- Follow setup instructions on https://github.com/vmware/cascade
- Don't forget
sudo apt-get install git, gcc, g++
- Pay careful attention to the details (e.g. remember
--recursive
flag! I didn't on my first attempt.)
Connect to and Configure the DE-10 FPGA
In order to access the DE-10 from your VM, you'll need to configure device
filters via the the VM settings→Ports→USB pane. To do this, you'll
want to plug in both of the USB cables from the DE-10 to your computer. Make
sure the Mini-USB cable is connected to the JTAG programming port (see DE-10
documentation, it should be near the Ethernet jack and not next to where the
smaller Micro-USB cable connects, which is the UART port). You can then add a
filter by clicking the plus button and selecting a currently-detected USB device
to capture. You should add filters for the "Linux 4.1.33-ltsi-altera ... Gadget"
and the "Altera DE-SoC". You may need to unplug and reconnect the Mini-USB cable
3-4 times before it is properly detected as the latter device. Once the filters
are set, you'll likely need to unplug and reconnect both cables while your VM
is running for VirtualBox to detect and capture both devices properly. You
should then see them under Devices→USB with a check mark preceding them.
If the Micro-USB cable is working properly, you should see a USB disk appear in
Linux with some DE-10 files in it. You should also be able to SSH into
"root@192.168.7.1" and access the DE-10's CPU. To verify that the Mini-USB
cable is working properly, should run "sudo ./quartus/bin/jtagconfig" from your
quartus install directory and see a DE-SoC device detected. See the JIT Backend
section of the Cascade README for more information. If the device isn't detected,
check your VM device filters, make sure the device shows up as connected, and
try disconnecting the JTAG cable, killing the "jtagd" process, and reconnecting
the cable. Note that when running quartus_server, your quartus path should look
something like "~/intelFPGA_lite/18.1/quartus/" (with the quotes) if you used
the default install path. You will likely have to run quartus_server as sudo to
ensure it can access the JTAG device.
Finally, you should be able to run Cascade using the de10_jit backend from the
DE-10 itself using 192.168.7.5 as the Linux IP. Note that profile_interval
should be 10 as it is now in seconds instead of milliseconds. You may also need
to use quartus_host instead of quartus_server to specify the destination IP
address. If you get a connection error, you may need to restart the
quartus_server application on your Linux VM.
- Connect the DE-10 according to the instructions in the quick start instructions
that come with your FPGA board.
- Power off/on connected DE-10.
- If you use the wrong cable, you will see a bunch of things that make it seem like things
are maybe halfway working, but they aren't
- Altera DeSoC shows up under devices menu/USB of VirtualBox
- or FT232 something or other
- Be sure to use the "USB MICRO-AB" slot and the corresponding cable. PICTURE.
My experience is that it "just works" if you connect things right.
- Type 192.168.7.1 in web browser, should bring up a nice site too.
- SSH (passwordless root login is enabled–yuck!): ssh root@192.168.7.1
- Connect the FPGA with an ethernet cable to use apt-get to install dependences!
- The DE10 does not have the
apt
package manager. You'll need to
run cascade dependency installation with opkg
.
ssh root@192.168.7.1
opkg install ccache cmake flex bison ncurses-dev
(NOTE not libncurses-dev as specified in the cascade instructions for Ubuntu)!!
- from VM:~/:
scp -r cascade root@192.168.7.1:.
cd ~
tar -xvf Quartus-lite-18.1.0.625-linux.tar
(fpgasoftware.intel.com/static/quick_start_guide/quick_start_guide_18.1_en.pdf) (https://www.terasic.com.tw/cgi-bin/page/archive_download.pl?Language=English&No=1046&FID=f1f656bb5f040121c36f2f93f6b107ff)
- deselected all but Cyclone Variants
Acknowledgements
Thanks to Eric Schkufza and Michael Wei of VMware Research Group for supporting this lab.
Thanks to our department head Don Fussell for supporting the project by helping find
funds to enable us to loan DE10 hardware to every student.