I made this as the final course project of my “Digital Electronics” course.
The CPU executes any instruction in one single cycle and uses separate memory for program and heap. I spent a lot of time thinking and designing the logic of the “control unit”(decodes the instruction and generates control signals for the ALU, Register File, Immediate Extractor, and Data Memory) … because I wanted to.
I used the book Digital Design & Computer Architecture RISC-V Edition for sanity check and I highly recommend this to someone who is looking to learn about this stuff.
Overview
- Given a RV32I compliant machine code
"program.hex"file it generates a waveform for the CPU execution. - Uses Verilator to simulate the processor behaviour when running the program, this is fast as verilator compiles the sim to a c++ file which runs as a binary.
- The waveform generated can be seen using another open-source tool GTKWave