projects
/
riscv-tests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cacfb9a
)
Don't arm breakpoint before setting break address
author
Andrew Waterman
<waterman@cs.berkeley.edu>
Thu, 9 Jun 2016 03:51:41 +0000
(20:51 -0700)
committer
Andrew Waterman
<waterman@cs.berkeley.edu>
Thu, 9 Jun 2016 03:51:41 +0000
(20:51 -0700)
isa/rv64mi/breakpoint.S
patch
|
blob
|
history
diff --git
a/isa/rv64mi/breakpoint.S
b/isa/rv64mi/breakpoint.S
index 39d058b335fa279e718c41fa94b948d356b2070f..a0d87e5dbe7365f114de9b88e77bbb426df51ef8 100644
(file)
--- a/
isa/rv64mi/breakpoint.S
+++ b/
isa/rv64mi/breakpoint.S
@@
-16,20
+16,20
@@
RVTEST_CODE_BEGIN
# Set up breakpoint to trap on M-mode fetches.
li TESTNUM, 2
csrw tdrselect, x0
# Set up breakpoint to trap on M-mode fetches.
li TESTNUM, 2
csrw tdrselect, x0
+ la t2, 1f
+ csrw tdrdata2, t2
li t0, (BPCONTROL_MATCHCOND & (BPCONTROL_MATCHCOND>>1)) | BPCONTROL_M | BPCONTROL_X
csrw tdrdata1, t0
# Skip if breakpoint type is unsupported.
csrr t1, tdrdata1
bne t0, t1, 2f
li t0, (BPCONTROL_MATCHCOND & (BPCONTROL_MATCHCOND>>1)) | BPCONTROL_M | BPCONTROL_X
csrw tdrdata1, t0
# Skip if breakpoint type is unsupported.
csrr t1, tdrdata1
bne t0, t1, 2f
- la t0, 1f
- csrw tdrdata2, t0
1:
# Trap handler should skip this instruction.
j fail
# Make sure reads don't trap.
li TESTNUM, 3
1:
# Trap handler should skip this instruction.
j fail
# Make sure reads don't trap.
li TESTNUM, 3
- lw t0, (t
0
)
+ lw t0, (t
2
)
2:
# Set up breakpoint to trap on M-mode reads.
2:
# Set up breakpoint to trap on M-mode reads.
@@
-39,16
+39,16
@@
RVTEST_CODE_BEGIN
# Skip if breakpoint type is unsupported.
csrr t1, tdrdata1
bne t0, t1, 2f
# Skip if breakpoint type is unsupported.
csrr t1, tdrdata1
bne t0, t1, 2f
- la t
0
, write_data
- csrw tdrdata2, t
0
+ la t
2
, write_data
+ csrw tdrdata2, t
2
# Trap handler should skip this instruction.
# Trap handler should skip this instruction.
- lw t
0, (t0
)
- beqz t
0
, fail
+ lw t
2, (t2
)
+ beqz t
2
, fail
# Make sure writes don't trap.
li TESTNUM, 5
# Make sure writes don't trap.
li TESTNUM, 5
- sw x0, (t
0
)
+ sw x0, (t
2
)
2:
# Set up breakpoint to trap on M-mode stores.
2:
# Set up breakpoint to trap on M-mode stores.
@@
-60,13
+60,12
@@
RVTEST_CODE_BEGIN
bne t0, t1, 2f
# Trap handler should skip this instruction.
bne t0, t1, 2f
# Trap handler should skip this instruction.
- la t0, write_data
- sw t0, (t0)
+ sw t2, (t2)
# Make sure store didn't succeed.
li TESTNUM, 7
# Make sure store didn't succeed.
li TESTNUM, 7
- lw t
0, (t0
)
- bnez t
0
, fail
+ lw t
2, (t2
)
+ bnez t
2
, fail
2:
TEST_PASSFAIL
2:
TEST_PASSFAIL