forked from M-Labs/artiq
1
0
Fork 0

examples: add kasli_drtioswitching

This commit is contained in:
Sebastien Bourdeauducq 2018-09-11 22:20:18 +08:00
parent 41972d6773
commit 8227037a84
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,34 @@
core_addr = "kasli-1.lab.m-labs.hk"
device_db = {
"core": {
"type": "local",
"module": "artiq.coredevice.core",
"class": "Core",
"arguments": {"host": core_addr, "ref_period": 1/(8*150e6)}
},
"core_log": {
"type": "controller",
"host": "::1",
"port": 1068,
"command": "aqctl_corelog -p {port} --bind {bind} " + core_addr
},
"core_cache": {
"type": "local",
"module": "artiq.coredevice.cache",
"class": "CoreCache"
},
"core_dma": {
"type": "local",
"module": "artiq.coredevice.dma",
"class": "CoreDMA"
},
}
for i in range(3):
device_db["led" + str(i)] = {
"type": "local",
"module": "artiq.coredevice.ttl",
"class": "TTLOut",
"arguments": {"channel": i << 16},
}

View File

@ -0,0 +1,17 @@
from artiq.experiment import *
class Blink(EnvExperiment):
def build(self):
self.setattr_device("core")
self.leds = [self.get_device("led0"), self.get_device("led2")]
@kernel
def run(self):
while True:
self.core.reset()
while True:
for led in self.leds:
led.pulse(200*ms)
delay(200*ms)