replay_buffer: Fix
If the lower bits of m_ptr is the same as s_ptr when we get s_axis_last
(that is, we are full), then we will immediately end (since m_ptr will
equal last_ptr). Fix this by including all of s_ptr in last_ptr.
Fixes: 52325f2
("Add AXI stream replay buffer")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
This commit is contained in:
parent
040016bd44
commit
91ab3b40ce
|
@ -9,8 +9,8 @@
|
||||||
* replayable will remain true until BUF_SIZE + 1 handshakes have occured
|
* replayable will remain true until BUF_SIZE + 1 handshakes have occured
|
||||||
* without a replay. In particular, it is possible to restart a packet
|
* without a replay. In particular, it is possible to restart a packet
|
||||||
* even after a handshake with m_axis_last set. To support this late replay
|
* even after a handshake with m_axis_last set. To support this late replay
|
||||||
* feature, done must be asserted when the consumer is does not wish to
|
* feature, done must be asserted when the consumer does not wish to perform
|
||||||
* perform any more replays.
|
* any more replays.
|
||||||
*
|
*
|
||||||
* In general, this buffer will add two cycles of latency. Additionally, there
|
* In general, this buffer will add two cycles of latency. Additionally, there
|
||||||
* will may some latency when replayable goes low. This is because the slave
|
* will may some latency when replayable goes low. This is because the slave
|
||||||
|
@ -67,8 +67,7 @@ module axis_replay_buffer (
|
||||||
reg m_axis_valid_next, m_axis_last_next;
|
reg m_axis_valid_next, m_axis_last_next;
|
||||||
reg sent_last, sent_last_next;
|
reg sent_last, sent_last_next;
|
||||||
reg [DATA_WIDTH - 1:0] buffer [(2 ** BUF_WIDTH) - 1:0];
|
reg [DATA_WIDTH - 1:0] buffer [(2 ** BUF_WIDTH) - 1:0];
|
||||||
reg [BUF_WIDTH:0] m_ptr, m_ptr_next, s_ptr, s_ptr_next;
|
reg [BUF_WIDTH:0] m_ptr, m_ptr_next, s_ptr, s_ptr_next, last_ptr, last_ptr_next;
|
||||||
reg [BUF_WIDTH - 1:0] last_ptr, last_ptr_next;
|
|
||||||
reg [DATA_WIDTH - 1:0] s_data, m_data;
|
reg [DATA_WIDTH - 1:0] s_data, m_data;
|
||||||
reg last, last_next;
|
reg last, last_next;
|
||||||
reg full, empty, replayable_next, we, re;
|
reg full, empty, replayable_next, we, re;
|
||||||
|
@ -113,7 +112,7 @@ module axis_replay_buffer (
|
||||||
|
|
||||||
/* read the next datum (if it's available)... */
|
/* read the next datum (if it's available)... */
|
||||||
m_axis_valid_next = !empty;
|
m_axis_valid_next = !empty;
|
||||||
m_axis_last_next = last && m_ptr[BUF_WIDTH - 1:0] == last_ptr;
|
m_axis_last_next = last && m_ptr == last_ptr;
|
||||||
re = !empty;
|
re = !empty;
|
||||||
m_ptr_next = m_ptr + !empty;
|
m_ptr_next = m_ptr + !empty;
|
||||||
/* ...except if we need to stall */
|
/* ...except if we need to stall */
|
||||||
|
@ -124,7 +123,6 @@ module axis_replay_buffer (
|
||||||
m_ptr_next = m_ptr;
|
m_ptr_next = m_ptr;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
replayable_next = replayable;
|
replayable_next = replayable;
|
||||||
sent_last_next = sent_last;
|
sent_last_next = sent_last;
|
||||||
if (m_axis_valid && m_axis_ready) begin
|
if (m_axis_valid && m_axis_ready) begin
|
||||||
|
|
Loading…
Reference in New Issue