mirror of
https://github.com/YosysHQ/yosys
synced 2025-07-24 13:18:56 +00:00
smt2/smtbmc: Fix FF witness data for fine grained or multi chunk FFs
The witness metadata was missing fine grained FFs completely and for coarse grained FFs where the output connection has multiple chunks it lacked the offset of the chunk within the SMT expression. This fixes both, the later by adding an "smtoffset" field to the metadata.
This commit is contained in:
parent
f35c062354
commit
4d334fd3e3
4 changed files with 29 additions and 12 deletions
|
@ -958,6 +958,15 @@ class SmtIo:
|
|||
nextbase = "(|%s_h %s| %s)" % (mod, path[0], base)
|
||||
return self.net_expr(nextmod, nextbase, path[1:])
|
||||
|
||||
def witness_net_expr(self, mod, base, witness):
|
||||
net = self.net_expr(mod, base, witness["smtpath"])
|
||||
is_bool = self.net_width(mod, witness["smtpath"]) == 1
|
||||
if is_bool:
|
||||
assert witness["width"] == 1
|
||||
assert witness["smtoffset"] == 0
|
||||
return net
|
||||
return "((_ extract %d %d) %s)" % (witness["smtoffset"] + witness["width"] - 1, witness["smtoffset"], net)
|
||||
|
||||
def net_width(self, mod, net_path):
|
||||
for i in range(len(net_path)-1):
|
||||
assert mod in self.modinfo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue