Move test case parameters to an "operation" member function
authorCesar Strauss <cestrauss@gmail.com>
Wed, 27 May 2020 10:06:37 +0000 (07:06 -0300)
committerCesar Strauss <cestrauss@gmail.com>
Wed, 27 May 2020 10:09:06 +0000 (07:09 -0300)
This allows running several operation cases in succession, without needing
to restart the processes, losing state and trace history.

I expect the need to synchronize the processes for each new operation.

src/soc/experiment/compalu_multi.py

index ec07a64e1ef9ea8ebaa26d6a5a305520318ce21c..913dd8e5b1c8f30d6d400e9182f950ca47408dec 100644 (file)
@@ -379,10 +379,7 @@ def test_compunit():
 
 
 class CompUnitParallelTest:
-    def __init__(self, dut,
-        # TODO add a, b, expected_o, and other parameters such as imm_mode, zero
-        # operand etc.
-            ):
+    def __init__(self, dut):
         self.dut = dut
 
         # Operation cycle should not take longer than this:
@@ -393,9 +390,15 @@ class CompUnitParallelTest:
         self.MIN_BUSY_LOW = 5
 
     def driver(self):
-
         print("Begin parallel test.")
+        yield from self.operation()
+
+    # TODO add a, b, expected_o, and other parameters such as imm_mode, zero
+    # operand etc.
+    def operation(self):
+        yield from self.issue()
 
+    def issue(self):
         # issue_i starts inactive
         yield self.dut.issue_i.eq(0)