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 17, 2023
1 parent c36c814 commit 57544c2
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, f"Reading the ${nonexist_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, f"Writing the ${nonexist_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 57544c2

Please sign in to comment.