Labs to experiment Caravel SoC FPGA module design with Verilog & HLS.
- lab1: AXI master read/write BRAM
- lab2: spiflash protocol design and validation
- lab3: Axilite access GPIO pins
- labi: Caravel SoC FPGA integration (Community released Caravel SoC FPGA)
- lab-exmem: Executing Function in User Project Memory
- lab-interrupt: User Project Interrupt Enabling and Handling
- lab-uart: AXI UART Lite for Caravel
- Vitis HLS - course-lab_1 and course-lab_2
- Xilinx XSIM - XSIM of GCD
- Basic Verilog & HLS coding
Get presetup Vitis Virtual Machine from course TA or setup following toolchains yourself.
- Ubuntu 20.04+ and Xilinx Vitis HLS tools installation guide
- GTKWave and RISC-V GCC Toolchains
$ sudo apt update
$ sudo apt install gtkwave git -y
$ sudo wget -O /tmp/riscv32-unknown-elf.gcc-12.1.0.tar.gz https://github.com/stnolting/riscv-gcc-prebuilt/releases/download/rv32i-4.0.0/riscv32-unknown-elf.gcc-12.1.0.tar.gz
$ sudo mkdir /opt/riscv
$ sudo tar -xzf /tmp/riscv32-unknown-elf.gcc-12.1.0.tar.gz -C /opt/riscv
$ echo 'export PATH=$PATH:/opt/riscv/bin' >> ~/.bashrc
$ source ~/.bashrc
git clone https://github.com/bol-edu/caravel-soc_fpga-lab ~/caravel-soc_fpga-lab
Draft design specs and design reference sources of labs.
- Design spec: read_romcode.cpp
- Lab Content:
- Add another axi-master path to write to PS Memory
- Load program.hex (RISCV code from any of the Caravel testbench) to PS memory buffer
- Develop host code to load program.hex to BRAM, and read from BRAM
- Compare the input and output buffer content is the same
- Design spec: spiflash.cpp
Note: this spiflash design only implements: single bit spiflash read - Lab Content:
- Develop flash controller spiflash_ctrl.v (you can find the design from Caravel) in Verilog
- Synthesize spiflash.cpp (this is flash memory device)
- Develop a simple BRAM behavior model, preload the content in testbench
- Integrate the spiflash_ctrl.v + spiflash.v and verify spiflash_ctrl.v can correctly read data from BRAM through spiflash.cpp
Note: spiflash.cpp is not verified
- Design spec: caravel_ps.cpp
- Lab Content:
- Design a simple module mprj_control.v
Use one mprj_i pin (synchronize with host code) to stage through several steps, e.g.
a. Change mprj_o pins value
b. Some of mprj pins used for loop-back, e.g. (b1) mprj_o[x] =mprj_i[n], (b2) Control mprj_en accordingly
c. Host use axilite to read mprj_o, mprj_en values - Integrate mprj_control.v & caravel_ps.v in Block design–generate bitstream
- Develop Python host code to verify its behavior