mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-07 09:55:20 +00:00
Improvements in yosys-smtbmc
This commit is contained in:
parent
1d83854d84
commit
302166dd59
|
@ -631,6 +631,7 @@ struct Smt2Worker
|
||||||
for (auto it : decls)
|
for (auto it : decls)
|
||||||
f << it;
|
f << it;
|
||||||
|
|
||||||
|
f << stringf("; yosys-smt2-module %s\n", log_id(module));
|
||||||
f << stringf("(define-fun |%s_t| ((state |%s_s|) (next_state |%s_s|)) Bool ", log_id(module), log_id(module), log_id(module));
|
f << stringf("(define-fun |%s_t| ((state |%s_s|) (next_state |%s_s|)) Bool ", log_id(module), log_id(module), log_id(module));
|
||||||
if (GetSize(trans) > 1) {
|
if (GetSize(trans) > 1) {
|
||||||
f << "(and\n";
|
f << "(and\n";
|
||||||
|
|
|
@ -26,7 +26,7 @@ num_steps = 20
|
||||||
vcdfile = None
|
vcdfile = None
|
||||||
tempind = False
|
tempind = False
|
||||||
assume_skipped = None
|
assume_skipped = None
|
||||||
topmod = "main"
|
topmod = None
|
||||||
so = smtopts()
|
so = smtopts()
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ yosys-smtbmc [options] <yosys_smt2_output>
|
||||||
instead of BMC run temporal induction
|
instead of BMC run temporal induction
|
||||||
|
|
||||||
-m <module_name>
|
-m <module_name>
|
||||||
name of the top module, default: main
|
name of the top module
|
||||||
""" + so.helpmsg())
|
""" + so.helpmsg())
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
@ -97,8 +97,12 @@ with open(args[0], "r") as f:
|
||||||
match = debug_nets_re.match(line)
|
match = debug_nets_re.match(line)
|
||||||
if match:
|
if match:
|
||||||
debug_nets.add(match.group(2))
|
debug_nets.add(match.group(2))
|
||||||
|
if line.startswith("; yosys-smt2-module") and topmod is None:
|
||||||
|
topmod = line.split()[2]
|
||||||
smt.write(line)
|
smt.write(line)
|
||||||
|
|
||||||
|
assert topmod is not None
|
||||||
|
|
||||||
|
|
||||||
def write_vcd_model(steps):
|
def write_vcd_model(steps):
|
||||||
print("%s Writing model to VCD file." % smt.timestamp())
|
print("%s Writing model to VCD file." % smt.timestamp())
|
||||||
|
|
|
@ -313,6 +313,7 @@ class mkvcd:
|
||||||
assert t >= self.t
|
assert t >= self.t
|
||||||
if t != self.t:
|
if t != self.t:
|
||||||
if self.t == -1:
|
if self.t == -1:
|
||||||
|
print("$var event 1 ! smt_clock $end", file=self.f)
|
||||||
for name in sorted(self.nets):
|
for name in sorted(self.nets):
|
||||||
key, width = self.nets[name]
|
key, width = self.nets[name]
|
||||||
print("$var wire %d %s %s $end" % (width, key, name), file=self.f)
|
print("$var wire %d %s %s $end" % (width, key, name), file=self.f)
|
||||||
|
@ -320,4 +321,5 @@ class mkvcd:
|
||||||
self.t = t
|
self.t = t
|
||||||
assert self.t >= 0
|
assert self.t >= 0
|
||||||
print("#%d" % self.t, file=self.f)
|
print("#%d" % self.t, file=self.f)
|
||||||
|
print("1!", file=self.f)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue