forked from M-Labs/artiq
1
0
Fork 0

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
1 changed files with 51 additions and 0 deletions

View File

@ -228,6 +228,57 @@ class PeripheralManager:
raise ValueError raise ValueError
return next(channel) 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): def process_novogorny(self, rtio_offset, peripheral):
self.gen(""" self.gen("""
device_db["spi_{name}_adc"] = {{ device_db["spi_{name}_adc"] = {{