diff --git a/artiq/examples/kasli_drtioswitching/device_db.py b/artiq/examples/kasli_drtioswitching/device_db.py new file mode 100644 index 000000000..f04ee1869 --- /dev/null +++ b/artiq/examples/kasli_drtioswitching/device_db.py @@ -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}, + } diff --git a/artiq/examples/kasli_drtioswitching/repository/blink.py b/artiq/examples/kasli_drtioswitching/repository/blink.py new file mode 100644 index 000000000..e5068efda --- /dev/null +++ b/artiq/examples/kasli_drtioswitching/repository/blink.py @@ -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)