mirror of
https://github.com/YosysHQ/sby.git
synced 2025-04-11 00:13:33 +00:00
btor2aiger: Use ywa inits list
`btor2aiger` tool restarts latch indexing at 0 but aiw2yw expects index to be unique. Offset latch input number by the total input count to fix this.
This commit is contained in:
parent
b7bb1466d2
commit
143d03a66e
|
@ -82,12 +82,14 @@ async def main() -> None:
|
|||
pattern = r"(?P<type>[cil])(?P<input>\d+) (?P<path>.*?)(\[(?P<offset>\d+)\])?$"
|
||||
m = re.match(pattern, string)
|
||||
md = m.groupdict()
|
||||
md['input'] = int(md['input'])
|
||||
if md['type'] == 'i':
|
||||
md['type'] = 'input'
|
||||
elif md['type'] == 'c':
|
||||
md['type'] = 'clk'
|
||||
elif md['type'] == 'l':
|
||||
md['type'] = 'latch'
|
||||
md['input'] += ywa['input_count']
|
||||
else:
|
||||
raise ValueError(f"Unknown type identifier {md['type']!r}")
|
||||
for k in ['input', 'offset']:
|
||||
|
@ -109,7 +111,7 @@ async def main() -> None:
|
|||
elif md_type == 'input':
|
||||
ywa['inputs'].append(md)
|
||||
elif md_type == 'latch':
|
||||
ywa['latches'].append(md)
|
||||
ywa['inits'].append(md)
|
||||
|
||||
# get next line
|
||||
data = await proc.stdout.readline()
|
||||
|
|
Loading…
Reference in a new issue