Environment Setup Tutorial¶
Overview¶
This tutorial will set up your SMVDU-TITAN-X development environment from scratch on Ubuntu 22.04 or 24.04 LTS.
Time required: ~1–2 hours (mostly download/build time)
System Requirements¶
| Component | Minimum | Recommended |
|---|---|---|
| OS | Ubuntu 22.04 LTS | Ubuntu 24.04 LTS |
| CPU | 4 cores | 8+ cores |
| RAM | 16 GB | 32 GB |
| Disk | 100 GB free | 200 GB SSD |
| Internet | Required | Fast connection |
Step 1: Clone the Repository¶
Submodule Tip
The --recursive flag initializes all submodules. If you cloned without it:
Step 2: Install System Dependencies¶
This installs:
- Build tools (gcc, cmake, autoconf, etc.)
- Java 17 + SBT (for Chisel/Chipyard)
- Verilator (RTL simulator)
- Python 3 + pip packages (cocotb, LiteX)
- QEMU RISC-V (for software stack testing)
- GTKWave (waveform viewer)
Step 3: Install RISC-V GCC Toolchain¶
Verify:
Step 4: Build Phase 1 Firmware¶
Output:
AS main.S
LD build/hello_uart.elf
build/hello_uart.elf :
section size addr
.text.init ... 0x1000
.text ...
...
HEX build/hello_uart.hex
BIN build/hello_uart.bin
Step 5: Run Verilator Lint¶
Step 6: Set Up Chipyard (Longer Step)¶
Time Warning
Chipyard setup, including submodule initialization and conda environment creation, can take 30–60 minutes depending on your internet speed and CPU.
After Chipyard is set up:
conda activate chipyard
cd hardware/chipyard
make -C sims/verilator CONFIG=smvdu.titan.x.TitanXSimConfig
Step 7: (Optional) Set Up LiteX for Rapid FPGA Prototyping¶
bash scripts/setup/setup_litex.sh
# Test LiteX target
python3 fpga/litex_targets/arty_a7/titan_x_litex.py --help
Step 8: View Documentation Locally¶
Environment Variables Summary¶
After setup, your ~/.bashrc should contain:
# RISC-V Toolchain
export RISCV="/opt/riscv"
export PATH="$RISCV/bin:$PATH"
# Chipyard (if installed)
# conda activate chipyard
Troubleshooting¶
"command not found: riscv64-unknown-elf-gcc"¶
Chipyard conda env not found¶
Verilator version too old¶
Chipyard requires Verilator ≥ 4.226. Install from source if needed:
Next Steps¶
- Chipyard Setup — Deep dive into Chipyard configuration
- First Simulation — Run your first RTL simulation
- FPGA Deployment — Program your FPGA board