From 3a0dfb7fdcf415e32950c4ef2bf3b6e6080ee12e Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Sat, 24 Mar 2018 16:04:02 +0100 Subject: [PATCH] ad53xx: port monitor, moninj dashboard, kc705 target --- artiq/dashboard/moninj.py | 4 ++-- .../rtio/phy/{ad5360_monitor.py => ad53xx_monitor.py} | 10 ++++++---- artiq/gateware/targets/kc705.py | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) rename artiq/gateware/rtio/phy/{ad5360_monitor.py => ad53xx_monitor.py} (83%) diff --git a/artiq/dashboard/moninj.py b/artiq/dashboard/moninj.py index e34679c34..0225690ed 100644 --- a/artiq/dashboard/moninj.py +++ b/artiq/dashboard/moninj.py @@ -224,8 +224,8 @@ def setup_from_ddb(ddb): channel = v["arguments"]["channel"] widget = _WidgetDesc(k, comment, _DDSWidget, (bus_channel, channel, k)) description.add(widget) - elif (v["module"] == "artiq.coredevice.ad5360" - and v["class"] == "AD5360"): + elif (v["module"] == "artiq.coredevice.ad53xx" + and v["class"] == "AD53XX"): spi_device = v["arguments"]["spi_device"] spi_device = ddb[spi_device] while isinstance(spi_device, str): diff --git a/artiq/gateware/rtio/phy/ad5360_monitor.py b/artiq/gateware/rtio/phy/ad53xx_monitor.py similarity index 83% rename from artiq/gateware/rtio/phy/ad5360_monitor.py rename to artiq/gateware/rtio/phy/ad53xx_monitor.py index c112d6649..267649734 100644 --- a/artiq/gateware/rtio/phy/ad5360_monitor.py +++ b/artiq/gateware/rtio/phy/ad53xx_monitor.py @@ -1,10 +1,10 @@ from migen import * from artiq.coredevice.spi2 import SPI_CONFIG_ADDR, SPI_DATA_ADDR -from artiq.coredevice.ad5360 import _AD5360_CMD_DATA, _AD5360_WRITE_CHANNEL +from artiq.coredevice.ad53xx import AD53XX_CMD_DATA, ad53xx_cmd_write_ch -class AD5360Monitor(Module): +class AD53XXMonitor(Module): def __init__(self, spi_rtlink, ldac_rtlink=None, cs_no=0, cs_onehot=False, nchannels=32): self.probes = [Signal(16) for i in range(nchannels)] @@ -39,8 +39,10 @@ class AD5360Monitor(Module): ) ] - writes = {(_AD5360_CMD_DATA | _AD5360_WRITE_CHANNEL(i)) >> 16: t.eq(spi_oif.data[8:24]) - for i, t in enumerate(write_targets)} + writes = { + ad53xx_cmd_write_ch(channel=i, value=0, op=AD53XX_CMD_DATA) >> 16: + t.eq(spi_oif.data[8:24]) + for i, t in enumerate(write_targets)} self.sync.rio_phy += [ If(spi_oif.stb & (spi_oif.address == SPI_DATA_ADDR), Case(spi_oif.data[24:], writes) diff --git a/artiq/gateware/targets/kc705.py b/artiq/gateware/targets/kc705.py index fcf52d055..f29828415 100755 --- a/artiq/gateware/targets/kc705.py +++ b/artiq/gateware/targets/kc705.py @@ -17,7 +17,7 @@ from misoc.integration.builder import builder_args, builder_argdict from artiq.gateware.amp import AMPSoC from artiq.gateware import rtio, nist_clock, nist_qc2 from artiq.gateware.rtio.phy import (ttl_simple, ttl_serdes_7series, - dds, spi2, ad5360_monitor) + dds, spi2, ad53xx_monitor) from artiq.build_soc import build_artiq_soc from artiq import __version__ as artiq_version @@ -351,7 +351,7 @@ class NIST_CLOCK(_StandaloneBase): self.submodules += ldac_phy rtio_channels.append(rtio.Channel.from_phy(ldac_phy)) - dac_monitor = ad5360_monitor.AD5360Monitor(sdac_phy.rtlink, ldac_phy.rtlink) + dac_monitor = ad53xx_monitor.AD53XXMonitor(sdac_phy.rtlink, ldac_phy.rtlink) self.submodules += dac_monitor sdac_phy.probes.extend(dac_monitor.probes)