From a1651d15f54287490924a08eb194966356431ef6 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 28 Apr 2022 15:27:42 +0800 Subject: [PATCH] urukul: _RegIOUpdate fixes --- artiq/coredevice/urukul.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/artiq/coredevice/urukul.py b/artiq/coredevice/urukul.py index 769c31ab3..d4e04ca70 100644 --- a/artiq/coredevice/urukul.py +++ b/artiq/coredevice/urukul.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from numpy import int32, int64 from artiq.language.core import * @@ -427,6 +429,8 @@ class CPLD: cfg |= (profile & 7) << CFG_PROFILE self.cfg_write(cfg) + +@nac3 class _RegIOUpdate: core: KernelInvariant[Core] cpld: KernelInvariant[CPLD] @@ -436,8 +440,12 @@ class _RegIOUpdate: self.cpld = cpld @kernel - def pulse(self, t: float): + def pulse_mu(self, t: int64): cfg = self.cpld.cfg_reg self.cpld.cfg_write(cfg | (1 << CFG_IO_UPDATE)) - delay(t) + delay_mu(t) self.cpld.cfg_write(cfg) + + @kernel + def pulse(self, t: float): + self.pulse_mu(self.core.seconds_to_mu(t))