Skip to main content

RPython-based emulator speeds up RISC-V simulation over 15x

In cooperation with RISC-V International, who funded a part of this project, we recently created a workflow to use RPython to take a Sail RISC-V model and automatically create a RISC-V ISA emulator from it, which we call Pydrofoil. The simulator sped up booting a linux emulator from 35 minutes (using the standard Sail-generated emulator in C) to 2 minutes, a speedup of 17.5x. More details about the process are in the RISC-V blog post.

A few take-aways from the project:

  • While PyPy has shown it can speed up generic python code about 4x, the technology behind PyPy can really shine in other areas.

  • RPython is malleable and can be molded to many tasks, the RPython meta-JIT is very flexible.

  • A JIT is well-suited for the problem of emulation, because it can perform dynamic binary translation.

PyPy can solve real world performance problems, even somewhat unusual ones. Please get in touch and let us know how we can help you solve yours!