1 # See LICENSE for license details.
3 #*****************************************************************************
5 #-----------------------------------------------------------------------------
7 # Test breakpoints, if they are implemented.
10 #include "riscv_test.h"
11 #include "test_macros.h"
16 # Set up breakpoint to trap on M-mode fetches.
19 # Skip tdrselect is hard-wired.
20 li t0, 1<<(_RISCV_SZLONG-1)
25 # Make sure there's a breakpoint there.
27 srli t0, t0, _RISCV_SZLONG-4
33 li t0, BPCONTROL_M | BPCONTROL_X
35 # Skip if breakpoint type is unsupported.
40 # Trap handler should skip this instruction.
43 # Make sure reads don't trap.
48 # Set up breakpoint to trap on M-mode reads.
50 li t0, BPCONTROL_M | BPCONTROL_R
52 # Skip if breakpoint type is unsupported.
59 # Trap handler should skip this instruction.
63 # Make sure writes don't trap.
68 # Set up breakpoint to trap on M-mode stores.
70 li t0, BPCONTROL_M | BPCONTROL_W
72 # Skip if breakpoint type is unsupported.
77 # Trap handler should skip this instruction.
80 # Make sure store didn't succeed.
89 # Only even-numbered tests should trap.
93 li a0, CAUSE_BREAKPOINT