forked from M-Labs/artiq
1
0
Fork 0

transforms.iodelay_estimator: fix handling of `with sequential`.

This commit is contained in:
whitequark 2015-11-17 01:22:48 +03:00
parent 506725f78a
commit e619154c81
2 changed files with 9 additions and 1 deletions

View File

@ -216,7 +216,7 @@ class IODelayEstimator(algorithm.Visitor):
self.current_delay = old_delay self.current_delay = old_delay
self.current_delay += iodelay.Max(delays) self.current_delay += iodelay.Max(delays)
elif len(node.items) == 1 and types.is_builtin(context_expr.type, "serial"): elif len(node.items) == 1 and types.is_builtin(context_expr.type, "sequential"):
self.visit(node.body) self.visit(node.body)
else: else:
self.abort("with statement cannot be interleaved", node.loc) self.abort("with statement cannot be interleaved", node.loc)

View File

@ -0,0 +1,8 @@
# RUN: %python -m artiq.compiler.testbench.signature %s >%t
# RUN: OutputCheck %s --file-to-check=%t
# CHECK-L: f: (a:int(width=64), b:int(width=64))->NoneType delay(a + b mu)
def f(a, b):
with sequential:
delay_mu(a)
delay_mu(b)