Skip to content

Commit 47191ed

Browse files
committedJul 20, 2015
dds monitor: relax timing (for pipistrello)
1 parent 1a0dc49 commit 47191ed

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed
 

Diff for: ‎artiq/gateware/rtio/phy/dds.py

+22-21
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,40 @@ def __init__(self, ftw_base, pads, nchannels, **kwargs):
1414

1515
# # #
1616

17+
# buffer the current address/data on the rtlink output
18+
current_address = Signal.like(self.rtlink.o.address)
19+
current_data = Signal.like(self.rtlink.o.data)
20+
self.sync.rio += If(self.rtlink.o.stb,
21+
current_address.eq(self.rtlink.o.address),
22+
current_data.eq(self.rtlink.o.data))
23+
1724
# keep track of the currently selected channel
1825
current_channel = Signal(max=nchannels)
19-
self.sync.rio += If(self.rtlink.o.stb &
20-
(self.rtlink.o.address == 2**flen(pads.a)+1),
21-
current_channel.eq(self.rtlink.o.data))
26+
self.sync.rio += If(current_address == 2**flen(pads.a) + 1,
27+
current_channel.eq(current_data))
2228

2329
# keep track of frequency tuning words, before they are FUDed
2430
ftws = [Signal(32) for i in range(nchannels)]
2531
for c, ftw in enumerate(ftws):
2632
if flen(pads.d) == 8:
27-
for i in range(4):
28-
self.sync.rio += \
29-
If(self.rtlink.o.stb & \
30-
(self.rtlink.o.address == ftw_base+i) & \
31-
(current_channel == c),
32-
ftw[i*8:(i+1)*8].eq(self.rtlink.o.data)
33-
)
33+
self.sync.rio += \
34+
If(current_channel == c, [
35+
If(current_address == ftw_base+i,
36+
ftw[i*8:(i+1)*8].eq(current_data))
37+
for i in range(4)])
3438
elif flen(pads.d) == 16:
35-
for i in range(2):
36-
self.sync.rio += \
37-
If(self.rtlink.o.stb & \
38-
(self.rtlink.o.address == ftw_base+2*i) & \
39-
(current_channel == c),
40-
ftw[i*16:(i+1)*16].eq(self.rtlink.o.data)
41-
)
39+
self.sync.rio += \
40+
If(current_channel == c, [
41+
If(current_address == ftw_base+2*i,
42+
ftw[i*16:(i+1)*16].eq(current_data))
43+
for i in range(2)])
4244
else:
4345
raise NotImplementedError
4446

4547
# FTW to probe on FUD
46-
for c, (probe, ftw) in enumerate(zip(self.probes, ftws)):
47-
fud = self.rtlink.o.stb & \
48-
(self.rtlink.o.address == 2**flen(pads.a))
49-
self.sync.rio += If(fud & (current_channel == c), probe.eq(ftw))
48+
self.sync.rio += If(current_address == 2**flen(pads.a), [
49+
If(current_channel == c, probe.eq(ftw))
50+
for c, (probe, ftw) in enumerate(zip(self.probes, ftws))])
5051

5152

5253
class AD9858(_AD9xxx):

0 commit comments

Comments
 (0)