From 5c762ad41c16e7f1e2850a2b766ab5e7027255fe Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 12 Mar 2024 11:17:50 +1300 Subject: [PATCH] Pre-format conditional flags in write_btor Make `-x` flag dependent on `btor_aig on`, and combine with `-c` flag into single `btor_flags` string. --- sbysrc/sby_core.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sbysrc/sby_core.py b/sbysrc/sby_core.py index c56fe63f..e6802610 100644 --- a/sbysrc/sby_core.py +++ b/sbysrc/sby_core.py @@ -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,