Add initial value to npc, add JR to CtrlMemRead

This commit is contained in:
Aadi Desai 2020-12-17 08:43:58 -08:00
parent 1ae5d78b4d
commit 2be1978a36
3 changed files with 3 additions and 0 deletions

View file

@ -124,6 +124,8 @@ always @(*) begin
CtrlMemtoReg = 3'd3;//write data port of regfile is fed from ALUHi
end else if ((op==SPECIAL)&&(funct == MFLO))begin
CtrlMemtoReg = 3'd4;//write data port of regfile is fed from ALULo
end else if ((op==SPECIAL)&&(funct == JR))begin
CtrlMemRead = 0;//Read disabled during jump
end else begin CtrlMemRead = 1'bx;end//Not all instructions are encompassed so, added incase for debug purposes
$display("OP: %d, Funct: %d", op, funct);
//CtrlALUOp Logic

View file

@ -9,6 +9,7 @@ reg[31:0] npc_curr;
initial begin
npc_curr = (32'hBFC00000 + 32'd4);
npc_out = 32'hBFC00000;
end // initial
always_comb begin

0
test/test_mips_cpu_custom_bus.sh Normal file → Executable file
View file