2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-22 01:44:00 +08:00
artiq/examples/simple_simulation.py

34 lines
758 B
Python
Raw Normal View History

2014-09-30 17:38:02 +08:00
from artiq import *
2014-06-18 19:43:09 +08:00
2014-09-05 12:03:22 +08:00
2014-08-13 18:30:57 +08:00
class SimpleSimulation(AutoContext):
2014-09-05 12:03:22 +08:00
parameters = "a b c d"
@kernel
def run(self):
with parallel:
with sequential:
self.a.pulse(100*MHz, 20*us)
self.b.pulse(200*MHz, 20*us)
with sequential:
self.c.pulse(300*MHz, 10*us)
self.d.pulse(400*MHz, 20*us)
2014-06-18 19:43:09 +08:00
2014-10-05 16:24:21 +08:00
def main():
2014-09-05 12:03:22 +08:00
from artiq.sim import devices as sd
from artiq.sim import time
2014-06-18 19:43:09 +08:00
2014-09-05 12:03:22 +08:00
exp = SimpleSimulation(
core=sd.Core(),
a=sd.WaveOutput(name="a"),
b=sd.WaveOutput(name="b"),
c=sd.WaveOutput(name="c"),
d=sd.WaveOutput(name="d"),
)
exp.run()
print(time.manager.format_timeline())
2014-10-05 16:24:21 +08:00
if __name__ == "__main__":
main()