Skip to content

Commit

Permalink
btor2aiger: Install btor2aig_yw
Browse files Browse the repository at this point in the history
Install alongside SBY.
Add env helper to python source.
Fix hardcoded path in `sby_core.py`.
  • Loading branch information
KrystalDelusion committed Mar 12, 2024
1 parent fcf9f9e commit 49750a9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ else
sed 's|##yosys-sys-path##|sys.path += [os.path.dirname(__file__) + p for p in ["/share/python3", "/../share/yosys/python3"]]|;' < sbysrc/sby.py > $(DESTDIR)$(PREFIX)/bin/sby
chmod +x $(DESTDIR)$(PREFIX)/bin/sby
endif
cp tools/btor2aig_yw/btor2aig_yw.py $(DESTDIR)$(PREFIX)/bin/btor2aig_yw
chmod +x $(DESTDIR)$(PREFIX)/bin/btor2aig_yw

.PHONY: check_cad_suite run_ci

Expand Down
4 changes: 1 addition & 3 deletions sbysrc/sby_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,14 +1154,12 @@ def instance_hierarchy_error_callback(retcode):
return [proc]

if model_name == "aig" and self.opt_btor_aig:
#TODO: aiw2yw doesn't know what to do with the latches
btor_model = "btor_nomem"
proc = SbyProc(
self,
"btor_aig",
self.model(btor_model),
#TODO: fix hardcoded path
f"cd {self.workdir}/model; python3 ~/sby/tools/btor2aig_yw/btor2aig_yw.py design_{btor_model}.btor"
f"cd {self.workdir}/model; btor2aig_yw design_{btor_model}.btor"
)
proc.checkretcode = True

Expand Down
1 change: 1 addition & 0 deletions tools/btor2aig_yw/btor2aig_yw.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
from __future__ import annotations

import argparse
Expand Down

0 comments on commit 49750a9

Please sign in to comment.