Skip to content

Commit

Permalink
Add mul, iCache bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
willson0v0 committed Aug 4, 2020
1 parent 69d9939 commit 71aad58
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
20 changes: 20 additions & 0 deletions source/sources_1/new/decode.sv
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,26 @@ module decode(
uOP1.dstwe = `TRUE;
uOP1.valid = `TRUE;
end
`MUL: begin
uOP0.uOP = MULTHI_U;
uOP0.rs_type = RS_MDU;
uOP0.op0LAddr = rs;
uOP0.op1LAddr = rt;
uOP0.dstLAddr = 0; // discard high 32
uOP0.op0re = `TRUE;
uOP0.op1re = `TRUE;
uOP0.dstwe = `FALSE;

uOP1.uOP = MULTLO_U;
uOP1.rs_type = RS_MDU;
uOP1.op0LAddr = rs;
uOP1.op1LAddr = rt;
uOP1.dstLAddr = rd;
uOP1.op0re = `TRUE;
uOP1.op1re = `TRUE;
uOP1.dstwe = `TRUE;
uOP1.valid = `TRUE;
end
`AND: begin
uOP0.uOP = AND_U;
uOP0.rs_type = RS_ALU;
Expand Down
1 change: 1 addition & 0 deletions source/sources_1/new/defines/defines.svh
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ typedef logic [5:0] ARFNum; // 逻辑寄存器编号(共34个)
`define DIVU 32'b000000??_????????_00000000_00011011
`define MULT 32'b000000??_????????_00000000_00011000
`define MULTU 32'b000000??_????????_00000000_00011001
`define MUL 32'b011100??_????????_?????000_00000010

// logical
`define AND 32'b000000??_????????_?????000_00100100
Expand Down
2 changes: 1 addition & 1 deletion source/sources_1/new/ifu/ICache.sv
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ module ICache(
if(rst) begin
nxtState = sReset;
end else if(flush) begin
nxtState = sRunning;
nxtState = sIdle;
end else if(!ctrl_iCache.pause) begin
nxtState = sRunning;
end else begin
Expand Down

0 comments on commit 71aad58

Please sign in to comment.