forked from M-Labs/artiq
1
0
Fork 0

urukul: _RegIOUpdate fixes

This commit is contained in:
Sebastien Bourdeauducq 2022-04-28 15:27:42 +08:00
parent 13eb6e89f0
commit a1651d15f5
1 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,5 @@
from __future__ import annotations
from numpy import int32, int64 from numpy import int32, int64
from artiq.language.core import * from artiq.language.core import *
@ -427,6 +429,8 @@ class CPLD:
cfg |= (profile & 7) << CFG_PROFILE cfg |= (profile & 7) << CFG_PROFILE
self.cfg_write(cfg) self.cfg_write(cfg)
@nac3
class _RegIOUpdate: class _RegIOUpdate:
core: KernelInvariant[Core] core: KernelInvariant[Core]
cpld: KernelInvariant[CPLD] cpld: KernelInvariant[CPLD]
@ -436,8 +440,12 @@ class _RegIOUpdate:
self.cpld = cpld self.cpld = cpld
@kernel @kernel
def pulse(self, t: float): def pulse_mu(self, t: int64):
cfg = self.cpld.cfg_reg cfg = self.cpld.cfg_reg
self.cpld.cfg_write(cfg | (1 << CFG_IO_UPDATE)) self.cpld.cfg_write(cfg | (1 << CFG_IO_UPDATE))
delay(t) delay_mu(t)
self.cpld.cfg_write(cfg) self.cpld.cfg_write(cfg)
@kernel
def pulse(self, t: float):
self.pulse_mu(self.core.seconds_to_mu(t))