forked from M-Labs/artiq
1
0
Fork 0

Add simple simulation example

This commit is contained in:
Sebastien Bourdeauducq 2014-06-18 13:43:09 +02:00
parent d41ac863f4
commit 67e042852a
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,29 @@
from artiq.language.units import *
from artiq.language.experiment import *
class SimpleSimulation(Experiment):
channels = "core 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)
if __name__ == "__main__":
from artiq.sim import devices as sd
from artiq.sim import time
exp = SimpleSimulation(
core=sd.Core(),
a=sd.WaveOutput("a"),
b=sd.WaveOutput("b"),
c=sd.WaveOutput("c"),
d=sd.WaveOutput("d"),
)
exp.run()
print(time.manager.format_timeline())