Fix handling of the .sby file directory when running in the current dir
authorMichael Nolan <mtnolan2640@gmail.com>
Tue, 28 Jan 2020 22:05:25 +0000 (17:05 -0500)
committerMichael Nolan <mtnolan2640@gmail.com>
Tue, 28 Jan 2020 22:05:25 +0000 (17:05 -0500)
src/ieee754/fpmax/formal/proof_fmax_mod.py

index 24554bc5c31b7f0d114f173b2b84c262ce5811d4..37538315efd46f20a6bac18e9b4ee4a0fb7dd54a 100644 (file)
@@ -104,8 +104,9 @@ def run_test(bits=32):
     il = rtlil.convert(m, ports=m.ports())
     with open("proof.il", "w") as f:
         f.write(il)
-    dirs = os.path.split(__file__)[0]
-    p = subprocess.Popen(['sby', '-f', '%s/proof.sby' % dirs],
+    filedir = os.path.dirname(os.path.realpath(__file__))
+    sbyfile = os.path.join(filedir, 'proof.sby')
+    p = subprocess.Popen(['sby', '-f', sbyfile],
                          stdout=subprocess.PIPE,
                          stderr=subprocess.PIPE)
     if p.wait() == 0: