Skip to content

Commit 66940ea

Browse files
committedJul 15, 2015
rtio: disable NOP suppression after reset and underflow
1 parent 08eec40 commit 66940ea

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed
 

Diff for: ‎artiq/gateware/rtio/core.py

+14-6
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,20 @@ def __init__(self, interface, counter, fifo_depth, guard_io_cycles):
122122
sequence_error.eq(self.ev.timestamp < buf.timestamp[fine_ts_width:])
123123
]
124124
if interface.suppress_nop:
125-
self.sync.rsys += nop.eq(
126-
optree("&",
127-
[getattr(self.ev, a) == getattr(buf, a)
128-
for a in ("data", "address")
129-
if hasattr(self.ev, a)],
130-
default=0))
125+
# disable NOP at reset: do not suppress a first write with all 0s
126+
nop_en = Signal(reset=0)
127+
self.sync.rsys += [
128+
nop.eq(nop_en &
129+
optree("&",
130+
[getattr(self.ev, a) == getattr(buf, a)
131+
for a in ("data", "address")
132+
if hasattr(self.ev, a)],
133+
default=0)),
134+
# buf now contains valid data. enable NOP.
135+
If(self.we & ~sequence_error, nop_en.eq(1)),
136+
# underflows cancel the write. allow it to be retried.
137+
If(self.underflow, nop_en.eq(0))
138+
]
131139
self.comb += self.sequence_error.eq(self.we & sequence_error)
132140

133141
# Buffer read and FIFO write

0 commit comments

Comments
 (0)
Please sign in to comment.