smtbmc: Cache hierarchy for loading multiple yw files

This will be used by sby/tools/cexenum via the incremental interface.
This commit is contained in:
Jannis Harder 2024-02-21 16:33:14 +01:00
parent d03c5e2a00
commit 97db1cb745
1 changed files with 7 additions and 1 deletions

View File

@ -649,14 +649,20 @@ if aimfile is not None:
num_steps = max(num_steps, step+2)
step += 1
ywfile_hierwitness_cache = None
def ywfile_constraints(inywfile, constr_assumes, map_steps=None, skip_x=False):
global ywfile_hierwitness_cache
if map_steps is None:
map_steps = {}
with open(inywfile, "r") as f:
inyw = ReadWitness(f)
inits, seqs, clocks, mems = smt.hierwitness(topmod, allregs=True, blackbox=True)
if ywfile_hierwitness_cache is None:
ywfile_hierwitness_cache = smt.hierwitness(topmod, allregs=True, blackbox=True)
inits, seqs, clocks, mems = ywfile_hierwitness_cache
smt_wires = defaultdict(list)
smt_mems = defaultdict(list)