An assembler and hardware-simulating virtual machine for my CPU microarchitecture.
It exists to test the robustness of the design of the electrical hardware (over at khoek/komputer), simulating buses (detecting collisions, etc.) and different hardware modules, so a much faster soft-implementation is possible. Rough tests show that the VM is about ~475x slower than bare metal, which given a 4.8GHz simulating CPU ends up about 5x faster than the planned hardware clock speed of 2MHz.
To build use make
in the repository root. Artefacts appear in bin
, the most interesting of which are; kasm
, the assembler; lib/libkcpu.a
, the main language spec/hardware spec/assembler library; and run_vm
, a stub which starts up the VM from this library.
There is a test suite for the VM/assembler combination, which is invoked with make test
.