forked from M-Labs/artiq
transforms.iodelay_estimator: correctly handle functions with empty body.
This commit is contained in:
parent
e53f26dba0
commit
9bc62fa3d2
|
@ -208,6 +208,7 @@ class Max(Expr):
|
||||||
def __init__(self, operands):
|
def __init__(self, operands):
|
||||||
assert isinstance(operands, list)
|
assert isinstance(operands, list)
|
||||||
assert all([isinstance(operand, Expr) for operand in operands])
|
assert all([isinstance(operand, Expr) for operand in operands])
|
||||||
|
assert operands != []
|
||||||
self.operands = operands
|
self.operands = operands
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|
|
@ -220,7 +220,8 @@ class IODelayEstimator(algorithm.Visitor):
|
||||||
delays.append(self.current_delay)
|
delays.append(self.current_delay)
|
||||||
self.current_delay = old_delay
|
self.current_delay = old_delay
|
||||||
|
|
||||||
self.current_delay += iodelay.Max(delays)
|
if any(delays):
|
||||||
|
self.current_delay += iodelay.Max(delays)
|
||||||
except _IndeterminateDelay as error:
|
except _IndeterminateDelay as error:
|
||||||
# Interleave failures inside `with` statements are hard failures,
|
# Interleave failures inside `with` statements are hard failures,
|
||||||
# since there's no chance that the code will never actually execute
|
# since there's no chance that the code will never actually execute
|
||||||
|
|
Loading…
Reference in New Issue