This code is taken from Digital Design and Computer Architecture by Harris and Harris.
Three changes are made to the code in this repo:
- Implementing the
lb
instruction. It is an I-type instruction which is the same aslw
but it stores the first byte seen on the given address. The Opcode for this instruction is100000
. - Implementing the
jr
instruction. This instruction loads the$ra
into$pc
. It's anr-type
instruction. The Opcode and funct for this instruction in order are000000
and001000
. - Implementing the
jalr
instruction.
There is a test bench file named testbench.sv
and a file memfile.dat
which holds the program to be tested. The assembly program which is equivalent of the machine codes written in memfile.dat
is in the file instructions.txt
. Consider reading testbench.sv
and instructions.txt
in order to figure out how the testing is going on.