From 34d6a1fd6a67b510e7e7807524ccb994dea1fc37 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Wed, 11 Jan 2023 17:20:12 -0500 Subject: [PATCH] tb: axis_replay_buffer: Allow delaying the last byte Allow delaying the last byte to make it easier to exactly time when the MAC sees the byte. This way, we can test to ensure that everything works even when valid is only high for one cycle. We can't change signals once valid goes high, so this is the only way to ensure this kind of timing. Signed-off-by: Sean Anderson --- tb/axis_replay_buffer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tb/axis_replay_buffer.py b/tb/axis_replay_buffer.py index f33ab9c..be9ffd8 100644 --- a/tb/axis_replay_buffer.py +++ b/tb/axis_replay_buffer.py @@ -10,8 +10,10 @@ from .util import ClockEnable, lookahead, timeout BUF_SIZE = 54 -async def send_packet(signals, packet, ratio=1): +async def send_packet(signals, packet, ratio=1, last_extra=0): for val, last in lookahead(packet): + if last and last_extra: + await ClockCycles(signals['clk'], last_extra, rising=False) if 'err' in signals: if val is None: signals['data'].value = 0