Skip to content

Commit af26f96

Browse files
committed
docs/stdlib/stream: correct comment in example code about discarded data
In the example code the condition `done & self.stream.valid & ~self.stream.ready` is not sufficient to cause the payload to be discarded. That is because the done bit remains high. In case of a very slow stream, the first two quickly arriving serial transactions will never be lost, even if the first transaction has not been processed yet, when the second one arrives. However if a 3rd transaction arrives as well, then the 2nd transaction will be discarded.
1 parent dd1d8d5 commit af26f96

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/stdlib/stream.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ In this example, the external device does not provide a way to pause data transm
121121
m.d.sync += done.eq(0)
122122
with m.Elif(self.stream.ready):
123123
m.d.sync += self.stream.valid.eq(0)
124-
# Payload is discarded if `done & self.stream.valid & ~self.stream.ready`.
124+
# Pending payload in `data` is discarded if:
125+
# `done & self.stream.valid & ~self.stream.ready`,
126+
# and a new serial transaction begins
125127

126128
return m
127129

0 commit comments

Comments
 (0)