Some time ago I made (in VHDL) a rather stupid processor with very limited instruction set which I called pico-CPU. You can find it under pico_CPU folder in pico-CPU repository on github. The point back then was to make something for a course ( the course was called Digital Systems Modeling and Synthesis).
Later on i started making a pipeline version of the pico-CPU. This one is also available under pico_CPU_pipelined folder in the same repo. however, soon I learnt that I have no idea how to make a compiler for it and honestly writing machine-code for the damn thing is no fun! so its kind of working but I left it to rot there! Also some of the data-hazards are not fixed yet.
Moving on, I started implementing MIPS-32 version 2. It is accessible in the folder pico_CPU_pipelined_MIPS32. Anyways, I started from what I had! meaning my dear pico_CPU_pipelined. Trying to make it compatible to MIPS32 instructions. Soon enough I figured out that my processor was accumulator based, meaning that I had single port register file and was re-using ACC for everything. My bad! Time to change the design.
After changing the RegFile from single port to dual port, I implemented 38 of the Instructions and solved a bunch of hazards:
- RFile read2write (in case of Load from memory)
- Injecting bubbles in the pipe in case of branch and jump
still a lot to do… lets see if i can get it done before end of the week.
Before I finish this post, I want to stress that using TYPEs made my life so much easier. Debugging is so much more straightforward. I will use it everywhere I can!