Add a PROGRAM_PREFIX= Makefile option for packages with prefixed Yosys.
authorwhitequark <whitequark@whitequark.org>
Sat, 11 Jul 2020 05:28:19 +0000 (05:28 +0000)
committerwhitequark <whitequark@whitequark.org>
Sat, 22 Aug 2020 14:45:47 +0000 (14:45 +0000)
Makefile
sbysrc/sby_core.py

index 790170be8598d40a5452e32b42d20602fbb0147d..8f19bd5eff4e9b1d63e1e6ced8b5331bd63c27f2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
 
 DESTDIR =
 PREFIX = /usr/local
+PROGRAM_PREFIX =
 
 # On Windows, manually setting absolute path to Python binary may be required
 # for launcher executable to work. From MSYS2, this can be done using the
@@ -28,6 +29,7 @@ install:
        mkdir -p $(DESTDIR)$(PREFIX)/bin
        mkdir -p $(DESTDIR)$(PREFIX)/share/yosys/python3
        cp sbysrc/sby_*.py $(DESTDIR)$(PREFIX)/share/yosys/python3/
+       sed -e 's|##yosys-program-prefix##|"'$(PROGRAM_PREFIX)'"|' -i $(DESTDIR)$(PREFIX)/share/yosys/python3/sby_core.py
 ifeq ($(OS), Windows_NT)
        sed -e 's|##yosys-sys-path##|sys.path += [os.path.dirname(__file__) + p for p in ["/share/python3", "/../share/yosys/python3"]]|;' \
                -e "s|#!/usr/bin/env python3|#!$(PYTHON)|" < sbysrc/sby.py > $(DESTDIR)$(PREFIX)/bin/sby-script.py
index a23ebf09385e1fd81d7c50deacb6b88afccb35a6..bf1b66ebb749affb8bf925949e089df2aa42664d 100644 (file)
@@ -220,10 +220,11 @@ class SbyJob:
         self.total_time = 0
         self.expect = []
 
+        yosys_program_prefix = "" ##yosys-program-prefix##
         self.exe_paths = {
-            "yosys": os.getenv("YOSYS", "yosys"),
-            "abc": os.getenv("ABC", "yosys-abc"),
-            "smtbmc": os.getenv("SMTBMC", "yosys-smtbmc"),
+            "yosys": os.getenv("YOSYS", yosys_program_prefix + "yosys"),
+            "abc": os.getenv("ABC", yosys_program_prefix + "yosys-abc"),
+            "smtbmc": os.getenv("SMTBMC", yosys_program_prefix + "yosys-smtbmc"),
             "suprove": os.getenv("SUPROVE", "suprove"),
             "aigbmc": os.getenv("AIGBMC", "aigbmc"),
             "avy": os.getenv("AVY", "avy"),