Skip to content

cpuex2019-7th/simulator

Repository files navigation

Simulator & Disassembler

RISC-V (rv32im) Simulator & Disassmbler.

How to use

You can use this simulator by the following commands:

make install
cpuex_sim <filename of RISC-V executable>

If you'd like to execute step by step, the following command will help you:

make install
cpuex_sim <filename of RISC-V executable> --debug

If you want to disassemble the binary, you can do it with following commands.

make install
cpuex_disasm <filename of RISC-V executable> # quietly
cpuex_disasm <filename of RISC-V executable> -v # verbosely

When you have symbol information cpuex_asm omits, you can use it as follows.

make install
cpuex_disasm <filename of RISC-V executable> --symbols <.symbols file> -vv

Test

make
./test.sh

Options

  • -i: the file given to UART input
  • -o: the file written by UART output
  • --debug, --info
    • You can set debugging level.
  • --strict
    • if this directive is set, this simulator quits when any errors occur.
  • --symbols <filename>
    • if this directive is set, this simulator use it as a hint of function definition(s).
  • --statout <filename>
    • if this directive is set, this simulator outputs statistics of the simulation at the end of execution.

Debugger

  • i b: list of debugger
  • d num: remove a specified breakpoint
  • b label <offset>: add breakpoint

About

Unprivileged rv32imf simulator written in C.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages