2 # SymbiYosys (sby) -- Front-end for Yosys-based formal verification flows
4 # Copyright (C) 2016 Claire Xenia Wolf <claire@yosyshq.com>
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.
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.
20 from sby_core
import SbyProc
23 task
.handle_int_option("depth", 20)
24 task
.handle_int_option("append", 0)
25 task
.handle_str_option("aigsmt", "yices")
27 for engine_idx
in range(len(task
.engines
)):
28 engine
= task
.engines
[engine_idx
]
29 assert len(engine
) > 0
31 task
.log(f
"""engine_{engine_idx}: {" ".join(engine)}""")
32 task
.makedirs(f
"{task.workdir}/engine_{engine_idx}")
34 if engine
[0] == "smtbmc":
35 import sby_engine_smtbmc
36 sby_engine_smtbmc
.run("bmc", task
, engine_idx
, engine
)
38 elif engine
[0] == "abc":
40 sby_engine_abc
.run("bmc", task
, engine_idx
, engine
)
42 elif engine
[0] == "aiger":
43 import sby_engine_aiger
44 sby_engine_aiger
.run("bmc", task
, engine_idx
, engine
)
46 elif engine
[0] == "btor":
47 import sby_engine_btor
48 sby_engine_btor
.run("bmc", task
, engine_idx
, engine
)
51 task
.error(f
"Invalid engine '{engine[0]}' for bmc mode.")