Skip to content

Commit

Permalink
Issue #896 correction
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Gouedo <[email protected]>
  • Loading branch information
Pascal Gouedo committed Oct 25, 2023
1 parent ac4bb22 commit f88b1c6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
13 changes: 9 additions & 4 deletions rtl/cv32e40p_core.sv
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ module cv32e40p_core
logic [ C_RM-1:0] frm_csr;
logic [ C_FFLAG-1:0] fflags_csr;
logic fflags_we;
logic fregs_we;

// APU
logic apu_en_ex;
Expand Down Expand Up @@ -973,6 +974,7 @@ module cv32e40p_core
.frm_o (frm_csr),
.fflags_i (fflags_csr),
.fflags_we_i(fflags_we),
.fregs_we_i (fregs_we),

// Interrupt related control signals
.mie_bypass_o (mie_bypass),
Expand Down Expand Up @@ -1041,13 +1043,16 @@ module cv32e40p_core
);

// CSR access
assign csr_addr = csr_addr_int;
assign csr_wdata = alu_operand_a_ex;
assign csr_op = csr_op_ex;
assign csr_addr = csr_addr_int;
assign csr_wdata = alu_operand_a_ex;
assign csr_op = csr_op_ex;

assign csr_addr_int = csr_num_e'(csr_access_ex ? alu_operand_b_ex[11:0] : '0);


// Floating-Point registers write
assign fregs_we = (FPU & !ZFINX) ? ((regfile_alu_we_fw && regfile_alu_waddr_fw[5]) ||
(regfile_we_wb && regfile_waddr_fw_wb_o[5]))
: 1'b0;

///////////////////////////
// ____ __ __ ____ //
Expand Down
3 changes: 2 additions & 1 deletion rtl/cv32e40p_cs_registers.sv
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ module cv32e40p_cs_registers
output logic [ 2:0] frm_o,
input logic [C_FFLAG-1:0] fflags_i,
input logic fflags_we_i,
input logic fregs_we_i,

// Interrupts
output logic [31:0] mie_bypass_o,
Expand Down Expand Up @@ -1027,7 +1028,7 @@ module cv32e40p_cs_registers

if (ZFINX == 0) begin
// FPU Register File/Flags implicit update or modified by CSR instructions
if (fflags_we_i || fcsr_update) begin
if (fregs_we_i || fflags_we_i || fcsr_update) begin
mstatus_fs_n = FS_DIRTY;
end
end
Expand Down

0 comments on commit f88b1c6

Please sign in to comment.