call test_write_ilang only once - ends up being called 9 times otherwise
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 24 Jul 2020 13:05:53 +0000 (14:05 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 24 Jul 2020 13:05:53 +0000 (14:05 +0100)
src/soc/fu/div/test/runner.py

index 2513d8ecc1a6136ad2d33365a01dc8c26fff1ecf..a506c0a8ecd1071213539319552aef41507105c3 100644 (file)
@@ -72,21 +72,15 @@ class DivRunner(unittest.TestCase):
         self.test_data = test_data
         self.div_pipe_kind = div_pipe_kind
 
-    def write_ilang(self, div_pipe_kind):
-        pspec = DivPipeSpec(id_wid=2, div_pipe_kind=div_pipe_kind)
+    def write_ilang(self):
+        pspec = DivPipeSpec(id_wid=2, div_pipe_kind=self.div_pipe_kind)
         alu = DivBasePipe(pspec)
         vl = rtlil.convert(alu, ports=alu.ports())
         with open(f"div_pipeline_{div_pipe_kind.name}.il", "w") as f:
             f.write(vl)
 
-    def test_write_ilang_div_pipe_core(self):
-        self.write_ilang(DivPipeKind.DivPipeCore)
-
-    def test_write_ilang_fsm_div_core(self):
-        self.write_ilang(DivPipeKind.FSMDivCore)
-
-    def test_write_ilang_sim_only(self):
-        self.write_ilang(DivPipeKind.SimOnly)
+    def test_write_ilang(self):
+        self.write_ilang(self.div_pipe_kind)
 
     def run_all(self):
         # *sigh* this is a mess.  unit test gets added by code-walking