From 1117fe191bccd1e62a45efa3d85fa62461419fa3 Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Wed, 12 Oct 2016 12:03:29 +0200 Subject: [PATCH] phaser: support core stpl --- artiq/coredevice/ad9154.py | 9 +++++++++ artiq/gateware/targets/kc705.py | 9 --------- artiq/runtime/ad9154.c | 5 +++++ artiq/runtime/ad9154.h | 1 + artiq/runtime/ksupport.c | 1 + 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/artiq/coredevice/ad9154.py b/artiq/coredevice/ad9154.py index 792c56652..64bb7fbf3 100644 --- a/artiq/coredevice/ad9154.py +++ b/artiq/coredevice/ad9154.py @@ -42,6 +42,11 @@ def ad9154_jesd_prbs(prbs: TInt32) -> TNone: raise NotImplementedError("syscall not simulated") +@syscall(flags={"nounwind", "nowrite"}) +def ad9154_jesd_stpl(prbs: TInt32) -> TNone: + raise NotImplementedError("syscall not simulated") + + class AD9154: """AD9154-FMC-EBZ SPI support @@ -95,3 +100,7 @@ class AD9154: @kernel def jesd_prbs(self, prbs): ad9154_jesd_prbs(prbs) + + @kernel + def jesd_stpl(self, enable): + ad9154_jesd_stpl(enable) diff --git a/artiq/gateware/targets/kc705.py b/artiq/gateware/targets/kc705.py index 82a459f87..749cc6c20 100755 --- a/artiq/gateware/targets/kc705.py +++ b/artiq/gateware/targets/kc705.py @@ -544,15 +544,6 @@ class Phaser(_NIST_Ions): # while at 5 GBps, take every second sample... FIXME self.comb += conv.eq(Cat(ch.o[::2])) - if False: - # short transport layer test pattern - self.comb += [ - self.ad9154.jesd_core.transport.sink.converter0.eq(0x01230123), - self.ad9154.jesd_core.transport.sink.converter1.eq(0x45674567), - self.ad9154.jesd_core.transport.sink.converter2.eq(0x89ab89ab), - self.ad9154.jesd_core.transport.sink.converter3.eq(0xcdefcdef) - ] - self.comb += jesd_sync.eq(self.ad9154.jesd_sync) diff --git a/artiq/runtime/ad9154.c b/artiq/runtime/ad9154.c index 0711af8dc..31704bc3d 100644 --- a/artiq/runtime/ad9154.c +++ b/artiq/runtime/ad9154.c @@ -69,4 +69,9 @@ void ad9154_jesd_prbs(int p) ad9154_jesd_control_prbs_config_write(p); } +void ad9154_jesd_stpl(int en) +{ + ad9154_jesd_control_stpl_enable_write(en); +} + #endif /* CONFIG_AD9154_DAC_CS */ diff --git a/artiq/runtime/ad9154.h b/artiq/runtime/ad9154.h index 9ea6d0e5d..d6fa93d85 100644 --- a/artiq/runtime/ad9154.h +++ b/artiq/runtime/ad9154.h @@ -13,6 +13,7 @@ uint8_t ad9516_read(uint16_t addr); void ad9154_jesd_enable(int en); int ad9154_jesd_ready(void); void ad9154_jesd_prbs(int p); +void ad9154_jesd_stpl(int en); #endif #endif diff --git a/artiq/runtime/ksupport.c b/artiq/runtime/ksupport.c index fb3f6dff5..4bc8abec8 100644 --- a/artiq/runtime/ksupport.c +++ b/artiq/runtime/ksupport.c @@ -147,6 +147,7 @@ static const struct symbol runtime_exports[] = { {"ad9154_jesd_enable", &ad9154_jesd_enable}, {"ad9154_jesd_ready", &ad9154_jesd_ready}, {"ad9154_jesd_prbs", &ad9154_jesd_prbs}, + {"ad9154_jesd_stpl", &ad9154_jesd_stpl}, #endif /* end */