From 34f386255812d23094a9d6ee219610c5e4fec424 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 30 Mar 2022 08:43:08 +0800 Subject: [PATCH] update NAC3 --- artiq/coredevice/ad53xx.py | 9 +++++---- artiq/examples/nac3devices/nac3devices.py | 2 +- flake.lock | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/artiq/coredevice/ad53xx.py b/artiq/coredevice/ad53xx.py index 293776b1c..9d746fed3 100644 --- a/artiq/coredevice/ad53xx.py +++ b/artiq/coredevice/ad53xx.py @@ -10,7 +10,7 @@ time is an error. from numpy import int32, int64 -from artiq.language.core import nac3, kernel, portable, Kernel, KernelInvariant +from artiq.language.core import * from artiq.language.units import ns, us from artiq.coredevice.core import Core from artiq.coredevice.ttl import TTLOut @@ -313,7 +313,7 @@ class AD53xx: self.ldac.on() @kernel - def set_dac_mu(self, values: list[int32], channels: list[int32]): # NAC3TODO default list(range(40)) + def set_dac_mu(self, values: list[int32], channels: Option[list[int32]] = none): """Program multiple DAC channels and pulse LDAC to update the DAC outputs. @@ -335,14 +335,15 @@ class AD53xx: t_10 = self.core.seconds_to_mu(1500.*ns) # compensate all delays that will be applied delay_mu(-t_10-int64(len(values))*self.bus.xfer_duration_mu) + channels_list = channels.unwrap() if channels.is_some() else [i for i in range(40)] for i in range(len(values)): - self.write_dac_mu(channels[i], values[i]) + self.write_dac_mu(channels_list[i], values[i]) delay_mu(t_10) self.load() at_mu(t0) @kernel - def set_dac(self, voltages: list[float], channels: list[int32]): # NAC3TODO default list(range(40)) + def set_dac(self, voltages: list[float], channels: Option[list[int32]] = none): """Program multiple DAC channels and pulse LDAC to update the DAC outputs. diff --git a/artiq/examples/nac3devices/nac3devices.py b/artiq/examples/nac3devices/nac3devices.py index 6452154b0..b64efe27b 100644 --- a/artiq/examples/nac3devices/nac3devices.py +++ b/artiq/examples/nac3devices/nac3devices.py @@ -55,7 +55,7 @@ class NAC3Devices(EnvExperiment): self.core.reset() self.zotino0.init() self.zotino0.set_leds(0x15) - self.zotino0.set_dac([1.2, -5.3, 3.4, 4.5], [0, 1, 2, 3]) + self.zotino0.set_dac([1.2, -5.3, 3.4, 4.5]) self.core.break_realtime() self.mirny0_cpld.init() diff --git a/flake.lock b/flake.lock index c8e23be43..fbfcb7521 100644 --- a/flake.lock +++ b/flake.lock @@ -45,11 +45,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1648508200, - "narHash": "sha256-8ohq5rj5rV9xyHDbU0oT/2CXT917XQYtxU92GIC+43s=", + "lastModified": 1648584347, + "narHash": "sha256-m27UgTuWDO6rLkwNdxBeGXW7rLZbdl5vCp7afe0P4qo=", "ref": "master", - "rev": "a38cc0444456392fba6949367e4073ee9df149bf", - "revCount": 705, + "rev": "b8ef44d64eabf62175d2b3e900124e0607c7b4d3", + "revCount": 710, "type": "git", "url": "https://git.m-labs.hk/m-labs/nac3.git" },