The CPU circuit is itself designed in Digital. https://github.com/hneemann/Digital
View The CPU in action: https://www.youtube.com/watch?v=BqX9-EcepF0
The compiler is written in Python,which exports the final binary in hexes. The writing of hexes is done by IntelHex python library.
Python Formatting:black
Files: | Description |
---|---|
code_generator.py |
The original compiler. |
code_generator_v2.py |
The original compiler modified with some OOP approach.It introduces the following two files. |
register.py |
Software implementation of hardware register. |
constants.py |
Constants required for the new compiler. |
custom_code.txt |
This is where our programs are written. |
code.hex |
This is the final file generated by compiler,which contains the instructions for CPU to execute. |
data.hex |
This is another final file used by the CPU.This contains additional operands required for the main instructions. |
CPU_With_Registers.dig |
The main CPU circuit.This file is opened with Digital. |
Intermediate Files.
Files: | Description |
---|---|
simplified_code.txt |
The first pass of compiler output. |
generated_code.txt |
The final pass of compiler output.This file is then written as hexes. |
However both compilers above produce same binary. V2 compiler(code_generator_v2) introduces two files(register and constants),while V1 compiler is a single file implementation.