You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
883 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. # vexriscv_mem_mapped_example
  2. ### Tools:
  3. Use the Virtual Machine 1.5 from:
  4. [https://random-oracles.org/risc-v/](https://random-oracles.org/risc-v/)
  5. ### Starting the Vexriscv Simulation
  6. Open console, change to folder `vexriscv` and run
  7. ```
  8. sbt "runMain mupq.PQVexRiscvSim"
  9. ```
  10. ### Connecting openocd-vexriscv
  11. Open new console, change to folder `vexriscv` and run
  12. ```
  13. openocd-vexriscv -f vexriscvsim.cfg
  14. ```
  15. ### Compile and run the C code
  16. Open new console (the third one), change to folder `c_project` and compile the project:
  17. ```
  18. make
  19. ```
  20. Then load the created ELF file into the simulation via GDB:
  21. ```
  22. riscv64-unknown-elf-gdb -tui -ex 'set remotetimeout 15' -ex 'target remote :3333' -ex 'load' -ex 'break main' -ex 'continue' main
  23. ```
  24. 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).