aiger: check supported modes and aigbmc fixes
[SymbiYosys.git] / sbysrc / sby_mode_bmc.py
1 #
2 # SymbiYosys (sby) -- Front-end for Yosys-based formal verification flows
3 #
4 # Copyright (C) 2016 Claire Xenia Wolf <claire@yosyshq.com>
5 #
6 # Permission to use, copy, modify, and/or distribute this software for any
7 # purpose with or without fee is hereby granted, provided that the above
8 # copyright notice and this permission notice appear in all copies.
9 #
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #
18
19 import re, os, getopt
20 from sby_core import SbyProc
21
22 def run(task):
23 task.handle_int_option("depth", 20)
24 task.handle_int_option("append", 0)
25 task.handle_str_option("aigsmt", "yices")
26
27 for engine_idx in range(len(task.engines)):
28 engine = task.engines[engine_idx]
29 assert len(engine) > 0
30
31 task.log(f"""engine_{engine_idx}: {" ".join(engine)}""")
32 task.makedirs(f"{task.workdir}/engine_{engine_idx}")
33
34 if engine[0] == "smtbmc":
35 import sby_engine_smtbmc
36 sby_engine_smtbmc.run("bmc", task, engine_idx, engine)
37
38 elif engine[0] == "abc":
39 import sby_engine_abc
40 sby_engine_abc.run("bmc", task, engine_idx, engine)
41
42 elif engine[0] == "aiger":
43 import sby_engine_aiger
44 sby_engine_aiger.run("bmc", task, engine_idx, engine)
45
46 elif engine[0] == "btor":
47 import sby_engine_btor
48 sby_engine_btor.run("bmc", task, engine_idx, engine)
49
50 else:
51 task.error(f"Invalid engine '{engine[0]}' for bmc mode.")