Skip to content

RISC-V: Benchmark instruction details

Felix Puscasu requested to merge felix@bench-instr into master

What

Add benchmarking with the option to see statistics on a per instruction level.

Now benchmarks have a mode, e.g: risc-v-sanbox bench --mode fine --input ...

  • simple mode: It will run a binary from start to finish uninterrupted, leaving the interpreter the option to optimise and go fast (i.e. use interpreter.run(MAX_STEPS))
  • fine mode: It will run a binary instruction by instruction, enabling to generate per RISC-V instruction statistics. (i.e. interpreter.run(1) repeated until execution stops)

Why

When improving the interpreter, we should observe total performance improvements or instruction level performance impact.

How

Small reorganization in cli.rs to distinguish command options better.

Separate commits, suggest to view them!

Manually testing the MR

In src/risc_v directory:

make risc-v-sandbox

./risc-v-sandbox bench --input <riscv_binary> --mode simple

Try also the fine mode!

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Felix Puscasu

Merge request reports