From 770b0a7b79a89f1ea0da6cfd8d1c647dc71c85a2 Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Wed, 21 Mar 2018 18:38:39 +0000 Subject: [PATCH] novogorny: conv -> cnv * parity with sampler * also add novogorny device to opticlock --- artiq/coredevice/novogorny.py | 12 ++++++------ artiq/examples/kasli_opticlock/device_db.py | 11 ++++++++++- artiq/gateware/targets/kasli.py | 4 ++-- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/artiq/coredevice/novogorny.py b/artiq/coredevice/novogorny.py index 6fa879eb1..f92b00e25 100644 --- a/artiq/coredevice/novogorny.py +++ b/artiq/coredevice/novogorny.py @@ -67,17 +67,17 @@ class Novogorny: register. :param spi_device: SPI bus device name - :param conv_device: CONV RTIO TTLOut channel name + :param cnv_device: CNV RTIO TTLOut channel name :param div: SPI clock divider (default: 8) :param core_device: Core device name """ - kernel_invariants = {"bus", "core", "conv", "div", "v_ref"} + kernel_invariants = {"bus", "core", "cnv", "div", "v_ref"} - def __init__(self, dmgr, spi_device, conv_device, div=8, + def __init__(self, dmgr, spi_device, cnv_device, div=8, core_device="core"): self.bus = dmgr.get(spi_device) self.core = dmgr.get(core_device) - self.conv = dmgr.get(conv_device) + self.cnv = dmgr.get(cnv_device) self.div = div self.gains = 0x0000 self.v_ref = 5. # 5 Volt reference @@ -125,7 +125,7 @@ class Novogorny: :param next_ctrl: ADC control word for the next sample :return: The ADC result packet (machine units) """ - self.conv.pulse(40*ns) # t_CNVH + self.cnv.pulse(40*ns) # t_CNVH delay(560*ns) # t_CONV max self.bus.set_config_mu(SPI_CONFIG | spi.SPI_INPUT | spi.SPI_END, 24, self.div, SPI_CS_ADC) @@ -163,7 +163,7 @@ class Novogorny: 24, self.div, SPI_CS_ADC) for i in range(len(data)): t0 = now_mu() - self.conv.pulse(40*ns) # t_CNVH + self.cnv.pulse(40*ns) # t_CNVH delay(560*ns) # t_CONV max self.bus.write(ctrl << 24) at_mu(t0 + dt_mu) diff --git a/artiq/examples/kasli_opticlock/device_db.py b/artiq/examples/kasli_opticlock/device_db.py index 7f8478bbe..3ee94fb2e 100644 --- a/artiq/examples/kasli_opticlock/device_db.py +++ b/artiq/examples/kasli_opticlock/device_db.py @@ -192,12 +192,21 @@ device_db = { "class": "SPIMaster", "arguments": {"channel": 24} }, - "ttl_novogorny0_conv": { + "ttl_novogorny0_cnv": { "type": "local", "module": "artiq.coredevice.ttl", "class": "TTLOut", "arguments": {"channel": 25} }, + "novogorny0" : { + "type": "local", + "module": "artiq.coredevice.novogorny", + "class": "Novogorny", + "arguments": { + "spi_device": "spi_novogorny0", + "cnv_device": "ttl_novogorny0_cnv", + } + }, "spi_urukul0": { "type": "local", diff --git a/artiq/gateware/targets/kasli.py b/artiq/gateware/targets/kasli.py index 9736191c4..5923db950 100755 --- a/artiq/gateware/targets/kasli.py +++ b/artiq/gateware/targets/kasli.py @@ -247,7 +247,7 @@ def _novogorny(eem): Subsignal("n", Pins(_eem_pin(j, i, "n"))), IOStandard("LVDS_25") ) for i, j, sig in [ - (5, eem, "conv"), + (5, eem, "cnv"), (6, eem, "busy"), (7, eem, "scko"), ] @@ -369,7 +369,7 @@ class Opticlock(_StandaloneBase): self.submodules += phy rtio_channels.append(rtio.Channel.from_phy(phy, ififo_depth=16)) - for signal in "conv".split(): + for signal in "cnv".split(): pads = platform.request("eem3_{}".format(signal)) phy = ttl_serdes_7series.Output_8X(pads.p, pads.n) self.submodules += phy