Skip to content

Simulator

varkenvarken edited this page Feb 10, 2020 · 4 revisions

The Simulator allows you to run an executable file (*.bin) in software emulation instead of on the iCEbreaker.

Its behavior should be bit for bit compatible with the actual cpu implementation.

This allows for easier debugging because with the simulator we can perform single stepping and set breakpoints but once we verify that the simulator behaves just like the actual hardware we can automate regression test for the compiler and assembler and have them run as part of a commit action on GitHub.

This will not guarantee that the hardware is functioning properly but will at least verify whether changes in the compiler or assembler would break something.

The idea is then to have continuous integration (CI) in the form of GitHub actions that are triggered on every push. These actions will be performed for several small libraries in the libc folder, each consisting of:

  • compilation of the relevant C source code
  • assembly of the resulting .s files into executable *.bin files
  • execution of these *.bin files with the simulator
  • verification of this output

Because we now have implemented print() as well as itoa() and ftoa() we can have our test programs produce meaningful output that can easily be verified, i.e. we don't have to resort to inspecting registers or memory locations.

Clone this wiki locally