Skip to content

Commit

Permalink
[dv] New directed test to cover some scenarios with U-mode execution
Browse files Browse the repository at this point in the history
This directly stimulates cases where U-mode execution is attempted
against locked regions (and a region with no permissions).
  • Loading branch information
GregAC committed Jun 23, 2023
1 parent 4e17587 commit fbd070c
Show file tree
Hide file tree
Showing 4 changed files with 448 additions and 359 deletions.
4 changes: 4 additions & 0 deletions dv/uvm/core_ibex/directed_tests/custom_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@
lw s1, 0(s2); \
sw s1, 0(s2);

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

0 comments on commit fbd070c

Please sign in to comment.