@@ -197,8 +197,9 @@ interface uvma_rvfi_instr_if_t
197
197
198
198
199
199
// -------------------------------------------------------------------
200
- // Local variables
200
+ // Signals
201
201
// -------------------------------------------------------------------
202
+
202
203
int unsigned irq_cnt; // number of taken interrupts
203
204
int unsigned nmi_instr_cnt; // number of instructions after nmi
204
205
int unsigned single_step_cnt; // number of instructions stepped
@@ -275,6 +276,10 @@ interface uvma_rvfi_instr_if_t
275
276
276
277
asm_t instr_asm;
277
278
279
+ wire is_exception_cause_instr_acc_fault = (rvfi_trap.exception_cause == EXC_CAUSE_INSTR_ACC_FAULT );
280
+ wire is_exception_cause_integrity_fault = (rvfi_trap.exception_cause == EXC_CAUSE_INSTR_INTEGRITY_FAULT );
281
+ wire is_exception_cause_bus_fault = (rvfi_trap.exception_cause == EXC_CAUSE_INSTR_BUS_FAULT );
282
+
278
283
// -------------------------------------------------------------------
279
284
// Begin module code
280
285
// -------------------------------------------------------------------
@@ -335,7 +340,7 @@ interface uvma_rvfi_instr_if_t
335
340
end
336
341
337
342
always_comb begin
338
- is_mret = is_mret_f ( );
343
+ is_mret = match_instr ( INSTR_OPCODE_MRET , INSTR_MASK_FULL );
339
344
end
340
345
341
346
always_comb begin
@@ -437,7 +442,14 @@ interface uvma_rvfi_instr_if_t
437
442
end
438
443
439
444
always_comb begin
440
- is_instr_bus_valid = is_instr_bus_valid_f ();
445
+ is_instr_bus_valid = (
446
+ (
447
+ ! is_exception_cause_bus_fault &&
448
+ ! is_exception_cause_integrity_fault &&
449
+ ! is_exception_cause_instr_acc_fault
450
+ ) ||
451
+ rvfi_trap.clicptr
452
+ );
441
453
end
442
454
443
455
always_comb begin
@@ -623,6 +635,7 @@ interface uvma_rvfi_instr_if_t
623
635
624
636
modport passive_mp (clocking mon_cb);
625
637
638
+
626
639
// -------------------------------------------------------------------
627
640
// Functions
628
641
// -------------------------------------------------------------------
@@ -637,9 +650,11 @@ interface uvma_rvfi_instr_if_t
637
650
logic [ XLEN - 1 : 0 ] instr_ref,
638
651
logic [ XLEN - 1 : 0 ] instr_mask
639
652
);
640
-
641
- return rvfi_valid && is_instr_bus_valid && ((rvfi_insn & instr_mask) == instr_ref);
642
-
653
+ return (
654
+ rvfi_valid &&
655
+ is_instr_bus_valid &&
656
+ ((rvfi_insn & instr_mask) == instr_ref)
657
+ );
643
658
endfunction : match_instr
644
659
645
660
// Check if instruction is of a certain type, without verifying the instr word is valid
@@ -841,10 +856,6 @@ function automatic logic is_dret_f();
841
856
return match_instr (INSTR_OPCODE_DRET , INSTR_MASK_FULL );
842
857
endfunction : is_dret_f
843
858
844
- function automatic logic is_mret_f ();
845
- return match_instr (INSTR_OPCODE_MRET , INSTR_MASK_FULL );
846
- endfunction : is_mret_f
847
-
848
859
function automatic logic is_uret_f ();
849
860
return match_instr (INSTR_OPCODE_URET , INSTR_MASK_FULL );
850
861
endfunction : is_uret_f
@@ -967,13 +978,6 @@ function automatic logic is_pma_fault_f();
967
978
(rvfi_trap.cause_type == 'h 0 );
968
979
endfunction : is_pma_fault_f
969
980
970
- function automatic logic is_instr_bus_valid_f ();
971
- return ! ( (rvfi_trap.exception_cause == EXC_CAUSE_INSTR_ACC_FAULT ) ||
972
- (rvfi_trap.exception_cause == EXC_CAUSE_INSTR_INTEGRITY_FAULT ) ||
973
- (rvfi_trap.exception_cause == EXC_CAUSE_INSTR_BUS_FAULT )
974
- );
975
- endfunction : is_instr_bus_valid_f
976
-
977
981
function automatic logic [31 : 0 ] rvfi_mem_addr_word0highbyte_f ();
978
982
logic [31 : 0 ] addr = rvfi_mem_addr[31 : 0 ];
979
983
case (1 )
0 commit comments