mirror of
https://github.com/YosysHQ/sby.git
synced 2025-04-23 05:15:30 +00:00
btor2aiger: Use asserts and assumes from .ywb file
This commit is contained in:
parent
b68f68d26b
commit
c081a8a754
2 changed files with 10 additions and 10 deletions
|
@ -15,6 +15,11 @@ def arg_parser():
|
|||
type=Path
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"ywb_file",
|
||||
type=Path
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"-d", "--dest",
|
||||
dest="dest",
|
||||
|
@ -118,15 +123,10 @@ async def main() -> None:
|
|||
data = await proc.stdout.readline()
|
||||
aimf.close()
|
||||
|
||||
# find assertions by looking for 'bad' statements in the btor
|
||||
with open(args.btor_file, mode='r') as f:
|
||||
data = f.readline()
|
||||
while data:
|
||||
if "bad" in data:
|
||||
m = re.match(r"^\d+ bad \d+ (\S+)", data)
|
||||
path = fix_path(m.group(1))
|
||||
ywa['asserts'].append(path)
|
||||
data = f.readline()
|
||||
with open(args.ywb_file, mode='r') as f:
|
||||
data = json.load(f)
|
||||
ywa['asserts'].extend(data['asserts'])
|
||||
ywa['assumes'].extend(data['assumes'])
|
||||
|
||||
|
||||
with open(work_dir / "design_aiger.ywa", mode="w") as f:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue