Skip to content

Commit

Permalink
Add yowasp-sby binary.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Jul 11, 2020
1 parent a7f0a2f commit 047e0b0
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
path = yosys-src
url = https://github.com/YosysHQ/yosys
branch = master
[submodule "SymbiYosys-src"]
path = SymbiYosys-src
url = https://github.com/YosysHQ/SymbiYosys
1 change: 1 addition & 0 deletions SymbiYosys-src
Submodule SymbiYosys-src added at 9ed384
3 changes: 3 additions & 0 deletions package-pypi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ cp -r \
yosys-build/yosys.wasm \
yosys-build/share \
yosys-src/backends/smt2/smtbmc.py \
SymbiYosys-src/sbysrc/sby.py \
pypi/yowasp_yosys/
cp SymbiYosys-src/sbysrc/sby_*.py \
pypi/yowasp_yosys/share/python3

cd pypi
${PYTHON} setup.py bdist_wheel
Expand Down
1 change: 1 addition & 0 deletions pypi/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ __pycache__/
/dist
/yowasp_yosys/share
/yowasp_yosys/smtbmc.py
/yowasp_yosys/sby.py
1 change: 1 addition & 0 deletions pypi/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def long_description():
"console_scripts": [
"yowasp-yosys = yowasp_yosys:_run_yosys_argv",
"yowasp-yosys-smtbmc = yowasp_yosys:_run_yosys_smtbmc_argv",
"yowasp-sby = yowasp_yosys:_run_sby_argv",
],
},
project_urls={
Expand Down
9 changes: 9 additions & 0 deletions pypi/yowasp_yosys/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,12 @@ def _run_yosys_smtbmc_argv():
with open(smtbmc_py) as f:
globals = {}
exec(compile(f.read(), smtbmc_py, "exec"), globals, globals)


def _run_sby_argv():
prefix = importlib_resources.files(__package__)
sys.path.append(str(prefix / "share" / "python3"))
sby_py = prefix / "sby.py"
with open(sby_py) as f:
globals = {}
exec(compile(f.read(), sby_py, "exec"), globals, globals)

0 comments on commit 047e0b0

Please sign in to comment.