add SVSTATE to TestCase infrastructure for use in TestIssuer
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 12 Feb 2021 15:23:05 +0000 (15:23 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 12 Feb 2021 15:23:05 +0000 (15:23 +0000)
src/soc/fu/test/common.py
src/soc/simple/test/test_issuer.py

index 6489f5a0d6e35aa5125f288cd309368e49ecdbdd..c21ebd7f776ef7397ebecca6249f3536ec8fc2ee 100644 (file)
@@ -100,13 +100,15 @@ class TestAccumulatorBase:
 
     def add_case(self, prog, initial_regs=None, initial_sprs=None,
                  initial_cr=0, initial_msr=0,
-                 initial_mem=None):
+                 initial_mem=None,
+                 initial_svstate=0):
 
         test_name = inspect.stack()[1][3]  # name of caller of this function
         tc = TestCase(prog, test_name,
                       regs=initial_regs, sprs=initial_sprs, cr=initial_cr,
                       msr=initial_msr,
-                      mem=initial_mem)
+                      mem=initial_mem,
+                      svstate=initial_svstate)
 
         self.test_data.append(tc)
 
@@ -115,7 +117,8 @@ class TestCase:
     def __init__(self, program, name, regs=None, sprs=None, cr=0, mem=None,
                  msr=0,
                  do_sim=True,
-                 extra_break_addr=None):
+                 extra_break_addr=None,
+                 svstate=0):
 
         self.program = program
         self.name = name
@@ -133,6 +136,7 @@ class TestCase:
         self.msr = msr
         self.do_sim = do_sim
         self.extra_break_addr = extra_break_addr
+        self.svstate = svstate
 
 
 class ALUHelpers:
index 78662579eee2a079c92c23e00ed110a654460028..4cb3bc0b849e0683ab7e59271856edfe649418d9 100644 (file)
@@ -214,7 +214,8 @@ class TestRunner(FHDLTestCase):
                           test.msr,
                           initial_insns=gen, respect_pc=True,
                           disassembly=insncode,
-                          bigendian=bigendian)
+                          bigendian=bigendian,
+                          initial_svstate=test.svstate)
 
                 pc = 0  # start address
                 counter = 0  # test to pause/start