Skip to content

Commit

Permalink
Pre-format conditional flags in write_btor
Browse files Browse the repository at this point in the history
Make `-x` flag dependent on `btor_aig on`, and combine with `-c` flag into single `btor_flags` string.
  • Loading branch information
KrystalDelusion committed Mar 11, 2024
1 parent 022fa0e commit 5c762ad
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sbysrc/sby_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1137,9 +1137,11 @@ def instance_hierarchy_error_callback(retcode):
print("delete -output", file=f)
print("dffunmap", file=f)
print("stat", file=f)
#TODO: put -x in a conditional
print("write_btor -x {}-i design_{m}.info -ywmap design_btor.ywb design_{m}.btor".format("-c " if self.opt_mode == "cover" else "", m=model_name), file=f)
print("write_btor -s {}-i design_{m}_single.info -ywmap design_btor_single.ywb design_{m}_single.btor".format("-c " if self.opt_mode == "cover" else "", m=model_name), file=f)
btor_flags = ""
if self.opt_mode == "cover": btor_flags += "-c "
if self.opt_btor_aig: btor_flags += "-x "
print("write_btor {}-i design_{m}.info -ywmap design_btor.ywb design_{m}.btor".format(btor_flags, m=model_name), file=f)
print("write_btor -s {}-i design_{m}_single.info -ywmap design_btor_single.ywb design_{m}_single.btor".format(btor_flags, m=model_name), file=f)

proc = SbyProc(
self,
Expand Down

0 comments on commit 5c762ad

Please sign in to comment.