Skip to content

Commit

Permalink
rtio: disable NOP suppression after reset and underflow
Browse files Browse the repository at this point in the history
sbourdeauducq committed Jul 15, 2015
1 parent 08eec40 commit 66940ea
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions artiq/gateware/rtio/core.py
Original file line number Diff line number Diff line change
@@ -122,12 +122,20 @@ def __init__(self, interface, counter, fifo_depth, guard_io_cycles):
sequence_error.eq(self.ev.timestamp < buf.timestamp[fine_ts_width:])
]
if interface.suppress_nop:
self.sync.rsys += nop.eq(
optree("&",
[getattr(self.ev, a) == getattr(buf, a)
for a in ("data", "address")
if hasattr(self.ev, a)],
default=0))
# disable NOP at reset: do not suppress a first write with all 0s
nop_en = Signal(reset=0)
self.sync.rsys += [
nop.eq(nop_en &
optree("&",
[getattr(self.ev, a) == getattr(buf, a)
for a in ("data", "address")
if hasattr(self.ev, a)],
default=0)),
# buf now contains valid data. enable NOP.
If(self.we & ~sequence_error, nop_en.eq(1)),
# underflows cancel the write. allow it to be retried.
If(self.underflow, nop_en.eq(0))
]
self.comb += self.sequence_error.eq(self.we & sequence_error)

# Buffer read and FIFO write

0 comments on commit 66940ea

Please sign in to comment.