forked from M-Labs/artiq
1
0
Fork 0

rtio: disable NOP suppression after reset and underflow

This commit is contained in:
Sebastien Bourdeauducq 2015-07-15 20:54:55 +02:00
parent 08eec40861
commit 66940ea815
1 changed files with 14 additions and 6 deletions

View File

@ -122,12 +122,20 @@ class _OutputManager(Module):
sequence_error.eq(self.ev.timestamp < buf.timestamp[fine_ts_width:]) sequence_error.eq(self.ev.timestamp < buf.timestamp[fine_ts_width:])
] ]
if interface.suppress_nop: if interface.suppress_nop:
self.sync.rsys += nop.eq( # 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("&", optree("&",
[getattr(self.ev, a) == getattr(buf, a) [getattr(self.ev, a) == getattr(buf, a)
for a in ("data", "address") for a in ("data", "address")
if hasattr(self.ev, a)], if hasattr(self.ev, a)],
default=0)) 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) self.comb += self.sequence_error.eq(self.we & sequence_error)
# Buffer read and FIFO write # Buffer read and FIFO write