This is a very simple example for using the APB3 memory mapped bus inside the Vexriscv. The purpose is learning the mechanics of connecting larger extensions to the Vexriscv.
Use the Virtual Machine 1.5 from:
https://random-oracles.org/risc-v/
Open console, change to folder vexriscv
and run
sbt "runMain mupq.PQVexRiscvSim"
Open new console, change to folder vexriscv
and run
openocd-vexriscv -f vexriscvsim.cfg
Open new console (the third one), change to folder c_project
and compile the project:
make
Then load the created ELF file into the simulation via GDB:
riscv64-unknown-elf-gdb -tui -ex 'set remotetimeout 15' -ex 'target remote :3333' -ex 'load' -ex 'break main' -ex 'continue' main
Set some more breakpoints b <line>
and step through the code with c
(continue). You will see the UART output in console 1 (vexriscv sim).