forked from M-Labs/artiq
sayma: output a ramp in the absence of SAWG channels
This commit is contained in:
parent
a371b25525
commit
745e695b09
|
@ -99,6 +99,19 @@ class AD9154(Module, AutoCSR):
|
||||||
self.sync.jesd += conv.eq(Cat(ch.o))
|
self.sync.jesd += conv.eq(Cat(ch.o))
|
||||||
|
|
||||||
|
|
||||||
|
class AD9154NoSAWG(Module, AutoCSR):
|
||||||
|
def __init__(self, platform, sys_crg, jesd_crg, dac):
|
||||||
|
self.submodules.jesd = AD9154JESD(platform, sys_crg, jesd_crg, dac)
|
||||||
|
|
||||||
|
self.sawgs = []
|
||||||
|
|
||||||
|
for i, conv in enumerate(self.jesd.core.sink.flatten()):
|
||||||
|
ramp = Signal(16)
|
||||||
|
self.sync += ramp.eq(ramp + (1 << 9 + i))
|
||||||
|
self.comb += conv.eq(Cat(ramp
|
||||||
|
for i in range(len(conv) // len(ramp))))
|
||||||
|
|
||||||
|
|
||||||
class Standalone(MiniSoC, AMPSoC):
|
class Standalone(MiniSoC, AMPSoC):
|
||||||
mem_map = {
|
mem_map = {
|
||||||
"cri_con": 0x10000000,
|
"cri_con": 0x10000000,
|
||||||
|
@ -177,9 +190,13 @@ class Standalone(MiniSoC, AMPSoC):
|
||||||
rtio_channels.append(rtio.Channel.from_phy(phy))
|
rtio_channels.append(rtio.Channel.from_phy(phy))
|
||||||
|
|
||||||
if with_sawg:
|
if with_sawg:
|
||||||
|
cls = AD9154
|
||||||
|
else:
|
||||||
|
cls = AD9154NoSAWG
|
||||||
|
|
||||||
self.submodules.ad9154_crg = AD9154CRG(platform)
|
self.submodules.ad9154_crg = AD9154CRG(platform)
|
||||||
self.submodules.ad9154_0 = AD9154(platform, self.crg, self.ad9154_crg, 0)
|
self.submodules.ad9154_0 = cls(platform, self.crg, self.ad9154_crg, 0)
|
||||||
self.submodules.ad9154_1 = AD9154(platform, self.crg, self.ad9154_crg, 1)
|
self.submodules.ad9154_1 = cls(platform, self.crg, self.ad9154_crg, 1)
|
||||||
self.csr_devices.append("ad9154_crg")
|
self.csr_devices.append("ad9154_crg")
|
||||||
self.csr_devices.append("ad9154_0")
|
self.csr_devices.append("ad9154_0")
|
||||||
self.csr_devices.append("ad9154_1")
|
self.csr_devices.append("ad9154_1")
|
||||||
|
|
Loading…
Reference in New Issue