sysprog21 / rv32emu

Compact and Efficient RISC-V RV32I[MAFC] emulator
MIT License
349 stars 87 forks source link

Compare with libriscv #288

Open jserv opened 7 months ago

jserv commented 7 months ago

libriscv is a compact yet comprehensive RISC-V userspace emulator library crafted for effortless embedding and extensive adaptability. It boasts a high-performing interpreter and an experimental binary translator, driven by TinyCC. When binary translation is activated, libtcc seamlessly integrates into the RISC-V emulator, taking on the role of the compiler for binary translation.

Interestingly, both libriscv and rv32emu share some common concepts and objectives. It would be valuable to engage in a comparative analysis to explore aspects such as interpretation and binary translation performance, techniques for ensuring secure sandboxed execution, and strategies for implementing userspace RISC-V emulation.

Expected outcomes:

Reference:

jserv commented 6 months ago

Build libriscv and its command line interface.

$ git clone https://github.com/fwsGonzo/libriscv
$ cd libriscv/emulator
$ ./build.sh

Since libriscv relies on latest C++ features, recent clang might be required. Consider the following changes:

Use rvlinux to execute ELF files.

It is important to comprehend the reasons behind libriscv's superior performance compared to rv32emu in pure interpreter mode.