Merge pull request #195 from jix/sbyproc-truncated-output
[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, engine in task.engine_list():
28 assert len(engine) > 0
29
30 task.log(f"""engine_{engine_idx}: {" ".join(engine)}""")
31 task.makedirs(f"{task.workdir}/engine_{engine_idx}")
32
33 if engine[0] == "smtbmc":
34 import sby_engine_smtbmc
35 sby_engine_smtbmc.run("bmc", task, engine_idx, engine)
36
37 elif engine[0] == "abc":
38 import sby_engine_abc
39 sby_engine_abc.run("bmc", task, engine_idx, engine)
40
41 elif engine[0] == "aiger":
42 import sby_engine_aiger
43 sby_engine_aiger.run("bmc", task, engine_idx, engine)
44
45 elif engine[0] == "btor":
46 import sby_engine_btor
47 sby_engine_btor.run("bmc", task, engine_idx, engine)
48
49 else:
50 task.error(f"Invalid engine '{engine[0]}' for bmc mode.")