axis_replay_buffer: Don't say we're ready during reset

We can't actually accept data during reset, so don't assert ready.
Modify the testbench to try to send data while the core is reset, so we
can verify that it doesn't get accepted.

Fixes: 52325f2 ("Add AXI stream replay buffer")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
This commit is contained in:
Sean Anderson 2023-03-15 15:34:51 -04:00
parent 9cdbd5f2a8
commit d1834e2b7a
2 changed files with 8 additions and 6 deletions

View File

@ -152,7 +152,7 @@ module axis_replay_buffer (
s_ptr <= 0;
last <= 0;
replayable <= 1;
s_axis_ready <= 1;
s_axis_ready <= 0;
m_axis_valid <= 0;
m_axis_last <= 0;
sent_last <= 0;

View File

@ -57,11 +57,13 @@ async def test_replay(buf, in_ratio, out_ratio):
buf.replay.value = 0
buf.done.value = 0
await Timer(1)
buf.rst.value = 0
await cocotb.start(Clock(buf.clk, 8, units='ns').start())
await FallingEdge(buf.clk)
await cocotb.start(ClockEnable(buf.clk, buf.m_axis_ready, out_ratio))
async def init():
await Timer(1)
await cocotb.start(Clock(buf.clk, 8, units='ns').start())
await cocotb.start(ClockEnable(buf.clk, buf.m_axis_ready, out_ratio))
await FallingEdge(buf.clk)
buf.rst.value = 0
await cocotb.start(init())
# A packet equal to BUF_SIZE, one around 2**BUF_WIDTH, and one around
# 2**(BUF_WIDTH + 1) (plus some extra). This should capture most of the fun