Skip to content

Commit fbd070c

Browse files
committedJun 23, 2023
[dv] New directed test to cover some scenarios with U-mode execution
This directly stimulates cases where U-mode execution is attempted against locked regions (and a region with no permissions).
1 parent 4e17587 commit fbd070c

File tree

4 files changed

+448
-359
lines changed

4 files changed

+448
-359
lines changed
 

‎dv/uvm/core_ibex/directed_tests/custom_macros.h

+4
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@
113113
lw s1, 0(s2); \
114114
sw s1, 0(s2);
115115

116+
// This assumes a PMP access failure on the read and write where the handler
117+
// jumps back to the failing access in M mode. If the access succeeds it remains
118+
// in U mode and the second SWITCH_TO_U_MODE will trap (due to attempting a
119+
// write to mstatus).
116120
#define RW_ACCESSES_IN_U_MODE(pmp_addr, gran) \
117121
la s0, pmp_addr; \
118122
SWITCH_TO_U_MODE_LABEL(1f); \

0 commit comments

Comments
 (0)
Please sign in to comment.