Department of Computer Science and Technology

Course pages 2019–20

ECAD and Architecture Practical Classes


There are three routes to running the labs:

Virtual machine setup

To undertake the class you can either use the Managed Cluster Service machines in the Intel Lab at the Computer Laboratory, or a virtual machine on your own laptop. If you have a suitable laptop we recommend using it as you will likely find it quicker and you will be able to work away from the lab. You will still need to attend lab sessions for ticking and for demonstrator help: do not assume you can complete the tick work entirely on your own. If you bring a laptop, do not forget your charger: the labs involve some heavyweight computation and can rapidly flatten your battery.

If you are intending to use the MCS, skip down to the MCS and VM tool configuration section.

A suitable laptop is one of approximately the following spec:

  • Intel/AMD CPU (i5/i7/Ryzen recommended - others should work but will be slower)
  • Virtualization support (VT-x or AMD-V) present and enabled in BIOS
  • 4GB RAM (8GB or more strongly recommended)
  • 24GB of free storage. It is possible to use USB storage or SD card but some USBs/SDs are very slow (USB 3 is good, we recommend the Samsung USB 3.1 BAR Plus (any size/colour), SanDisk Extreme Go USB 3.1, Samsung EVO 32GB MicroSD card [orange version] or Samsung Pro Plus 32GB MicroSD card) If you are using this method, format to exFAT (Windows or Mac), ext3/ext4 (Linux), HFS+/APFS (Mac), NTFS (Windows) - other combinations are likely to have poor performance.
  • 8GB of temporary storage (USB stick is fine, formatted something other than FAT32 which has a 4GB file size limit)
  • A 64-bit host OS supported by VirtualBox (Windows, MacOS and Linux should be fine).

If you have a suitable laptop, download a virtual machine image to your temporary storage (requires Raven). Download the virtual machine before you arrive in the lab - the VM is 8GB and it will be very slow if everyone downloads it over wifi in the lab.

Install VirtualBox

First download VirtualBox and also download the `VirtualBox Oracle VM VirtualBox Extension Pack' for the same version (this is necessary for USB 2 support). If you are using a Linux distro with a package manager, instead install the VirtualBox package supplied by your distro and find the matching extension pack from the VirtualBox site (looking at the older builds downloads if need be).

Install VirtualBox on your machine. To install the Extension Pack, go to File->Preferences, click on the Extensions button, then click on the 'folder with triangle'. Navigate to the Extensions Pack file you downloaded (.vbox-extpack) and select it. Then follow the prompts to install the pack.

Importing the VM

Make sure you have the ECAD-Labs .vmdk (disc image) and .vbox (VirtualBox configuration file). You will need to uncompress the you downloaded to make the .vmdk

Start VirtualBox, go to the Machine->Add menu and choose your .vbox file. You should now see an ECAD-Labs entry in the VM list on the left.

Next we need to add the disc. Click on Settings, find the Storage panel and inside the Controller: SATA. Select this. An 'add hard disk' button should appear to the right. Pick 'Choose existing disk' from the popup and select your .vmdk file.

If you have more than 4GB RAM, before booting we recommend increasing System->Base Memory to 6GB (on an 8GB laptop) or more if you have more than 8GB RAM. This will reduce your FPGA synthesis time. If you have only 4GB of RAM, don't open too many other programs while the VM is running otherwise your system will become slow and memory constrained. You should also allocate as many cores to the VM as you have in your machine.

Your VM should now be ready to boot. The login information for the VM is : login:ecad, password:ecad.

Guest additions

Keep your working projects inside the VM, don't store them on your host OS and access them over shared folders - your builds will be much slower and may not work reliably.

You will probably want to install VirtualBox's Guest Additions, which enable features such as resize of the VM's display, shared clipboard, shared folders, and so on. To do this, boot your VM to the desktop. Then on the menu of the VM window go to Devices->Insert Guest Additions CD Image. This should insert a virtual CD into the VM system that will automatically install the additions and their kernel module (when prompted the password is 'ecad').

If the installer doesn't start automatically, open the terminal and type:

sudo /media/ecad/VBOXADDITIONS_5.0.16_105871/

(the number may be different on your version - press Tab to autocomplete it).

Reboot the VM afterwards for them to take effect. You can then enable Devices->Shared clipboard->Bidirectional and enlarge your window to resize the screen.

Important: when rebooting the VM, don't simply hit the title bar 'X' or the 'power off' option in VirtualBox. This is equivalent to pulling out the power cable - it may leave the storage in an inconsistent state, lose files and possibly become unbootable. Instead, either use the 'reboot' or 'shutdown' menu inside the VM's desktop, or use VirtualBox's option to 'send the shutdown signal' or 'ACPI shutdown'.

Please note: you are responsible for taking backups of your files inside the VM, and should not assume the stability of the VM image (it may fail like any other machine).

USB setup

Linux laptops

If you have a Linux laptop, to give VirtualBox access to your USB ports you will need to run the following outside of the VM:

sudo adduser $USER vboxusers

then reboot your laptop.

Windows laptops

On Windows, before starting the VM click on the 'ECAD-Labs' entry in the list of VMs and click on 'Settings'. Go to 'USB' and choose USB 1.1. OK the settings.

Now, find your VirtualBox install in Windows Explorer (probably C:\Program Files\Oracle\VirtualBox). Go to the drivers\USB\filter subdirectory. Right-click on VBoxUSBMon.inf (of type 'Setup Information') and select Install. Allow Windows to install it. Repeat the same for drivers\USB\device\VBoxUSB.inf.

Note that VirtualBox is incompatible with the USBpcap component of Wireshark, so if you have this you will need to uninstall it.

You should now be able to boot the VM with USB support.


See below for how to check the tools are correctly functioning.


If you have problems with your VM installation, bring your laptop along to your first lab session in week 1 and we'll try and fix it.

VT-x error

Either you have not enabled VT-x, Intel Virtualisation Technology or similar) in your BIOS/UEFI settings, or Hyper-V (Windows' own hypervisor) is enabled. See this guide for details how to disable Hyper-V and enable VT-x.

Keyboard driver

If you want to change to a non-UK keyboard:

  • Right-click on an empty space on the window bar at the bottom of the desktop
  • Select 'add/remove panel items'
  • In 'Panel Applets', click '+ Add'
  • Double click 'Keyboard Layout Handler'
  • A flag should appear on the bar at the bottom of the screen. Right click it, and click on 'Keyboard Layout Handler Settings'
  • Untick 'Keep system layouts'
  • Then you are free to add whatever keyboard layout you wish on the left side of the dialogue. Clicking on the flag will alternate between available layouts, or the dialogue will allow you to select a key combination.

MCS setup with USB stick

If you plan to use the MCS, you can significantly improve Quartus build times (eg from 12 mins to 5 mins) by having a local copy of the Quartus and ModelSim tools, and your project files, on a USB memory stick 32GB or larger (16GB may work but will be tight). We recommend the Samsung USB 3.1 BAR Plus (any size/colour), SanDisk Extreme Go USB 3.1, Samsung EVO 32GB MicroSD card (orange version), or Samsung Pro Plus 32GB MicroSD card, but other memory sticks with good random read/write (eg USB 3) should also give good performance. You will need to reformat it so will likely need to dedicate a stick for the duration of the labs.

First format the USB stick to ext4, which will erase all existing files. On the MCS, login to MCS Linux and plug the USB stick into the PC. Open a file manager window where you should see your stick appear in the list of drives to the left. Right click on it, and choose 'Format...'

Set Erase to 'quick' and Type to 'ext4'. Name the volume ecad_ followed by your CRSID (don't include any spaces). Accept that you really do want to format it and let the format complete.

Now download the MCS tools bundle and unpack it onto your new device (Cam-only link).

Each time you open a new terminal in which you want to use the tools, you will need to setup paths and environment variables. With your USB stick mounted (click on it in the file manager so that an 'eject' button shows next to it), open a terminal and type:

  source /media/<yourusername>/<volume_name>/setup.bash

(don't forget you can use the Tab key to complete filenames so you don't need to type this all). You'll need to source the setup script in each terminal you want to run the tools.

MCS setup without USB stick

If you're using the MCS without a USB stick, you'll use a copy of tools on the shared filesystem (which will get congested when lots of people are compiling). Each time you open a new terminal window, type:

source $CLTEACH/ecad/setup.bash

Testing the tools

You will now be able to use tools like "vsim" (simulator) and "quartus" (FPGA synthesis tool) from the command line. Check these each start a GUI to verify your setup is successful.

The first time you run Quartus it will ask to select a licensing option: simply say 'Run the Quartus Prime software'. Don't worry if there are messages about being unable to contact the licence server when you start Quartus (ask a demonstrator if your compiles fail due to licence errors). Quartus may also complain about a library inconsistency, but this shouldn't be a problem.

Installing the Intel FPGA tools yourself

It is possible to install the MCS tools bundle on your own machine, however we don't recommend this. You will have to manually check that you have the right libraries (particularly 32-bit libraries) and USB configuration. Choice of distribution is also important: Intel test on RedHat Enterprise, but we usually have reasonable luck with a Ubuntu long term support distribution. Our own installation notes are on a wiki. Having said all of that, we recommend you use the virtual machine that we've setup and tested, and is available for local download.

Important note: we are using version 16.1 of Quartus for these labs, not the most recent version. This version has good performance for the low-end Cyclone V FPGAs in our boards: more recent versions are optimised towards larger FPGAs and have greater memory demands when compiling.