compiler_test: demo parameters and constant globals

This commit is contained in:
Sebastien Bourdeauducq 2014-06-16 21:39:33 +02:00
parent 733a03b7ad
commit 903cbfd848
1 changed files with 8 additions and 5 deletions

View File

@ -1,19 +1,22 @@
from artiq.language.units import * from artiq.language.units import *
from artiq.language.experiment import * from artiq.language.experiment import *
my_range = range
class CompilerTest(Experiment): class CompilerTest(Experiment):
channels = "core a b A B" channels = "core a b A B"
@kernel @kernel
def run(): def run(self, n, t2):
for i in range(3): t2 += 1*us
for i in my_range(n):
with parallel: with parallel:
with sequential: with sequential:
self.a.pulse(100*MHz, 20*us) self.a.pulse(100*MHz, 20*us)
self.b.pulse(100*MHz, 10*us) self.b.pulse(100*MHz, t2)
with sequential: with sequential:
self.A.pulse(100*MHz, 10*us) self.A.pulse(100*MHz, 10*us)
self.B.pulse(100*MHz, 10*us) self.B.pulse(100*MHz, t2)
if __name__ == "__main__": if __name__ == "__main__":
from artiq.devices import core, core_dds from artiq.devices import core, core_dds
@ -26,4 +29,4 @@ if __name__ == "__main__":
A=core_dds.DDS(coredev, 2, 2), A=core_dds.DDS(coredev, 2, 2),
B=core_dds.DDS(coredev, 3, 3) B=core_dds.DDS(coredev, 3, 3)
) )
exp.run() exp.run(3, 100*us)