mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
transform/unroll_sync: support generator function
This commit is contained in:
parent
9efc581bee
commit
fecab5518b
1 changed files with 6 additions and 2 deletions
|
@ -80,7 +80,7 @@ def _variable_for(s, n):
|
|||
name = "v"
|
||||
return Signal(s.bv, name=name, variable=True)
|
||||
|
||||
def unroll_sync(sync, inputs, outputs):
|
||||
def unroll_sync(statements, inputs, outputs):
|
||||
assert(inputs or outputs)
|
||||
if inputs:
|
||||
sd_in = _list_step_dicts(inputs)
|
||||
|
@ -106,7 +106,11 @@ def unroll_sync(sync, inputs, outputs):
|
|||
|
||||
# replace signals with intermediate variables and copy statements
|
||||
io_var_dict.update(di)
|
||||
r += _replace(sync, io_var_dict, do_var)
|
||||
if isinstance(statements, list):
|
||||
sl = statements
|
||||
else:
|
||||
sl = statements(n)
|
||||
r += _replace(sl, io_var_dict, do_var)
|
||||
|
||||
# assign to output signals
|
||||
r += [v.eq(do_var[k]) for k, v in do.items()]
|
||||
|
|
Loading…
Reference in a new issue