Skip to content

Commit

Permalink
transforms.iodelay_estimator: fix handling of with sequential.
Browse files Browse the repository at this point in the history
whitequark committed Nov 16, 2015
1 parent 506725f commit e619154
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion artiq/compiler/transforms/iodelay_estimator.py
Original file line number Diff line number Diff line change
@@ -216,7 +216,7 @@ def visit_With(self, node):
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)
8 changes: 8 additions & 0 deletions lit-test/test/iodelay/sequential.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit e619154

Please sign in to comment.