3 ms·
As well as very slow verilog RTL emulation, pk is also used to allow you to run standard User-mode RISC-V binaries with many kinds of systems call in them on:
by brucehoult 6y ago
As well as very slow verilog RTL emulation, pk is also used to allow you to run standard User-mode RISC-V binaries with many kinds of systems call in them on:
- software emulators
- cores implemented in an FPGA
- prototype chips
Whatever it is, you only have to implement the CPU core, some RAM, and some sort of two-way communications channel -- whether a pipe, UART, USB Serial, ethernet or WIFI.
On the other end of the communications channel you run riscv-fesvr (Front End SerVeR)
pk traps systems calls, serializes the arguments, send them to fesvr. fesvr unpacks the arguments, makes the system call on the host Linux machine, serializes the results, and sends them back to the RISC-V core running in that FPGA or prototype chip or Verilator or whatever.
So your test programs get to use not only printf() but also navigate the host filesystem, open files, get the time etc etc.
A proper Linux Kernel on the system under test would require megabytes of RAM, various I/O devices etc.
pk requires only a few kb of RAM and a communications channel.