Added shamt to the deconstruction of the instruction

This commit is contained in:
Ibrahim 2020-11-30 13:50:04 +00:00 committed by GitHub
parent 02f3f1cbba
commit 954a5b47aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,7 +40,8 @@ logic[5:0] opcode = instr_readdata[31:26];
logic[4:0] rs = instr_readdata[25:21];
logic[4:0] rt = instr_readdata[20:16];
logic[4:0] rd = RegDst==2'b10 ? 5'b11111 : RegDst==2'b01 ? instr_readdata[15:11] : instr_readdata[20:16];
logic[15:0] immediate = instr_readdata[15:0];
logic[10:6] shamt = instr_readdata[10:6]; // Shamt needed for the sll instruction
//ALU Data
logic[31:0] alu_in1 = read_data1;
@ -95,4 +96,4 @@ alu alu(
.zero(ALUZero), //is the result zero, used for checks
.out(ALUOut) //output/result of operation
);
endmodule : mips_cpu_harvard
endmodule : mips_cpu_harvard