From 00fd30f5ecab23f17fee9dcfec21ea32f9eff5bc Mon Sep 17 00:00:00 2001 From: Shriya Sharma Date: Wed, 18 Oct 2023 15:32:36 +0100 Subject: [PATCH] Added an extra unit test test_trace1 --- src/openpower/cyclemodel/inorder.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/openpower/cyclemodel/inorder.py b/src/openpower/cyclemodel/inorder.py index c4bcc3b2..2da84bcd 100644 --- a/src/openpower/cyclemodel/inorder.py +++ b/src/openpower/cyclemodel/inorder.py @@ -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") -- 2.30.2