File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -221,14 +221,15 @@ def test(self):
221221
222222class SimpleNoExistTest (GdbTest ):
223223 def test (self ):
224+ nonexist_csr = self .hart .nonexist_csr
224225 try :
225- self .gdb .p ("$csr2288 " )
226- assert False , "Reading csr2288 should have failed"
226+ self .gdb .p (f"$ { nonexist_csr } " )
227+ assert False , f "Reading the $ { nonexist_csr } should have failed"
227228 except testlib .CouldNotFetch :
228229 pass
229230 try :
230- self .gdb .p ("$csr2288 =5" )
231- assert False , "Writing csr2288 should have failed"
231+ self .gdb .p (f"$ { nonexist_csr } =5" )
232+ assert False , f "Writing the $ { nonexist_csr } should have failed"
232233 except testlib .CouldNotFetch :
233234 pass
234235
Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ class Hart:
3333 # no device mapped to that location.
3434 bad_address = None
3535
36+ # The non-existent register for access test
37+ nonexist_csr = "csr2288"
38+
3639 # Number of instruction triggers the hart supports.
3740 instruction_hardware_breakpoint_count = 0
3841
You can’t perform that action at this time.
0 commit comments