@@ -32,7 +32,7 @@ always_comb begin
3232 `RV32_LUI_OP, `RV32_AUIPC_OP,
3333 `RV32_JAL_OP, `RV32_JALR_OP,
3434 `RV32_LOAD, `RV32_OP,
35- `RV32_OP_IMM, `RV32_AMO_OP, `RV32_FLWADD_OP : begin
35+ `RV32_OP_IMM, `RV32_AMO_OP: begin
3636 decode_o.write_rd = 1'b1 ;
3737 end
3838 `RV32_OP_FP: begin
@@ -41,6 +41,10 @@ always_comb begin
4141 | ((instruction_i.funct7 == `RV32_FCLASS_S_FUN7) & (instruction_i.rs2 == 5'b00000 )) // FCLASS, FMV.X.W
4242 | ((instruction_i.funct7 == `RV32_FCVT_S_F2I_FUN7)); // FCVT.W.S, FCVT.WU.S
4343 end
44+ `RV32_LOAD_FP: begin
45+ // flwadd
46+ decode_o.write_rd = (instruction_i.funct7 == 7'b0000000 ) & (instruction_i.funct3 == 3'b111 );
47+ end
4448 `RV32_SYSTEM: begin
4549 decode_o.write_rd = 1'b1 ; // CSRRW, CSRRS
4650 end
@@ -57,15 +61,15 @@ always_comb begin
5761 `RV32_JALR_OP, `RV32_BRANCH,
5862 `RV32_LOAD, `RV32_STORE,
5963 `RV32_OP, `RV32_OP_IMM,
60- `RV32_AMO_OP, `RV32_FLWADD_OP : begin
64+ `RV32_AMO_OP: begin
6165 decode_o.read_rs1 = 1'b1 ;
6266 end
6367 `RV32_OP_FP: begin
6468 decode_o.read_rs1 =
6569 (instruction_i.funct7 == `RV32_FCVT_S_I2F_FUN7) // FCVT.S.W, FCVT.S.WU
6670 | (instruction_i.funct7 == `RV32_FMV_W_X_FUN7); // FMV.W.X
6771 end
68- `RV32_LOAD_FP, `RV32_STORE_FP: begin // FLW, FSW
72+ `RV32_LOAD_FP, `RV32_STORE_FP: begin // FLW, FSW, FLWADD
6973 decode_o.read_rs1 = 1'b1 ;
7074 end
7175 `RV32_SYSTEM: begin
8791// declares if Op reads from second port of integer register file
8892always_comb begin
8993 unique casez (instruction_i.op)
90- `RV32_BRANCH, `RV32_STORE, `RV32_OP, `RV32_FLWADD_OP : begin
94+ `RV32_BRANCH, `RV32_STORE, `RV32_OP: begin
9195 decode_o.read_rs2 = 1'b1 ;
9296 end
97+ `RV32_LOAD_FP: begin
98+ // flwadd
99+ decode_o.read_rs2 = (instruction_i.funct7 == 7'b0000000 ) & (instruction_i.funct3 == 3'b111 );
100+ end
93101 `RV32_AMO_OP: begin
94102 // According the ISA, LR instruction don't read rs2
95103 decode_o.read_rs2 = (instruction_i.funct7 == ? 7'b00001 ??) // amoswap
@@ -103,7 +111,7 @@ always_comb begin
103111end
104112
105113// Load & Store
106- assign decode_o.is_flwadd_op = (instruction_i.op == `RV32_FLWADD_OP );
114+ assign decode_o.is_flwadd_op = (instruction_i == ? `RV32_FLWADD );
107115assign decode_o.is_load_op = (instruction_i.op == `RV32_LOAD) | (instruction_i.op == `RV32_LOAD_FP);
108116assign decode_o.is_store_op = (instruction_i.op == `RV32_STORE) | (instruction_i.op == `RV32_STORE_FP);
109117
0 commit comments