Skip to content

Commit 2e47d30

Browse files
Merge pull request #512 from Silabs-ArjanB/ArjanB_obs
Removed nmi_addr_i; removed USE_DEPRECATED_FEATURE_SET parameter
2 parents 26f7a35 + b561866 commit 2e47d30

9 files changed

+7
-34
lines changed

bhv/cv32e40x_wrapper.sv

+1-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ module cv32e40x_wrapper
8080
input logic [31:0] mhartid_i,
8181
input logic [3:0] mimpid_patch_i,
8282
input logic [31:0] dm_exception_addr_i,
83-
input logic [31:0] nmi_addr_i,
8483

8584
// Instruction memory interface
8685
output logic instr_req_o,
@@ -338,7 +337,7 @@ module cv32e40x_wrapper
338337
rvfi_sva(.irq_ack(core_i.irq_ack),
339338
.dbg_ack(core_i.dbg_ack),
340339
.ebreak_in_wb_i(core_i.controller_i.controller_fsm_i.ebreak_in_wb),
341-
.nmi_addr_i(core_i.nmi_addr_i),
340+
.mtvec_addr_i(core_i.mtvec_addr),
342341
.*);
343342

344343
`endif // `ifndef COREV_ASSERT_OFF

constraints/cv32e40x_core.sdc

-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ set early_input_ports [list \
141141
mhartid_i* \
142142
mimpid_i* \
143143
dm_exception_addr_i* \
144-
nmi_addr_i* \
145144
]
146145

147146
# RISC-V OBI Input ports

rtl/cv32e40x_controller.sv

-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
module cv32e40x_controller import cv32e40x_pkg::*;
3333
#(
34-
parameter bit USE_DEPRECATED_FEATURE_SET = 1, // todo: remove once related features are supported by iss
3534
parameter bit X_EXT = 0,
3635
parameter int unsigned REGFILE_NUM_READ_PORTS = 2,
3736
parameter bit SMCLIC = 0,
@@ -119,7 +118,6 @@ module cv32e40x_controller import cv32e40x_pkg::*;
119118
// Main FSM and debug FSM
120119
cv32e40x_controller_fsm
121120
#(
122-
.USE_DEPRECATED_FEATURE_SET (USE_DEPRECATED_FEATURE_SET),
123121
.X_EXT ( X_EXT ),
124122
.SMCLIC ( SMCLIC ),
125123
.SMCLIC_ID_WIDTH ( SMCLIC_ID_WIDTH )

rtl/cv32e40x_controller_fsm.sv

+1-6
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
module cv32e40x_controller_fsm import cv32e40x_pkg::*;
3333
#(
34-
parameter bit USE_DEPRECATED_FEATURE_SET = 1, // todo: remove once related features are supported by iss
3534
parameter bit X_EXT = 0,
3635
parameter bit SMCLIC = 0,
3736
parameter int SMCLIC_ID_WIDTH = 5
@@ -536,11 +535,7 @@ module cv32e40x_controller_fsm import cv32e40x_pkg::*;
536535

537536
ctrl_fsm_o.csr_save_cause = 1'b1;
538537
ctrl_fsm_o.csr_cause.irq = 1'b1;
539-
if (USE_DEPRECATED_FEATURE_SET) begin
540-
ctrl_fsm_o.csr_cause.exception_code = nmi_is_store_q ? DEPRECATED_INT_CAUSE_LSU_STORE_FAULT : DEPRECATED_INT_CAUSE_LSU_LOAD_FAULT;
541-
end else begin
542-
ctrl_fsm_o.csr_cause.exception_code = nmi_is_store_q ? INT_CAUSE_LSU_STORE_FAULT : INT_CAUSE_LSU_LOAD_FAULT;
543-
end
538+
ctrl_fsm_o.csr_cause.exception_code = nmi_is_store_q ? INT_CAUSE_LSU_STORE_FAULT : INT_CAUSE_LSU_LOAD_FAULT;
544539

545540
// Save pc from oldest valid instruction
546541
if (ex_wb_pipe_i.instr_valid) begin

rtl/cv32e40x_core.sv

-6
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ module cv32e40x_core import cv32e40x_pkg::*;
4545
parameter logic [31:0] X_MISA = 32'h00000000,
4646
parameter logic [1:0] X_ECS_XS = 2'b00,
4747
parameter bit ZC_EXT = 0, // todo: remove once fully implemented
48-
parameter bit USE_DEPRECATED_FEATURE_SET = 1, // todo: remove once related features are supported by iss
4948
parameter int NUM_MHPMCOUNTERS = 1,
5049
parameter bit SMCLIC = 0,
5150
parameter int SMCLIC_ID_WIDTH = 5,
@@ -67,7 +66,6 @@ module cv32e40x_core import cv32e40x_pkg::*;
6766
input logic [31:0] mhartid_i,
6867
input logic [3:0] mimpid_patch_i,
6968
input logic [31:0] dm_exception_addr_i,
70-
input logic [31:0] nmi_addr_i, // todo: remove once supported by verification
7169

7270
// Instruction memory interface
7371
output logic instr_req_o,
@@ -376,7 +374,6 @@ module cv32e40x_core import cv32e40x_pkg::*;
376374
//////////////////////////////////////////////////
377375
cv32e40x_if_stage
378376
#(
379-
.USE_DEPRECATED_FEATURE_SET (USE_DEPRECATED_FEATURE_SET),
380377
.A_EXT ( A_EXT ),
381378
.X_EXT ( X_EXT ),
382379
.X_ID_WIDTH ( X_ID_WIDTH ),
@@ -398,7 +395,6 @@ module cv32e40x_core import cv32e40x_pkg::*;
398395
.jump_target_id_i ( jump_target_id ), // Jump target address
399396
.mepc_i ( mepc ), // Exception PC (restore upon return from exception/interrupt)
400397
.mtvec_addr_i ( mtvec_addr ), // Exception/interrupt address (MSBs only)
401-
.nmi_addr_i ( nmi_addr_i ), // NMI address
402398
.mtvt_addr_i ( mtvt_addr ), // CLIC vector base
403399

404400
.m_c_obi_instr_if ( m_c_obi_instr_if ), // Instruction bus interface
@@ -655,7 +651,6 @@ module cv32e40x_core import cv32e40x_pkg::*;
655651

656652
cv32e40x_cs_registers
657653
#(
658-
.USE_DEPRECATED_FEATURE_SET (USE_DEPRECATED_FEATURE_SET),
659654
.A_EXT ( A_EXT ),
660655
.M_EXT ( M_EXT ),
661656
.X_EXT ( X_EXT ),
@@ -738,7 +733,6 @@ module cv32e40x_core import cv32e40x_pkg::*;
738733
////////////////////////////////////////////////////////////////////
739734
cv32e40x_controller
740735
#(
741-
.USE_DEPRECATED_FEATURE_SET (USE_DEPRECATED_FEATURE_SET),
742736
.X_EXT ( X_EXT ),
743737
.REGFILE_NUM_READ_PORTS ( REGFILE_NUM_READ_PORTS ),
744738
.SMCLIC ( SMCLIC ),

rtl/cv32e40x_cs_registers.sv

-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
module cv32e40x_cs_registers import cv32e40x_pkg::*;
3232
#(
33-
parameter bit USE_DEPRECATED_FEATURE_SET = 1, // todo: remove once related features are supported by iss
3433
parameter bit A_EXT = 0,
3534
parameter m_ext_e M_EXT = M,
3635
parameter bit X_EXT = 0,
@@ -580,10 +579,6 @@ module cv32e40x_cs_registers import cv32e40x_pkg::*;
580579
mstatus_we = 1'b0;
581580

582581
mtvec_n.addr = csr_mtvec_init_i ? mtvec_addr_i[31:7] : csr_wdata_int[31:7];
583-
if (USE_DEPRECATED_FEATURE_SET) begin
584-
mtvec_n.addr[7] = 1'b0; // todo : remove
585-
end
586-
587582
mtvec_n.zero0 = mtvec_q.zero0;
588583
mtvec_we = csr_mtvec_init_i;
589584

rtl/cv32e40x_if_stage.sv

+1-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
module cv32e40x_if_stage import cv32e40x_pkg::*;
3030
#(
31-
parameter bit USE_DEPRECATED_FEATURE_SET = 1, // todo: remove once related features are supported by iss
3231
parameter bit A_EXT = 0,
3332
parameter bit X_EXT = 0,
3433
parameter int X_ID_WIDTH = 4,
@@ -50,7 +49,6 @@ module cv32e40x_if_stage import cv32e40x_pkg::*;
5049
input logic [31:0] jump_target_id_i, // Jump target address
5150
input logic [31:0] mepc_i, // Exception PC (restore upon return from exception/interrupt)
5251
input logic [24:0] mtvec_addr_i, // Exception/interrupt address (MSBs)
53-
input logic [31:0] nmi_addr_i, // NMI address
5452

5553
input logic [MTVT_ADDR_WIDTH-1:0] mtvt_addr_i, // Base address for CLIC vectoring
5654

@@ -130,8 +128,7 @@ module cv32e40x_if_stage import cv32e40x_pkg::*;
130128
PC_TRAP_IRQ: branch_addr_n = {mtvec_addr_i, ctrl_fsm_i.mtvec_pc_mux, 2'b00}; // interrupts are vectored
131129
PC_TRAP_DBD: branch_addr_n = {dm_halt_addr_i[31:2], 2'b0};
132130
PC_TRAP_DBE: branch_addr_n = {dm_exception_addr_i[31:2], 2'b0};
133-
PC_TRAP_NMI: branch_addr_n = USE_DEPRECATED_FEATURE_SET ? {nmi_addr_i[31:2], 2'b00} :
134-
{mtvec_addr_i, NMI_MTVEC_INDEX, 2'b00};
131+
PC_TRAP_NMI: branch_addr_n = {mtvec_addr_i, NMI_MTVEC_INDEX, 2'b00};
135132
PC_TRAP_CLICV: branch_addr_n = {mtvt_addr_i, ctrl_fsm_i.mtvt_pc_mux[SMCLIC_ID_WIDTH-1:0], 2'b00};
136133
// CLIC spec requires to clear bit 0. This clearing is done in the alignment buffer.
137134
PC_TRAP_CLICV_TGT: branch_addr_n = if_id_pipe_o.instr.bus_resp.rdata;

rtl/include/cv32e40x_pkg.sv

-4
Original file line numberDiff line numberDiff line change
@@ -858,10 +858,6 @@ parameter EXC_CAUSE_INSTR_BUS_FAULT = 11'h30;
858858
parameter INT_CAUSE_LSU_LOAD_FAULT = 11'h400;
859859
parameter INT_CAUSE_LSU_STORE_FAULT = 11'h401;
860860

861-
// todo: remove once 11bit cause is supported by iss
862-
parameter DEPRECATED_INT_CAUSE_LSU_LOAD_FAULT = 11'h80;
863-
parameter DEPRECATED_INT_CAUSE_LSU_STORE_FAULT = 11'h81;
864-
865861
// Interrupt mask
866862
parameter IRQ_MASK = 32'hFFFF0888;
867863

sva/cv32e40x_rvfi_sva.sv

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module cv32e40x_rvfi_sva
4343
input logic [31:0] rvfi_csr_dcsr_rdata,
4444
input logic [31:0] rvfi_csr_mcause_rdata,
4545
input logic [31:0] rvfi_pc_rdata,
46-
input logic [31:0] nmi_addr_i,
46+
input logic [24:0] mtvec_addr_i,
4747
input logic [31:0] rvfi_csr_mie_rdata,
4848
input logic [31:0] rvfi_csr_mip_rdata,
4949
input logic irq_ack,
@@ -173,10 +173,10 @@ module cv32e40x_rvfi_sva
173173
// rvfi_intr should also be set.
174174
a_rvfi_nmip_nmi_handler:
175175
assert property (@(posedge clk_i) disable iff (!rst_ni)
176-
(no_debug && $stable(nmi_addr_i)) throughout s_goto_next_rvfi_valid(rvfi_csr_dcsr_rdata[3]) |->
176+
(no_debug && $stable(mtvec_addr_i)) throughout s_goto_next_rvfi_valid(rvfi_csr_dcsr_rdata[3]) |->
177177
rvfi_intr.intr &&
178-
(rvfi_pc_rdata == {nmi_addr_i[31:2], 2'b00}) &&
179-
((rvfi_csr_mcause_rdata[7:0] == INT_CAUSE_LSU_LOAD_FAULT) || (rvfi_csr_mcause_rdata[7:0] == INT_CAUSE_LSU_STORE_FAULT)))
178+
(rvfi_pc_rdata == {mtvec_addr_i, NMI_MTVEC_INDEX, 2'b00}) &&
179+
((rvfi_csr_mcause_rdata[10:0] == INT_CAUSE_LSU_LOAD_FAULT) || (rvfi_csr_mcause_rdata[10:0] == INT_CAUSE_LSU_STORE_FAULT)))
180180
else `uvm_error("rvfi", "dcsr.nmip not followed by rvfi_intr and NMI handler")
181181

182182
endmodule : cv32e40x_rvfi_sva

0 commit comments

Comments
 (0)