From e619154c81b916f0804694218fdb6c5eb81066bc Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 17 Nov 2015 01:22:48 +0300 Subject: [PATCH] transforms.iodelay_estimator: fix handling of `with sequential`. --- artiq/compiler/transforms/iodelay_estimator.py | 2 +- lit-test/test/iodelay/sequential.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 lit-test/test/iodelay/sequential.py diff --git a/artiq/compiler/transforms/iodelay_estimator.py b/artiq/compiler/transforms/iodelay_estimator.py index a28e9e793..cc3da45a1 100644 --- a/artiq/compiler/transforms/iodelay_estimator.py +++ b/artiq/compiler/transforms/iodelay_estimator.py @@ -216,7 +216,7 @@ class IODelayEstimator(algorithm.Visitor): self.current_delay = old_delay 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) else: self.abort("with statement cannot be interleaved", node.loc) diff --git a/lit-test/test/iodelay/sequential.py b/lit-test/test/iodelay/sequential.py new file mode 100644 index 000000000..54a776b68 --- /dev/null +++ b/lit-test/test/iodelay/sequential.py @@ -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)