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
lbinstruction. It is an I-type instruction which is the same aslwbut it stores the first byte seen on the given address. The Opcode for this instruction is100000. - Implementing the
jrinstruction. This instruction loads the$rainto$pc. It's anr-typeinstruction. The Opcode and funct for this instruction in order are000000and001000. - Implementing the
jalrinstruction.
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.