Skip to content

Commit

Permalink
Disable mmu after test translate
Browse files Browse the repository at this point in the history
Signed-off-by: liangzhen <[email protected]>
  • Loading branch information
lz-bro committed Jan 23, 2024
1 parent bd0a19c commit e7c9e77
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions debug/gdbserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1671,13 +1671,19 @@ def test_translation(self):
self.gdb.b("error")
self.gdb.b("handle_trap")
self.gdb.b("main:active")
satp=self.gdb.p("$satp")
mstatus=self.gdb.p("$mstatus")

output = self.gdb.c()
assertRegex(output, r"\bmain\b")
assertEqual(0xdeadbeef, self.gdb.p("physical[0]"))
assertEqual(0x55667788, self.gdb.p("physical[1]"))
assertEqual(0xdeadbeef, self.gdb.p("virtual[0]"))
assertEqual(0x55667788, self.gdb.p("virtual[1]"))

# disable mmu
self.gdb.p(f"$mstatus=$mstatus & ~0x20000")
self.gdb.p(f"$satp=0")

SATP_MODE_OFF = 0
SATP_MODE_SV32 = 1
Expand Down

0 comments on commit e7c9e77

Please sign in to comment.