bcrafton / processor

A compiler, assembler, and processor.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This project is currently on pause because I have started graduate school
I am not sure if I will come back to it
The latest code are on branches ooo, ooo1, ooo2.

Compiler - Assembler - Processor

This repository implements a compiler, assembler and a processor.

Compiler

OCaml.
Most of code taken from Northeastern compilers course.
Compiles to x86.

Assembler

Ocaml.
Coverts x86 to a RISC ISA and assembles to binary.

Processor

Verilog.
Implements a RISC ISA capable of running all instructions generated by assembler.

Test Bench

C - Verilog Programming Interface.
Simulates instruction memory, data memory, and registers.
Runs through different types of tests:

  1. Binary tests - binary code. and checks to make sure main memory and registers are the same as expected
  2. Assembly Tests - x86 assembly code. tests only the final result in eax.
  3. Code Tests - abstract code. tests only the final result in eax.

Running the code

There is a dependency script that may or may not work for getting the dependencies.
Once these are acquired, the makefile can be run which will compile all four modules and run the test bench.

Future Features

  1. Super scalar πŸ‘
  2. Performance metrics (branch misses, IPC, instruction histograms, stalls) πŸ‘
  3. Branch predictor πŸ‘
  4. Compiler - Tuples πŸ‘
  5. Emulator πŸ‘
  6. Instruction Logs πŸ‘
  7. Out of order
  8. Memory simulator (cache / memory heirarchy with random latency)
  9. Combining instruction memory and data memory

About

A compiler, assembler, and processor.


Languages

Language:OCaml 37.8%Language:Verilog 35.1%Language:C 22.1%Language:SystemVerilog 2.1%Language:Standard ML 1.3%Language:Makefile 0.9%Language:Assembly 0.7%