From da531404e84f52b7fb0dd214cbe4cffbb259b69d Mon Sep 17 00:00:00 2001 From: Etienne Wodey Date: Fri, 20 Dec 2019 12:26:03 +0100 Subject: [PATCH] artiq_ddb_template: add Mirny support Signed-off-by: Etienne Wodey --- artiq/frontend/artiq_ddb_template.py | 51 ++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/artiq/frontend/artiq_ddb_template.py b/artiq/frontend/artiq_ddb_template.py index b561e69d9..114cd2d79 100755 --- a/artiq/frontend/artiq_ddb_template.py +++ b/artiq/frontend/artiq_ddb_template.py @@ -228,6 +228,57 @@ class PeripheralManager: raise ValueError return next(channel) + def process_mirny(self, rtio_offset, peripheral): + mirny_name = self.get_name("mirny") + channel = count(0) + self.gen(""" + device_db["spi_{name}"]={{ + "type": "local", + "module": "artiq.coredevice.spi2", + "class": "SPIMaster", + "arguments": {{"channel": 0x{channel:06x}}} + }}""", + name=mirny_name, + channel=rtio_offset+next(channel)) + + for i in range(4): + self.gen(""" + device_db["ttl_{name}_sw{mchn}"] = {{ + "type": "local", + "module": "artiq.coredevice.ttl", + "class": "TTLOut", + "arguments": {{"channel": 0x{ttl_channel:06x}}} + }}""", + name=mirny_name, + mchn=i, + ttl_channel=rtio_offset+next(channel)) + + for i in range(4): + self.gen(""" + device_db["{name}_ch{mchn}"] = {{ + "type": "local", + "module": "artiq.coredevice.adf5355", + "class": "ADF5355", + "arguments": {{ + "channel": {mchn}, + "sw_device": "ttl_{name}_sw{mchn}", + "cpld_device": "{name}_cpld", + }} + }}""", + name=mirny_name, + mchn=i) + + self.gen(""" + device_db["{name}_cpld"] = {{ + "type": "local", + "module": "artiq.coredevice.mirny", + "class": "Mirny", + "arguments": {{"spi_device": "spi_{name}"}}, + }}""", + name=mirny_name) + + return next(channel) + def process_novogorny(self, rtio_offset, peripheral): self.gen(""" device_db["spi_{name}_adc"] = {{