Skip to content

Commit

Permalink
Make the non-existent csr configurable
Browse files Browse the repository at this point in the history
Signed-off-by: liangzhen <[email protected]>
  • Loading branch information
lz-bro committed Oct 16, 2023
1 parent c36c814 commit 6548464
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 5 additions & 4 deletions debug/gdbserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,15 @@ def test(self):

class SimpleNoExistTest(GdbTest):
def test(self):
nonexist_csr = self.hart.nonexist_csr
try:
self.gdb.p("$csr2288")
assert False, "Reading csr2288 should have failed"
self.gdb.p(f"${nonexist_csr}")
assert False, "Reading the non-existent csr should have failed"
except testlib.CouldNotFetch:
pass
try:
self.gdb.p("$csr2288=5")
assert False, "Writing csr2288 should have failed"
self.gdb.p(f"${nonexist_csr}=5")
assert False, "Writing the non-existent csr should have failed"
except testlib.CouldNotFetch:
pass

Expand Down
3 changes: 3 additions & 0 deletions debug/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class Hart:
# no device mapped to that location.
bad_address = None

# The non-existent register for access test
nonexist_csr = "csr2288"

# Number of instruction triggers the hart supports.
instruction_hardware_breakpoint_count = 0

Expand Down

0 comments on commit 6548464

Please sign in to comment.