💻 A 5-stage pipeline MIPS CPU design in Haskell.
A functional MIPS CPU simulator implemented in Haskell.
A year ago, I implemented a RISC-V simulator in C++. I had long dreamed of using a functional programming language to express the circuit of a CPU. But at that time, implementing lazy-evalution in C++ is slow and painful. So the semester in Computer Architecture course, I made this MIPS simulator.
As functional programming language works well in expressing this hardware circuit logic, I'm implementing A MIPS CPU, just by directly translating Haskell into Verilog.
All CPU and CPU simulators I've made are listed below.
Technique | Implementation | |
---|---|---|
RISC-V v1 | 5-stage pipeline simulator | C++ |
RISC-V v2 | dynamic scheduling simulator Tomasulo + Speculation |
C++ |
MIPS | 5-stage pipeline simulator | Haskell |
MIPS | 5-stage pipeline CPU | Verilog |
Currently I haven't implemented a command-line interface for interacting with this simulator. You can only run tests or hack it yourself for now.
Install Stack and simply run:
stack test