From: Tim Newsome Date: Fri, 10 Jun 2016 17:45:27 +0000 (-0700) Subject: Add simple register tests. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6ccc0bdde5eea898e88961f49e755bd2b4577792;p=riscv-tests.git Add simple register tests. Make the RegsTest case a bit more comprehensible. --- diff --git a/debug/gdbserver.py b/debug/gdbserver.py index 163b136..27c3ad4 100755 --- a/debug/gdbserver.py +++ b/debug/gdbserver.py @@ -39,7 +39,45 @@ class DeleteServer(unittest.TestCase): def tearDown(self): del self.server -class MemoryTest(DeleteServer): +class SimpleRegisterTest(DeleteServer): + def setUp(self): + self.server = target.server() + self.gdb = testlib.Gdb() + self.gdb.command("target extended-remote localhost:%d" % self.server.port) + + # 0x13 is nop + self.gdb.command("p *((int*) 0x%x)=0x13" % target.ram) + self.gdb.command("p *((int*) 0x%x)=0x13" % (target.ram + 4)) + self.gdb.command("p *((int*) 0x%x)=0x13" % (target.ram + 8)) + self.gdb.p("$pc=0x%x" % target.ram) + + def check_reg(self, name): + a = random.randrange(1<