move mul pipe ilang test to separate file
authorJacob Lifshay <programmerjake@gmail.com>
Fri, 9 Oct 2020 00:45:32 +0000 (17:45 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Fri, 9 Oct 2020 00:45:32 +0000 (17:45 -0700)
src/soc/fu/mul/test/test_pipe_caller.py
src/soc/fu/mul/test/test_pipe_ilang.py [new file with mode: 0644]

index 8742ef7f7a2cfc5a07df605f12ec06958b5af25b..756d10f4fe94f5b1486673cf6532e8aebd4f18e8 100644 (file)
@@ -171,16 +171,9 @@ class MulTestCase(TestAccumulatorBase):
         initial_regs[2] = 0x0000000000000002
         self.add_case(Program(lst, bigendian), initial_regs)
 
-# TODO add test case for these 3 operand cases (madd
-# needs to be implemented)
-# "maddhd","maddhdu","maddld"
-
-    def case_ilang(self):
-        pspec = MulPipeSpec(id_wid=2)
-        alu = MulBasePipe(pspec)
-        vl = rtlil.convert(alu, ports=alu.ports())
-        with open("mul_pipeline.il", "w") as f:
-            f.write(vl)
+    # TODO add test case for these 3 operand cases (madd
+    # needs to be implemented)
+    # "maddhd","maddhdu","maddld"
 
 
 class TestRunner(unittest.TestCase):
diff --git a/src/soc/fu/mul/test/test_pipe_ilang.py b/src/soc/fu/mul/test/test_pipe_ilang.py
new file mode 100644 (file)
index 0000000..22af35b
--- /dev/null
@@ -0,0 +1,20 @@
+import unittest
+from nmigen.cli import rtlil
+from soc.fu.mul.pipe_data import MulPipeSpec
+from soc.fu.mul.pipeline import MulBasePipe
+
+
+class TestPipeIlang(unittest.TestCase):
+    def write_ilang(self):
+        pspec = MulPipeSpec(id_wid=2)
+        alu = MulBasePipe(pspec)
+        vl = rtlil.convert(alu, ports=alu.ports())
+        with open("mul_pipeline.il", "w") as f:
+            f.write(vl)
+
+    def test_ilang(self):
+        self.write_ilang()
+
+
+if __name__ == "__main__":
+    unittest.main()