Close

3.6) Emulator on PC

A project log for A2Z Computer

A computer invented, designed and built from scratch. Custom CPU on FPGA.

f4hdkf4hdk 11/18/2016 at 19:213 Comments

The emulator is very helpful tool to develop programs for A2Z, without downloading them to A2Z (which is slow). I can also develop programs with just a small laptop, when I am away from my electronic lab.

This emulator is also the easiest way to share my project, if somebody wants to play with it, without building the real hardware. It is available for download at the start page of the project (inside the ZIP file). The emulated flash memory is already loaded with all applications and data examples.

This is a “functional emulator”. It imitates the behaviour of the A2Z computer, but not the internal structure of the computer.

This part was much easier to code than I first expected.

The emulator is also coded in C, and uses the SFML library to acquire keyboard strokes, and to display the output graphic window. Therefore, the emulator should be easily ported to other platforms (Linux, Mac) with only small modifications.

The emulator imitates the speed of A2Z : it executes 52083 instructions every 16ms, and then waits until the end of the next 16ms period. This is equivalent to the 12.5MHz speed of the real CPU. I chose a 16ms step because it corresponds to the framerate of 60Hz : graphics are updated 60 times per second, like for VGA output.

Limitations:

User guide:

The best way to call the emulator is via command line. You can optionally put filenames as argument. Here is the behaviour:

During execution, you can use the following function keys:

Discussions

vitecd wrote 01/24/2017 at 09:56 point

ok. I'm just starting to dive with your project ) doesn't like to use compiled EXE )) more interesting to build "own one" and trying to understand how it works.

  Are you sure? yes | no

f4hdk wrote 01/24/2017 at 09:47 point

It is described here. 

https://hackaday.io/project/18206-a2z-computer/log/49046-31-software-development-tools

I use Visual C++ express 2013. Do you have trouble with the executable? Or with the source code?

  Are you sure? yes | no

vitecd wrote 01/24/2017 at 08:21 point

which compiler are you using to build this project?

  Are you sure? yes | no