forked from M-Labs/artiq
1
0
Fork 0

transforms.interleaver: don't assume all delay expressions are folded.

This commit is contained in:
whitequark 2015-11-21 17:24:00 +08:00
parent 5cd12ffd28
commit a01e328b4a
1 changed files with 3 additions and 2 deletions

View File

@ -65,8 +65,9 @@ class Interleaver:
terminator = block.terminator() terminator = block.terminator()
if isinstance(terminator, ir.Delay): if isinstance(terminator, ir.Delay):
# We should be able to fold everything without free variables. # We should be able to fold everything without free variables.
assert iodelay.is_const(terminator.expr) folded_expr = terminator.expr.fold()
return terminator.expr.value assert iodelay.is_const(folded_expr)
return folded_expr.value
else: else:
return 0 return 0