Added an extra unit test test_trace1
authorShriya Sharma <shriya@redsemiconductor.com>
Wed, 18 Oct 2023 14:32:36 +0000 (15:32 +0100)
committerShriya Sharma <shriya@redsemiconductor.com>
Wed, 18 Oct 2023 14:32:36 +0000 (15:32 +0100)
src/openpower/cyclemodel/inorder.py

index c4bcc3b2abb89bc1adb07e6448c0e691d0959868..2da84bcdc0d751b71c30049e2e7543e02344bbe6 100644 (file)
@@ -374,6 +374,20 @@ class TestTrace(unittest.TestCase):
             #print(trace)
             basic_cpu.process_instructions(trace)
 
+    def test_trace1(self): # TODO, assert this is valid
+        basic_cpu = CPU()
+
+        lines = (
+            "r:GPR:0:0:64 w:GPR:1:0:64              # addi 1, 0, 0x0010",
+            "r:GPR:1:0:64 w:GPR:2:0:64              # addi 2, 1, 0x1234",
+        )
+        f = io.StringIO("\n".join(lines))
+        lines = read_file(f)
+        basic_cpu.print_headings()
+        for trace in lines:
+            #print(trace)
+            basic_cpu.process_instructions(trace)
+
 def help():
     print ("-t             runs unit tests")
     print ("-h --help      prints this message")