2014-05-31 00:20:13 +08:00
|
|
|
from artiq.language.units import *
|
|
|
|
from artiq.language.experiment import *
|
|
|
|
|
2014-06-17 03:39:33 +08:00
|
|
|
my_range = range
|
|
|
|
|
2014-05-31 00:20:13 +08:00
|
|
|
class CompilerTest(Experiment):
|
|
|
|
channels = "core a b A B"
|
|
|
|
|
2014-06-17 04:56:08 +08:00
|
|
|
def print_done(self):
|
|
|
|
print("Done!")
|
|
|
|
|
|
|
|
def print_iter(self, n):
|
|
|
|
print("Iteration: {}".format(n))
|
|
|
|
|
2014-05-31 00:20:13 +08:00
|
|
|
@kernel
|
2014-06-17 03:39:33 +08:00
|
|
|
def run(self, n, t2):
|
|
|
|
t2 += 1*us
|
|
|
|
for i in my_range(n):
|
2014-06-17 04:56:08 +08:00
|
|
|
self.print_iter(i)
|
2014-05-31 00:20:13 +08:00
|
|
|
with parallel:
|
|
|
|
with sequential:
|
|
|
|
self.a.pulse(100*MHz, 20*us)
|
2014-06-17 03:39:33 +08:00
|
|
|
self.b.pulse(100*MHz, t2)
|
2014-05-31 00:20:13 +08:00
|
|
|
with sequential:
|
|
|
|
self.A.pulse(100*MHz, 10*us)
|
2014-06-17 03:39:33 +08:00
|
|
|
self.B.pulse(100*MHz, t2)
|
2014-06-17 04:56:08 +08:00
|
|
|
self.print_done()
|
2014-05-31 00:20:13 +08:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
from artiq.devices import core, core_dds
|
|
|
|
|
|
|
|
coredev = core.Core()
|
|
|
|
exp = CompilerTest(
|
|
|
|
core=coredev,
|
|
|
|
a=core_dds.DDS(coredev, 0, 0),
|
|
|
|
b=core_dds.DDS(coredev, 1, 1),
|
|
|
|
A=core_dds.DDS(coredev, 2, 2),
|
|
|
|
B=core_dds.DDS(coredev, 3, 3)
|
|
|
|
)
|
2014-06-17 03:39:33 +08:00
|
|
|
exp.run(3, 100*us)
|