- Pascal 88.5%
- Shell 11%
- Batchfile 0.5%
| assets | ||
| bin | ||
| metadata | ||
| src | ||
| .gitattributes | ||
| .gitignore | ||
| gitcommitpush | ||
| gitcommitpush.bat | ||
| gitforceupdate | ||
| gitforceupdate.bat | ||
| LICENSE | ||
| README.md | ||
Important
The primary repository has moved to git.rosseaux.net/BeRo1985/pasriscvemu. This GitHub repository is kept up-to-date via push mirroring.
pasriscvemu
This is the PasVulkan-based emulator frontend for the PasRISCV RV64GC RISCV-V emulator.
Getting Started
Prerequisites
You need to have the following installed:
- FreePascal (unstable dev version) + Lazarus or a recent version of Embarcadero Delphi
- PasVulkan with all its dependencies and submodules (which includes PasRISCV and PasTerm already)
Setup
Clone this pasriscemu repository with all submodules into the projects directory of the PasVulkan repository:
cd /path/to/pasvulkan/projects
git clone --recurse-submodules https://github.com/BeRo1985/pasriscvemu.git
But not other way around, because the pasriscvemu repository is dependent on the PasVulkan repository, because of relative paths in the project files. PasVulkan itself has already submodules for PasRISCV and PasTerm, which are also needed by pasriscvemu, where PasRISCV is the actual RISCV-V emulator core and PasTerm is the terminal emulator for the serial console when the framebuffer isn't currently active.
Building
Just open the pasriscvemu.lpi in Lazarus or 'pasriscvemu.dproj' in Delphi and compile it. The executable will be in the bin directory.
Running
Just run the pasriscvemu executable in the bin directory. Otherwise look below for the command line options.
Command Line Options
| Command Line | Default | Description |
|---|---|---|
| -gdb [port] | Enable GDB remote debugging on specified port | |
| -debug | Enable local debugging | |
| -no-debug | Disable local debugging | |
| -smp [cpucores] | 2 |
Number of CPU cores to emulate |
| -memory [ram] | 2GiB |
Amount of RAM to emulate |
| -bios [filename] | fw_jump.bin |
Filename of the BIOS firmware image |
| -kernel [filename] | kernel.bin |
Filename of the kernel image |
| -no-kernel | Do not load a kernel image | |
| -initrd [filename] | Filename of the initial ramdisk image | |
| -no-initrd | Do not load an initial ramdisk image | |
| -virtioblock [filename] | Filename of the VirtIO block device image | |
| -no-virtioblock | Do not load a VirtIO block device image | |
| -nvme [filename] | Filename of the NVMe block device image | |
| -no-nvme | Do not load a NVMe block device image | |
| -bootargs [bootparams] | root=/dev/mem rw earlyprintk console=$LINUXUART$ console=tty0 earlycon=sbi |
Boot arguments for the kernel |
| -aia | Enable Advanced Interrupt Architecture (AIA) | |
| -no-aia | Disable Advanced Interrupt Architecture (AIA) | |
| -display [mode] | simplefb |
Display mode: simplefb, virtiogpu, bochsvbe, or cirrus |
| -rtc [mode] | goldfish |
RTC mode: goldfish, ds1742, ds1307, or virtio |
| -i2c [mode] | designware |
I2C mode: opencores (or oc), designware (or dw) |
| -soundmode [mode] | virtio |
Sound mode: virtio, fm801, cmi8738 (also cmipci, cmi), hda |
| -natnet | Use userland NAT networking backend for VirtIO Net (default, no root/TAP needed) | |
| -tunnet | Use TUN/TAP networking backend for VirtIO Net (requires a TUN/TAP device) | |
| -nonet | Use isolated network mode: guest gets DHCP/ARP/ICMP locally, but no external access | |
| -no-ipv6 | Disable IPv6 NAT (ICMPv6/UDPv6/TCPv6 and router advertisements are suppressed) | |
| -ipv6 | Enable IPv6 NAT (default) | |
| -hostfwd [spec] | Add a NAT port forward (requires -natnet). Format: tcp|udp::hostport-[guestip]:guestport, e.g. -hostfwd tcp::2222-:22. Can be repeated. |
|
| -centered | Center the monitor on the screen (default) | |
| -no-centered | Do not center the monitor on the screen (default) | |
| -centertonearestpixel | Center the monitor to the nearest pixel (no fractional offset) | |
| -no-centertonearestpixel | Do not center the monitor to the nearest pixel (default) | |
| -scaled | Scale the monitor to fit the window (default) | |
| -no-scaled | Do not scale the monitor to fit the window | |
| -scaletonearest | Scale the monitor to fit the window in integer steps | |
| -no-scaletonearest | Do not scale the monitor to fit the window in integer steps (default) |
Keys
CTRL+F12 toggles between the framebuffer and the serial console.
FAQ
Why is the emulator not a part of the PasRISCV repository itself?
Because pasriscvemu is just a PasVulkan-based frontend for the PasRISCV emulator core, which is a standalone library and can be used in other projects as well.
Why is the emulator not a part of the PasVulkan repository itself?
Because pasriscvemu is a separate project and not directly related to Vulkan, but it uses PasVulkan as a frontend for the framebuffer output. But PasVulkan maybe get a dependency on PasRISCV in the future, for example for cross-platform "scripting" purposes and so on, but not the other way around. So PasVulkan has already submodules for PasRISCV and PasTerm, which are also needed by pasriscvemu.
Related repositories
- PasVulkan - PasVulkan itself
- PasRISCV - The RISCV-V emulator core
- PasTerm - The terminal emulator for the serial console
- PasMP - A parallel-processing/multi-processing library for Object Pascal
- RNL - RNL - Realtime Network Library - The opensource reliable UDP network library, including cryptography, which is used by PasRISCV for various purposes
- And more at here
Support
Creating is my passion, and with your support, I can keep it alive. Support my work and help me continue innovating. Every contribution makes a difference: You can donate and support me here. Thank you!
License
This project is licensed under the zlib License - see the LICENSE file for details.