Contributors: William Brunton - Wbru608@aucklanduni.ac.nz Luce Thwaites - lthw148@aucklanduni.ac.nz
This guide provides step-by-step instructions to set up the FlexPRET processor, RustOS operating system, and Python GUI environment on Windows using WSL (Windows Subsystem for Linux). Refer to the markdown file API.md in the RustOS sub folder for a full list of API functions
About the Components:
- FlexPRET: A fine-grained multithreaded RISC-V processor designed for mixed-criticality systems
- RustOS: A hard real-time operating system written in Rust, specifically targeted for the FlexPRET processor
- Python GUI: A PyQt5-based graphical interface for development and testing
- Windows 10/11 with WSL support
- Administrator access
Open PowerShell as Administrator and install Ubuntu:
wsl --install -d UbuntuAfter installation, open your Ubuntu terminal and install Git:
sudo apt update
sudo apt install gitgit clone https://github.com/pretis/flexpret.git
cd flexpret/sudo wget -q --show-progress https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v14.2.0-2/xpack-riscv-none-elf-gcc-14.2.0-2-linux-x64.tar.gz -O gcc.tar.gz
sudo tar xvf gcc.tar.gz --directory=/opt
ls -l /opt/xpack-riscv-none-elf-gcc-14.2.0-2sudo apt install verilator
verilator --versiongit submodule update --init --recursive
sudo apt install cmake make gcc g++ openjdk-11-jdksudo apt-get update
sudo apt-get install apt-transport-https curl gnupg -yqq
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo -H gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/scalasbt-release.gpg --import
sudo chmod 644 /etc/apt/trusted.gpg.d/scalasbt-release.gpg
sudo apt-get update
sudo apt-get install sbtecho 'export RISCV_TOOL_PATH_PREFIX=/opt/xpack-riscv-none-elf-gcc-14.2.0-2' >> ~/.bashrc
source ~/.bashrcsudo ln -s /opt/xpack-riscv-none-elf-gcc-14.2.0-2/bin/riscv-none-elf-objdump /bin/riscv-none-elf-objdump
sudo ln -s /opt/xpack-riscv-none-elf-gcc-14.2.0-2/bin/riscv-none-elf-objcopy /bin/riscv-none-elf-objcopy
sudo ln -s /opt/xpack-riscv-none-elf-gcc-14.2.0-2/bin/riscv-none-elf-gcc /bin/riscv-none-elf-gccsource env.bash
cmake -B build && cd build
make all installcd ../sdk
cmake -B build && cd build
make && ctestcd ../../../
git clone https://github.com/lthw148/RustOS.git
cd RustOS/rust_no_stdcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
sudo apt install rustup
rustup target add riscv32i-unknown-none-elfsudo apt install python3 python3-pip python3-venv xxd llvmpython3 -m venv venv_pyqt
source venv_pyqt/bin/activate
pip install PyQt5sudo apt-get update
sudo apt-get install -y \
libxcb-xinerama0 \
libxcb-xinerama0-dev \
libxkbcommon-x11-0 \
libxcb1 \
libx11-xcb1
sudo apt install libxcb* libx11-xcb* libxkbcommon-x11-0Download and install the following executables on your Windows host:
-
ActiveTCL 8.6
- Download from: https://platform.activestate.com/ActiveState/ActiveTcl-8.6
-
VcXsrv - X Server for Windows
- Download from: https://sourceforge.net/projects/vcxsrv/
Start VcXsrv with the following settings:
- Display number:
0 - Enable "Multiple Windows"
- Start "no client"
- Disable access control (important for WSL connectivity)
echo 'export DISPLAY=:0' >> ~/.bashrc && source ~/.bashrcAfter completing all steps, you should be able to run the script file ./compile_gui to run the python GUI. Copying the contents from the test.rs into main allows to do array summation testing.