Skip to content

Commit 28ee667

Browse files
btor2aiger: Use asserts and assumes from .ywb file
1 parent 49750a9 commit 28ee667

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

sbysrc/sby_core.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,7 @@ def instance_hierarchy_error_callback(retcode):
11591159
self,
11601160
"btor_aig",
11611161
self.model(btor_model),
1162-
f"cd {self.workdir}/model; btor2aig_yw design_{btor_model}.btor"
1162+
f"cd {self.workdir}/model; btor2aig_yw design_{btor_model}.btor design_btor.ywb"
11631163
)
11641164
proc.checkretcode = True
11651165

tools/btor2aig_yw/btor2aig_yw.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ def arg_parser():
1515
type=Path
1616
)
1717

18+
parser.add_argument(
19+
"ywb_file",
20+
type=Path
21+
)
22+
1823
parser.add_argument(
1924
"-d", "--dest",
2025
dest="dest",
@@ -118,15 +123,10 @@ async def main() -> None:
118123
data = await proc.stdout.readline()
119124
aimf.close()
120125

121-
# find assertions by looking for 'bad' statements in the btor
122-
with open(args.btor_file, mode='r') as f:
123-
data = f.readline()
124-
while data:
125-
if "bad" in data:
126-
m = re.match(r"^\d+ bad \d+ (\S+)", data)
127-
path = fix_path(m.group(1))
128-
ywa['asserts'].append(path)
129-
data = f.readline()
126+
with open(args.ywb_file, mode='r') as f:
127+
data = json.load(f)
128+
ywa['asserts'].extend(data['asserts'])
129+
ywa['assumes'].extend(data['assumes'])
130130

131131

132132
with open(work_dir / "design_aiger.ywa", mode="w") as f:

0 commit comments

Comments
 (0)