-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
transforms.interleaver: handle function calls (as atomic so far).
This commit solves issue #2 described in 50e7b44; a function call is now a valid decomposition for a delay instruction, and this metadata is propagated when the interleaver converts delays. However, the interleaver does not yet detect that a called function is compound, i.e. it is not correct.
whitequark
committed
Nov 20, 2015
1 parent
57dd163
commit 150ec71
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# RUN: %python -m artiq.compiler.testbench.jit %s >%t | ||
# RUN: OutputCheck %s --file-to-check=%t | ||
|
||
def f(): | ||
delay_mu(2) | ||
|
||
def g(): | ||
with parallel: | ||
with sequential: | ||
print("A", now_mu()) | ||
f() | ||
# | ||
print("B", now_mu()) | ||
with sequential: | ||
print("C", now_mu()) | ||
f() | ||
# | ||
print("D", now_mu()) | ||
f() | ||
# | ||
print("E", now_mu()) | ||
|
||
# CHECK-L: A 0 | ||
# CHECK-L: C 0 | ||
# CHECK-L: B 2 | ||
# CHECK-L: D 2 | ||
# CHECK-L: E 4 | ||
g() |