Welcome to Lab 0 of Autumn Term Instruction Architectures and Compilers (IAC).
In this lab, you will install the tools needed for both the labs and coursework.
At the end of the lab you will have installed the following tools:
- VS Code
- Verilator which converts SystemVerilog HDL into a C++ equivalent model
- riscv-gnu-toolchain which contains RISC-V specific tools such as
riscv64-unknown-elf-gcc, a cross-compiler for RISC-V programs - gtkwave which allows you to view waveforms of your design which were produced by Verilator
- A folder located at ~/Documents/iac which contains this repository, along with a VS Code workspace used to test that your toolchain has installed correctly
-
Make sure your version of Windows is up-to-date. You must be running Windows 10 (Build 19041 and higher) or Windows 11.
-
Install VS Code
-
Open Command Prompt as Administrator and enter
wsl --installto enable Windows Subsystem for Linux (WSL). You will need to restart your machine after doing this. -
In Command Prompt, run
wsl --set-default-version 1to use WSL version 1 instead of version 2. For this coursework, WSL 1 is required as WSL 2 does not support USB device access. -
Download Ubuntu 22.04 from the Microsoft Store. If you already have this downloaded, run
wsl --set-version Ubuntu-22.04 1to make sure this runs under WSL 1. -
Download Windows Terminal for an improved terminal experience
-
Inside the Ubuntu terminal, enter
bash <(curl -fsSL https://raw.githubusercontent.com/EIE2-IAC-Labs/Lab0-devtools/main/tools/install.sh)You may have to enter your password a few times while everything installs.
Depending on your Internet connection, this may take up to 15 minutes.
-
VS Code should automatically open after the previous step. If not, open the workspace at
~/iac/Lab0-devtools/autumn/workspace/iac-autumn.code-workspace; to do this open VS Code, and select "File->Open Workspace from File...", then navigate to the workspace file. -
Follow the instructions in the toolchain project to test that your tools are functioning correctly. This folder is already downloaded and can be found in your VS Code workspace you just opened.
-
Install VS Code
-
Open a terminal and enter
bash <(curl -fsSL https://raw.githubusercontent.com/EIE2-IAC-Labs/Lab0-devtools/main/tools/install.sh)You may have to enter your password a few times while everything installs.
Depending on your Internet connection, this may take up to 15 minutes.
-
VS Code should automatically open after the previous step. If not, open the workspace at
~/iac/Lab0-devtools/autumn/workspace/iac-autumn.code-workspace; to do this open VS Code, and select "File->Open Workspace from File...", then navigate to the workspace file. -
Follow the instructions in the toolchain project to test that your tools are functioning correctly. This folder is already downloaded and can be found in your VS Code workspace you just opened.
The bash <(curl -fsSL https://raw.githubusercontent.com/EIE2-IAC-Labs/Lab0-devtools/main/tools/install.sh) first runs curl, which downloads the install script from GitHub. The contents of this file are then redirected to the bash shell to be executed.
The install.sh script installs a few common dependencies before detecting what Operating System you are running on. It then runs one of the OS specific scripts in the same folder. These compile Verilator from source, as well as install the riscv-gnu-toolchain from pre-compiled binaries.
If something didn't work, create a new issue in this Github repository.
Make sure to include the full terminal log, along with screenshots and extra context about which step you were trying to perform.
However, before posting an issue, it is encouraged for you to have a go at debugging the issue yourself.
Messages starting with [iac] are frequently
logged to the terminal, showing you what the script is doing.
By looking at the scripts in the ./tools directory, you should be able to find the relevant section based on the last outputted log message.
