This code was finished mainly during my sophomore year within a week, which lacks a good coding style, especially in single
.
But the implementation of pipeline
is carefully verified by a series of test codes provided by TA.
There might still be some undetected bugs so feel free to come up with any issue.
You can run the code with machine code generated by programs in assembler
.
The DEBUGGER
module is used to debug the design with an explicit view of the Register, which should be commented out
if you like to synthesize or upload the design to an FPGA.
I build this project using iverilog
and view the wave file with gtkwave
. So below building guide will based on above tools.
To start, you have to run the assembler inside ./assembler
, to get the machinecode.txt
.
- Copy the
machinecode.txt
to./single
. - Change directory (cd) to
./single
. - Run
iverilog riscv_soc_tb.v -o riscv
to compile. - Run
vvp ./riscv
to run the code. You'll notice some outputs and the wave filewave.vcd
. - Use
gtkwave wave.vcd
to view the wave.
Pretty much the same as above.
- Copy the
machinecode.txt
to./pipeline
. - Change directory (cd) to
./pipeline
. - Run
iverilog riscv_soc_tb.v -o riscv
to compile. - Run
vvp ./riscv
to run the code. You'll notice some outputs and the wave filewave.vcd
. - Use
gtkwave wave.vcd
to view the wave.