From 3920b2801e4509ec7c3d567ed47e179e0ce83710 Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Tue, 26 Mar 2019 16:39:31 -0700 Subject: [PATCH] Add short packet tests --- tb/test_axis_async_fifo.py | 21 +++++++++++++++++++++ tb/test_axis_async_fifo_64.py | 21 +++++++++++++++++++++ tb/test_axis_async_frame_fifo.py | 21 +++++++++++++++++++++ tb/test_axis_async_frame_fifo_64.py | 21 +++++++++++++++++++++ tb/test_axis_fifo.py | 21 +++++++++++++++++++++ tb/test_axis_fifo_64.py | 21 +++++++++++++++++++++ tb/test_axis_frame_fifo.py | 21 +++++++++++++++++++++ tb/test_axis_frame_fifo_64.py | 21 +++++++++++++++++++++ 8 files changed, 168 insertions(+) diff --git a/tb/test_axis_async_fifo.py b/tb/test_axis_async_fifo.py index 39cfdcde..67989257 100755 --- a/tb/test_axis_async_fifo.py +++ b/tb/test_axis_async_fifo.py @@ -500,6 +500,27 @@ def bench(): yield delay(100) + yield s_clk.posedge + print("test 11: many small packets") + current_test.next = 11 + + test_frame = axis_ep.AXIStreamFrame( + b'\xAA', + id=11, + dest=1 + ) + + for k in range(64): + source.send(test_frame) + + for k in range(64): + yield sink.wait() + rx_frame = sink.recv() + + assert rx_frame == test_frame + + yield delay(100) + raise StopSimulation return instances() diff --git a/tb/test_axis_async_fifo_64.py b/tb/test_axis_async_fifo_64.py index 5e173909..44925adf 100755 --- a/tb/test_axis_async_fifo_64.py +++ b/tb/test_axis_async_fifo_64.py @@ -500,6 +500,27 @@ def bench(): yield delay(100) + yield s_clk.posedge + print("test 11: many small packets") + current_test.next = 11 + + test_frame = axis_ep.AXIStreamFrame( + b'\xAA', + id=11, + dest=1 + ) + + for k in range(64): + source.send(test_frame) + + for k in range(64): + yield sink.wait() + rx_frame = sink.recv() + + assert rx_frame == test_frame + + yield delay(100) + raise StopSimulation return instances() diff --git a/tb/test_axis_async_frame_fifo.py b/tb/test_axis_async_frame_fifo.py index f6745b58..367efd19 100755 --- a/tb/test_axis_async_frame_fifo.py +++ b/tb/test_axis_async_frame_fifo.py @@ -668,6 +668,27 @@ def bench(): yield delay(100) + yield s_clk.posedge + print("test 12: many small packets") + current_test.next = 12 + + test_frame = axis_ep.AXIStreamFrame( + b'\xAA', + id=12, + dest=1 + ) + + for k in range(64): + source.send(test_frame) + + for k in range(64): + yield sink.wait() + rx_frame = sink.recv() + + assert rx_frame == test_frame + + yield delay(100) + raise StopSimulation return instances() diff --git a/tb/test_axis_async_frame_fifo_64.py b/tb/test_axis_async_frame_fifo_64.py index a72d060e..fbd5a76d 100755 --- a/tb/test_axis_async_frame_fifo_64.py +++ b/tb/test_axis_async_frame_fifo_64.py @@ -668,6 +668,27 @@ def bench(): yield delay(100) + yield s_clk.posedge + print("test 12: many small packets") + current_test.next = 12 + + test_frame = axis_ep.AXIStreamFrame( + b'\xAA', + id=12, + dest=1 + ) + + for k in range(64): + source.send(test_frame) + + for k in range(64): + yield sink.wait() + rx_frame = sink.recv() + + assert rx_frame == test_frame + + yield delay(100) + raise StopSimulation return instances() diff --git a/tb/test_axis_fifo.py b/tb/test_axis_fifo.py index f38f320d..c28c9018 100755 --- a/tb/test_axis_fifo.py +++ b/tb/test_axis_fifo.py @@ -489,6 +489,27 @@ def bench(): yield delay(100) + yield clk.posedge + print("test 11: many small packets") + current_test.next = 11 + + test_frame = axis_ep.AXIStreamFrame( + b'\xAA', + id=11, + dest=1 + ) + + for k in range(64): + source.send(test_frame) + + for k in range(64): + yield sink.wait() + rx_frame = sink.recv() + + assert rx_frame == test_frame + + yield delay(100) + raise StopSimulation return instances() diff --git a/tb/test_axis_fifo_64.py b/tb/test_axis_fifo_64.py index 7b508b7c..eeb28ba4 100755 --- a/tb/test_axis_fifo_64.py +++ b/tb/test_axis_fifo_64.py @@ -489,6 +489,27 @@ def bench(): yield delay(100) + yield clk.posedge + print("test 11: many small packets") + current_test.next = 11 + + test_frame = axis_ep.AXIStreamFrame( + b'\xAA', + id=11, + dest=1 + ) + + for k in range(64): + source.send(test_frame) + + for k in range(64): + yield sink.wait() + rx_frame = sink.recv() + + assert rx_frame == test_frame + + yield delay(100) + raise StopSimulation return instances() diff --git a/tb/test_axis_frame_fifo.py b/tb/test_axis_frame_fifo.py index 2c2636b6..b5ebab51 100755 --- a/tb/test_axis_frame_fifo.py +++ b/tb/test_axis_frame_fifo.py @@ -594,6 +594,27 @@ def bench(): yield delay(100) + yield clk.posedge + print("test 12: many small packets") + current_test.next = 12 + + test_frame = axis_ep.AXIStreamFrame( + b'\xAA', + id=12, + dest=1 + ) + + for k in range(64): + source.send(test_frame) + + for k in range(64): + yield sink.wait() + rx_frame = sink.recv() + + assert rx_frame == test_frame + + yield delay(100) + raise StopSimulation return instances() diff --git a/tb/test_axis_frame_fifo_64.py b/tb/test_axis_frame_fifo_64.py index 164e9718..e0200d27 100755 --- a/tb/test_axis_frame_fifo_64.py +++ b/tb/test_axis_frame_fifo_64.py @@ -594,6 +594,27 @@ def bench(): yield delay(100) + yield clk.posedge + print("test 12: many small packets") + current_test.next = 12 + + test_frame = axis_ep.AXIStreamFrame( + b'\xAA', + id=12, + dest=1 + ) + + for k in range(64): + source.send(test_frame) + + for k in range(64): + yield sink.wait() + rx_frame = sink.recv() + + assert rx_frame == test_frame + + yield delay(100) + raise StopSimulation return instances()