Add option to specify solver in nmigen.test.utils
authorDonald Sebastian Leung <dl@m-labs.hk>
Wed, 19 Aug 2020 03:49:55 +0000 (11:49 +0800)
committerSébastien Bourdeauducq <sb@m-labs.hk>
Wed, 19 Aug 2020 04:21:24 +0000 (12:21 +0800)
nmigen/test/utils.py

index c3907ce8b920a1231228961d471fb7d9f858f205..41241275d31d1634e6c781781c853a3088d4e3b6 100644 (file)
@@ -53,7 +53,7 @@ class FHDLTestCase(unittest.TestCase):
         if msg is not None:
             self.assertEqual(str(warns[0].message), msg)
 
-    def assertFormal(self, spec, mode="bmc", depth=1):
+    def assertFormal(self, spec, mode="bmc", depth=1, engine="smtbmc"):
         caller, *_ = traceback.extract_stack(limit=2)
         spec_root, _ = os.path.splitext(caller.filename)
         spec_dir = os.path.dirname(spec_root)
@@ -80,7 +80,7 @@ class FHDLTestCase(unittest.TestCase):
         wait on
 
         [engines]
-        smtbmc
+        {engine}
 
         [script]
         read_ilang top.il
@@ -92,6 +92,7 @@ class FHDLTestCase(unittest.TestCase):
         """).format(
             mode=mode,
             depth=depth,
+            engine=engine,
             script=script,
             rtlil=rtlil.convert(Fragment.get(spec, platform="formal"))
         )