Skip to content

Commit ddf56b3

Browse files
committed
[dv] Add debug_mode to rvfi_ext
This indicates if debug mode was active when the instruction was executed in ID/EX.
1 parent abe1ab0 commit ddf56b3

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

rtl/ibex_core.sv

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ module ibex_core import ibex_pkg::*; #(
141141
output logic rvfi_ext_nmi,
142142
output logic rvfi_ext_nmi_int,
143143
output logic rvfi_ext_debug_req,
144+
output logic rvfi_ext_debug_mode,
144145
output logic rvfi_ext_rf_wr_suppress,
145146
output logic [63:0] rvfi_ext_mcycle,
146147
output logic [31:0] rvfi_ext_mhpmcounters [10],
@@ -1251,6 +1252,7 @@ module ibex_core import ibex_pkg::*; #(
12511252
logic rvfi_ext_stage_nmi [RVFI_STAGES+1];
12521253
logic rvfi_ext_stage_nmi_int [RVFI_STAGES+1];
12531254
logic rvfi_ext_stage_debug_req [RVFI_STAGES+1];
1255+
logic rvfi_ext_stage_debug_mode [RVFI_STAGES];
12541256
logic [63:0] rvfi_ext_stage_mcycle [RVFI_STAGES];
12551257
logic [31:0] rvfi_ext_stage_mhpmcounters [RVFI_STAGES][10];
12561258
logic [31:0] rvfi_ext_stage_mhpmcountersh [RVFI_STAGES][10];
@@ -1300,6 +1302,7 @@ module ibex_core import ibex_pkg::*; #(
13001302
assign rvfi_ext_nmi = rvfi_ext_stage_nmi [RVFI_STAGES];
13011303
assign rvfi_ext_nmi_int = rvfi_ext_stage_nmi_int [RVFI_STAGES];
13021304
assign rvfi_ext_debug_req = rvfi_ext_stage_debug_req [RVFI_STAGES];
1305+
assign rvfi_ext_debug_mode = rvfi_ext_stage_debug_mode [RVFI_STAGES-1];
13031306
assign rvfi_ext_mcycle = rvfi_ext_stage_mcycle [RVFI_STAGES-1];
13041307
assign rvfi_ext_mhpmcounters = rvfi_ext_stage_mhpmcounters [RVFI_STAGES-1];
13051308
assign rvfi_ext_mhpmcountersh = rvfi_ext_stage_mhpmcountersh [RVFI_STAGES-1];
@@ -1474,6 +1477,7 @@ module ibex_core import ibex_pkg::*; #(
14741477
rvfi_ext_stage_nmi[i+1] <= '0;
14751478
rvfi_ext_stage_nmi_int[i+1] <= '0;
14761479
rvfi_ext_stage_debug_req[i+1] <= '0;
1480+
rvfi_ext_stage_debug_mode[i] <= '0;
14771481
rvfi_ext_stage_mcycle[i] <= '0;
14781482
rvfi_ext_stage_mhpmcounters[i] <= '{10{'0}};
14791483
rvfi_ext_stage_mhpmcountersh[i] <= '{10{'0}};
@@ -1510,6 +1514,7 @@ module ibex_core import ibex_pkg::*; #(
15101514
rvfi_ext_stage_nmi[i+1] <= rvfi_ext_stage_nmi[i];
15111515
rvfi_ext_stage_nmi_int[i+1] <= rvfi_ext_stage_nmi_int[i];
15121516
rvfi_ext_stage_debug_req[i+1] <= rvfi_ext_stage_debug_req[i];
1517+
rvfi_ext_stage_debug_mode[i] <= debug_mode;
15131518
rvfi_ext_stage_mcycle[i] <= cs_registers_i.mcycle_counter_i.counter_val_o;
15141519
rvfi_ext_stage_ic_scr_key_valid[i] <= cs_registers_i.cpuctrlsts_ic_scr_key_valid_q;
15151520
// This is done this way because SystemVerilog does not support looping through
@@ -1553,6 +1558,7 @@ module ibex_core import ibex_pkg::*; #(
15531558
rvfi_ext_stage_nmi[i+1] <= rvfi_ext_stage_nmi[i];
15541559
rvfi_ext_stage_nmi_int[i+1] <= rvfi_ext_stage_nmi_int[i];
15551560
rvfi_ext_stage_debug_req[i+1] <= rvfi_ext_stage_debug_req[i];
1561+
rvfi_ext_stage_debug_mode[i] <= rvfi_ext_stage_debug_mode[i-1];
15561562
rvfi_ext_stage_mcycle[i] <= rvfi_ext_stage_mcycle[i-1];
15571563
rvfi_ext_stage_ic_scr_key_valid[i] <= rvfi_ext_stage_ic_scr_key_valid[i-1];
15581564
rvfi_ext_stage_mhpmcounters[i] <= rvfi_ext_stage_mhpmcounters[i-1];

rtl/ibex_lockstep.sv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ module ibex_lockstep import ibex_pkg::*; #(
431431
.rvfi_ext_nmi (),
432432
.rvfi_ext_nmi_int (),
433433
.rvfi_ext_debug_req (),
434+
.rvfi_ext_debug_mode (),
434435
.rvfi_ext_rf_wr_suppress (),
435436
.rvfi_ext_mcycle (),
436437
.rvfi_ext_mhpmcounters (),

rtl/ibex_top.sv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ module ibex_top import ibex_pkg::*; #(
120120
output logic rvfi_ext_nmi,
121121
output logic rvfi_ext_nmi_int,
122122
output logic rvfi_ext_debug_req,
123+
output logic rvfi_ext_debug_mode,
123124
output logic rvfi_ext_rf_wr_suppress,
124125
output logic [63:0] rvfi_ext_mcycle,
125126
output logic [31:0] rvfi_ext_mhpmcounters [10],
@@ -391,6 +392,7 @@ module ibex_top import ibex_pkg::*; #(
391392
.rvfi_ext_nmi,
392393
.rvfi_ext_nmi_int,
393394
.rvfi_ext_debug_req,
395+
.rvfi_ext_debug_mode,
394396
.rvfi_ext_rf_wr_suppress,
395397
.rvfi_ext_mcycle,
396398
.rvfi_ext_mhpmcounters,

rtl/ibex_top_tracing.sv

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ module ibex_top_tracing import ibex_pkg::*; #(
123123
logic rvfi_ext_nmi;
124124
logic rvfi_ext_nmi_int;
125125
logic rvfi_ext_debug_req;
126+
logic rvfi_ext_debug_mode;
126127
logic rvfi_ext_rf_wr_suppress;
127128
logic [63:0] rvfi_ext_mcycle;
128129

@@ -138,6 +139,7 @@ module ibex_top_tracing import ibex_pkg::*; #(
138139
logic unused_rvfi_ext_nmi;
139140
logic unused_rvfi_ext_nmi_int;
140141
logic unused_rvfi_ext_debug_req;
142+
logic unused_rvfi_ext_debug_mode;
141143
logic unused_rvfi_ext_rf_wr_suppress;
142144
logic [63:0] unused_rvfi_ext_mcycle;
143145
logic unused_rvfi_ext_ic_scr_key_valid;
@@ -148,6 +150,7 @@ module ibex_top_tracing import ibex_pkg::*; #(
148150
assign unused_rvfi_ext_nmi = rvfi_ext_nmi;
149151
assign unused_rvfi_ext_nmi_int = rvfi_ext_nmi_int;
150152
assign unused_rvfi_ext_debug_req = rvfi_ext_debug_req;
153+
assign unused_rvfi_ext_debug_mode = rvfi_ext_debug_mode;
151154
assign unused_rvfi_ext_rf_wr_suppress = rvfi_ext_rf_wr_suppress;
152155
assign unused_rvfi_ext_mcycle = rvfi_ext_mcycle;
153156
assign unused_perf_regs = rvfi_ext_mhpmcounters;
@@ -250,6 +253,7 @@ module ibex_top_tracing import ibex_pkg::*; #(
250253
.rvfi_ext_nmi,
251254
.rvfi_ext_nmi_int,
252255
.rvfi_ext_debug_req,
256+
.rvfi_ext_debug_mode,
253257
.rvfi_ext_rf_wr_suppress,
254258
.rvfi_ext_mcycle,
255259
.rvfi_ext_mhpmcounters,

0 commit comments

Comments
 (0)