diff options
author | Clifford Wolf <clifford@clifford.at> | 2016-10-04 00:54:44 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2016-10-04 00:54:44 +0200 |
commit | 5f7c5e685bb2ea23ced2676e3bbb644769f2d955 (patch) | |
tree | 5565735cc19df746fea71a24a8fece703dc67ca4 /backends/smt2 | |
parent | 1114ce9210dfb9a0db981029377dc859abc3aa34 (diff) | |
download | yosys-5f7c5e685bb2ea23ced2676e3bbb644769f2d955.tar.gz yosys-5f7c5e685bb2ea23ced2676e3bbb644769f2d955.tar.bz2 yosys-5f7c5e685bb2ea23ced2676e3bbb644769f2d955.zip |
Bugfix in yosys-smtbmc --noincr
Diffstat (limited to 'backends/smt2')
-rw-r--r-- | backends/smt2/smtio.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/backends/smt2/smtio.py b/backends/smt2/smtio.py index eccb65014..a0c981d3c 100644 --- a/backends/smt2/smtio.py +++ b/backends/smt2/smtio.py @@ -270,11 +270,17 @@ class SmtIo: if self.solver != "dummy": if self.noincr: + if self.p is not None and not stmt.startswith("(get-"): + self.p.stdin.close() + self.p = None if stmt == "(push 1)": self.smt2cache.append(list()) elif stmt == "(pop 1)": self.smt2cache.pop() else: + if self.p is not None: + self.p.stdin.write(bytes(stmt + "\n", "ascii")) + self.p.stdin.flush() self.smt2cache[-1].append(stmt) else: self.p.stdin.write(bytes(stmt + "\n", "ascii")) @@ -394,6 +400,7 @@ class SmtIo: if self.noincr: if self.p is not None: self.p.stdin.close() + self.p = None self.p = subprocess.Popen(self.popen_vargs, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) for cache_ctx in self.smt2cache: for cache_stmt in cache_ctx: @@ -596,7 +603,7 @@ class SmtIo: return [self.bv2bin(v) for v in self.get_net_list(mod_name, net_path_list, state_name)] def wait(self): - if self.solver != "dummy": + if self.p is not None: self.p.wait() |