2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 19:28:26 +08:00

artiq_ddb_template: add Mirny support

Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
This commit is contained in:
Etienne Wodey 2019-12-20 12:26:03 +01:00 committed by Robert Jördens
parent 01a6e77d89
commit da531404e8

View File

@ -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"] = {{