1
0
mirror of https://github.com/corundum/corundum.git synced 2025-01-16 08:12:53 +08:00

Update testbenches to use wait

This commit is contained in:
Alex Forencich 2018-07-02 18:20:07 -07:00
parent 65c64588a6
commit 2e9602b5b4
67 changed files with 582 additions and 1931 deletions

View File

@ -243,11 +243,8 @@ def bench():
test_frame.arp_tha = 0x000000000000
test_frame.arp_tpa = 0xc0a80165
eth_source.send(test_frame.build_eth())
yield clk.posedge
while eth_sink.empty():
yield clk.posedge
yield eth_sink.wait()
rx_frame = eth_sink.recv()
check_frame = arp_ep.ARPFrame()
check_frame.parse_eth(rx_frame)
@ -273,9 +270,7 @@ def bench():
arp_request_source.send([(0xc0a80164,)])
while arp_response_sink.empty():
yield clk.posedge
yield arp_response_sink.wait()
err, mac = arp_response_sink.recv().data[0]
assert not err
@ -290,9 +285,7 @@ def bench():
arp_request_source.send([(0xc0a80166,)])
# wait for ARP request packet
while eth_sink.empty():
yield clk.posedge
yield eth_sink.wait()
rx_frame = eth_sink.recv()
check_frame = arp_ep.ARPFrame()
check_frame.parse_eth(rx_frame)
@ -325,12 +318,9 @@ def bench():
test_frame.arp_tha = 0xDAD1D2D3D4D5
test_frame.arp_tpa = 0xc0a80165
eth_source.send(test_frame.build_eth())
yield clk.posedge
# wait for lookup
while arp_response_sink.empty():
yield clk.posedge
yield arp_response_sink.wait()
err, mac = arp_response_sink.recv().data[0]
assert not err
@ -345,9 +335,7 @@ def bench():
arp_request_source.send([(0x08080808,)])
# wait for ARP request packet
while eth_sink.empty():
yield clk.posedge
yield eth_sink.wait()
rx_frame = eth_sink.recv()
check_frame = arp_ep.ARPFrame()
check_frame.parse_eth(rx_frame)
@ -380,12 +368,9 @@ def bench():
test_frame.arp_tha = 0xDAD1D2D3D4D5
test_frame.arp_tpa = 0xc0a80165
eth_source.send(test_frame.build_eth())
yield clk.posedge
# wait for lookup
while arp_response_sink.empty():
yield clk.posedge
yield arp_response_sink.wait()
err, mac = arp_response_sink.recv().data[0]
assert not err
@ -399,9 +384,7 @@ def bench():
arp_request_source.send([(0xc0a80167,)])
while arp_response_sink.empty():
yield clk.posedge
yield arp_response_sink.wait()
err, mac = arp_response_sink.recv().data[0]
assert err
@ -437,9 +420,7 @@ def bench():
# subnet broadcast
arp_request_source.send([(0xc0a801ff,)])
while arp_response_sink.empty():
yield clk.posedge
yield arp_response_sink.wait()
err, mac = arp_response_sink.recv().data[0]
assert not err
@ -448,9 +429,7 @@ def bench():
# general broadcast
arp_request_source.send([(0xffffffff,)])
while arp_response_sink.empty():
yield clk.posedge
yield arp_response_sink.wait()
err, mac = arp_response_sink.recv().data[0]
assert not err

View File

@ -249,11 +249,8 @@ def bench():
test_frame.arp_tha = 0x000000000000
test_frame.arp_tpa = 0xc0a80165
eth_source.send(test_frame.build_eth())
yield clk.posedge
while eth_sink.empty():
yield clk.posedge
yield eth_sink.wait()
rx_frame = eth_sink.recv()
check_frame = arp_ep.ARPFrame()
check_frame.parse_eth(rx_frame)
@ -279,9 +276,7 @@ def bench():
arp_request_source.send([(0xc0a80164,)])
while arp_response_sink.empty():
yield clk.posedge
yield arp_response_sink.wait()
err, mac = arp_response_sink.recv().data[0]
assert not err
@ -296,9 +291,7 @@ def bench():
arp_request_source.send([(0xc0a80166,)])
# wait for ARP request packet
while eth_sink.empty():
yield clk.posedge
yield eth_sink.wait()
rx_frame = eth_sink.recv()
check_frame = arp_ep.ARPFrame()
check_frame.parse_eth(rx_frame)
@ -331,12 +324,9 @@ def bench():
test_frame.arp_tha = 0xDAD1D2D3D4D5
test_frame.arp_tpa = 0xc0a80165
eth_source.send(test_frame.build_eth())
yield clk.posedge
# wait for lookup
while arp_response_sink.empty():
yield clk.posedge
yield arp_response_sink.wait()
err, mac = arp_response_sink.recv().data[0]
assert not err
@ -351,9 +341,7 @@ def bench():
arp_request_source.send([(0x08080808,)])
# wait for ARP request packet
while eth_sink.empty():
yield clk.posedge
yield eth_sink.wait()
rx_frame = eth_sink.recv()
check_frame = arp_ep.ARPFrame()
check_frame.parse_eth(rx_frame)
@ -386,12 +374,9 @@ def bench():
test_frame.arp_tha = 0xDAD1D2D3D4D5
test_frame.arp_tpa = 0xc0a80165
eth_source.send(test_frame.build_eth())
yield clk.posedge
# wait for lookup
while arp_response_sink.empty():
yield clk.posedge
yield arp_response_sink.wait()
err, mac = arp_response_sink.recv().data[0]
assert not err
@ -405,9 +390,7 @@ def bench():
arp_request_source.send([(0xc0a80167,)])
while arp_response_sink.empty():
yield clk.posedge
yield arp_response_sink.wait()
err, mac = arp_response_sink.recv().data[0]
assert err
@ -443,9 +426,7 @@ def bench():
# subnet broadcast
arp_request_source.send([(0xc0a801ff,)])
while arp_response_sink.empty():
yield clk.posedge
yield arp_response_sink.wait()
err, mac = arp_response_sink.recv().data[0]
assert not err
@ -454,9 +435,7 @@ def bench():
# general broadcast
arp_request_source.send([(0xffffffff,)])
while arp_response_sink.empty():
yield clk.posedge
yield arp_response_sink.wait()
err, mac = arp_response_sink.recv().data[0]
assert not err

View File

@ -176,24 +176,18 @@ def bench():
query_request_source.send([(0xc0a80112, )])
query_request_source.send([(0xc0a80113, )])
while query_response_sink.empty():
yield clk.posedge
yield query_response_sink.wait()
resp = query_response_sink.recv()
assert resp.data[0][0] == 0x0000c0a80111
assert not resp.user[0]
while query_response_sink.empty():
yield clk.posedge
yield query_response_sink.wait()
resp = query_response_sink.recv()
assert resp.data[0][0] == 0x0000c0a80112
assert not resp.user[0]
# not in cache; was not written
while query_response_sink.empty():
yield clk.posedge
yield query_response_sink.wait()
resp = query_response_sink.recv()
assert resp.user[0]
@ -223,9 +217,7 @@ def bench():
yield clk.posedge
query_request_source.send([(0xc0a80111, )])
while query_response_sink.empty():
yield clk.posedge
yield query_response_sink.wait()
resp = query_response_sink.recv()
assert resp.data[0][0] == 0x0000c0a80111
assert not resp.user[0]
@ -233,9 +225,7 @@ def bench():
yield clk.posedge
query_request_source.send([(0xc0a80112, )])
while query_response_sink.empty():
yield clk.posedge
yield query_response_sink.wait()
resp = query_response_sink.recv()
assert resp.data[0][0] == 0x0000c0a80112
assert not resp.user[0]
@ -244,18 +234,14 @@ def bench():
yield clk.posedge
query_request_source.send([(0xc0a80121, )])
while query_response_sink.empty():
yield clk.posedge
yield query_response_sink.wait()
resp = query_response_sink.recv()
assert resp.user[0]
yield clk.posedge
query_request_source.send([(0xc0a80122, )])
while query_response_sink.empty():
yield clk.posedge
yield query_response_sink.wait()
resp = query_response_sink.recv()
assert resp.data[0][0] == 0x0000c0a80122
assert not resp.user[0]
@ -263,9 +249,7 @@ def bench():
yield clk.posedge
query_request_source.send([(0xc0a80123, )])
while query_response_sink.empty():
yield clk.posedge
yield query_response_sink.wait()
resp = query_response_sink.recv()
assert resp.data[0][0] == 0x0000c0a80123
assert not resp.user[0]

View File

@ -200,12 +200,8 @@ def bench():
test_frame.arp_tha = 0xDAD1D2D3D4D5
test_frame.arp_tpa = 0xc0a80165
source.send(test_frame.build_eth())
yield clk.posedge
yield output_frame_valid.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -232,12 +228,8 @@ def bench():
eth_frame = test_frame.build_eth()
eth_frame.payload.data += bytearray(range(10))
source.send(eth_frame)
yield clk.posedge
yield output_frame_valid.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -278,10 +270,7 @@ def bench():
yield clk.posedge
sink_pause.next = False
yield output_frame_valid.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -320,18 +309,13 @@ def bench():
test_frame2.arp_tpa = 0xc0a80165
source.send(test_frame1.build_eth())
source.send(test_frame2.build_eth())
yield clk.posedge
yield output_frame_valid.posedge
yield clk.posedge
yield output_frame_valid.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -381,13 +365,12 @@ def bench():
source_pause.next = False
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -437,13 +420,12 @@ def bench():
sink_pause.next = False
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2

View File

@ -203,12 +203,8 @@ def bench():
test_frame.arp_tha = 0xDAD1D2D3D4D5
test_frame.arp_tpa = 0xc0a80165
source.send(test_frame.build_eth())
yield clk.posedge
yield output_frame_valid.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -235,12 +231,8 @@ def bench():
eth_frame = test_frame.build_eth()
eth_frame.payload.data += bytearray(range(10))
source.send(eth_frame)
yield clk.posedge
yield output_frame_valid.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -281,10 +273,7 @@ def bench():
yield clk.posedge
sink_pause.next = False
#yield output_frame_valid.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -323,18 +312,13 @@ def bench():
test_frame2.arp_tpa = 0xc0a80165
source.send(test_frame1.build_eth())
source.send(test_frame2.build_eth())
yield clk.posedge
yield output_frame_valid.posedge
yield clk.posedge
yield output_frame_valid.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -384,13 +368,12 @@ def bench():
source_pause.next = False
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -440,13 +423,12 @@ def bench():
sink_pause.next = False
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2

View File

@ -188,12 +188,8 @@ def bench():
test_frame.arp_tha = 0xDAD1D2D3D4D5
test_frame.arp_tpa = 0xc0a80165
source.send(test_frame)
yield clk.posedge
yield output_eth_payload_tlast.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = arp_ep.ARPFrame()
@ -229,10 +225,7 @@ def bench():
yield clk.posedge
sink_pause.next = False
yield output_eth_payload_tlast.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = arp_ep.ARPFrame()
@ -273,20 +266,15 @@ def bench():
test_frame2.arp_tpa = 0xc0a80165
source.send(test_frame1)
source.send(test_frame2)
yield clk.posedge
yield output_eth_payload_tlast.posedge
yield clk.posedge
yield output_eth_payload_tlast.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = arp_ep.ARPFrame()
check_frame.parse_eth(rx_frame)
assert check_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
check_frame = arp_ep.ARPFrame()
@ -338,15 +326,14 @@ def bench():
sink_pause.next = False
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = arp_ep.ARPFrame()
check_frame.parse_eth(rx_frame)
assert check_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
check_frame = arp_ep.ARPFrame()

View File

@ -191,12 +191,8 @@ def bench():
test_frame.arp_tha = 0xDAD1D2D3D4D5
test_frame.arp_tpa = 0xc0a80165
source.send(test_frame)
yield clk.posedge
yield output_eth_payload_tlast.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = arp_ep.ARPFrame()
@ -232,10 +228,7 @@ def bench():
yield clk.posedge
sink_pause.next = False
yield output_eth_payload_tlast.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = arp_ep.ARPFrame()
@ -276,20 +269,15 @@ def bench():
test_frame2.arp_tpa = 0xc0a80165
source.send(test_frame1)
source.send(test_frame2)
yield clk.posedge
yield output_eth_payload_tlast.posedge
yield clk.posedge
yield output_eth_payload_tlast.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = arp_ep.ARPFrame()
check_frame.parse_eth(rx_frame)
assert check_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
check_frame = arp_ep.ARPFrame()
@ -341,15 +329,14 @@ def bench():
sink_pause.next = False
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = arp_ep.ARPFrame()
check_frame.parse_eth(rx_frame)
assert check_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
check_frame = arp_ep.ARPFrame()

View File

@ -194,10 +194,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -239,10 +236,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -252,6 +246,7 @@ def bench():
assert eth_frame == test_frame1
assert not rx_frame.user[-1]
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -295,14 +290,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.user[-1]
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -348,16 +341,14 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert error_bad_fcs_asserted
rx_frame = sink.recv()
assert rx_frame.user[-1]
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -387,10 +378,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert test_frame == bytearray(rx_frame)

View File

@ -200,10 +200,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -245,10 +242,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -258,6 +252,7 @@ def bench():
assert eth_frame == test_frame1
assert not rx_frame.user[-1]
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -301,14 +296,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.user[-1]
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -354,16 +347,14 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert error_bad_fcs_asserted
rx_frame = sink.recv()
assert rx_frame.user[-1]
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -393,10 +384,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert test_frame == bytearray(rx_frame)

View File

@ -186,10 +186,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -237,10 +234,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -256,6 +250,7 @@ def bench():
assert eth_frame.eth_type == test_frame1.eth_type
assert eth_frame.payload.data.index(test_frame1.payload.data) == 0
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -305,14 +300,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.user[-1]
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -346,10 +339,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
payload = rx_frame.data[:-4]

View File

@ -192,10 +192,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -243,10 +240,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -262,6 +256,7 @@ def bench():
assert eth_frame.eth_type == test_frame1.eth_type
assert eth_frame.payload.data.index(test_frame1.payload.data) == 0
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -311,14 +306,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.user[-1]
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -352,10 +345,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
payload = rx_frame.data[:-4]

View File

@ -192,10 +192,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -243,10 +240,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -262,6 +256,7 @@ def bench():
assert eth_frame.eth_type == test_frame1.eth_type
assert eth_frame.payload.data.index(test_frame1.payload.data) == 0
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -311,14 +306,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.user[-1]
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -352,10 +345,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
payload = rx_frame.data[:-4]

View File

@ -186,10 +186,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -237,10 +234,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -256,6 +250,7 @@ def bench():
assert eth_frame.eth_type == test_frame1.eth_type
assert eth_frame.payload.data.index(test_frame1.payload.data) == 0
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -305,14 +300,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.user[-1]
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -346,10 +339,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
payload = rx_frame.data[:-4]

View File

@ -180,20 +180,8 @@ def bench():
gmii_frame = gmii_ep.GMIIFrame(b'\x55\x55\x55\x55\x55\x55\x55\xD5'+bytearray(axis_frame))
source.send(gmii_frame)
yield clk.posedge
yield clk.posedge
while not clk_enable or not gmii_rx_dv:
yield clk.posedge
yield clk.posedge
while not clk_enable or gmii_rx_dv or output_axis_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -230,29 +218,8 @@ def bench():
source.send(gmii_frame1)
source.send(gmii_frame2)
yield clk.posedge
yield clk.posedge
while not clk_enable or not gmii_rx_dv:
yield clk.posedge
yield clk.posedge
while not clk_enable or gmii_rx_dv or output_axis_tvalid:
yield clk.posedge
yield clk.posedge
while not clk_enable or not gmii_rx_dv:
yield clk.posedge
yield clk.posedge
while not clk_enable or gmii_rx_dv or output_axis_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -261,6 +228,7 @@ def bench():
assert eth_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -303,36 +271,16 @@ def bench():
source.send(gmii_frame1)
source.send(gmii_frame2)
yield clk.posedge
yield clk.posedge
while not clk_enable or not gmii_rx_dv:
yield clk.posedge
yield clk.posedge
while not clk_enable or gmii_rx_dv or output_axis_tvalid:
yield clk.posedge
yield clk.posedge
while not clk_enable or not gmii_rx_dv:
yield clk.posedge
yield clk.posedge
while not clk_enable or gmii_rx_dv or output_axis_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert error_bad_frame_asserted
assert error_bad_fcs_asserted
rx_frame = sink.recv()
assert rx_frame.user[-1]
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -375,36 +323,16 @@ def bench():
source.send(gmii_frame1)
source.send(gmii_frame2)
yield clk.posedge
yield clk.posedge
while not clk_enable or not gmii_rx_dv:
yield clk.posedge
yield clk.posedge
while not clk_enable or gmii_rx_dv or output_axis_tvalid:
yield clk.posedge
yield clk.posedge
while not clk_enable or not gmii_rx_dv:
yield clk.posedge
yield clk.posedge
while not clk_enable or gmii_rx_dv or output_axis_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert error_bad_frame_asserted
assert not error_bad_fcs_asserted
rx_frame = sink.recv()
assert rx_frame.user[-1]
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()

View File

@ -176,20 +176,8 @@ def bench():
axis_frame = test_frame.build_axis()
source.send(axis_frame)
yield clk.posedge
yield clk.posedge
while not clk_enable:
yield clk.posedge
yield clk.posedge
while not clk_enable or gmii_tx_en or input_axis_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')
@ -233,29 +221,8 @@ def bench():
source.send(axis_frame1)
source.send(axis_frame2)
yield clk.posedge
yield clk.posedge
while not clk_enable:
yield clk.posedge
yield clk.posedge
while not clk_enable or gmii_tx_en or input_axis_tvalid:
yield clk.posedge
yield clk.posedge
while not clk_enable:
yield clk.posedge
yield clk.posedge
while not clk_enable or gmii_tx_en or input_axis_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')
@ -273,6 +240,7 @@ def bench():
assert eth_frame.eth_type == test_frame1.eth_type
assert eth_frame.payload.data.index(test_frame1.payload.data) == 0
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')
@ -318,29 +286,8 @@ def bench():
source.send(axis_frame1)
source.send(axis_frame2)
yield clk.posedge
yield clk.posedge
while not clk_enable:
yield clk.posedge
yield clk.posedge
while not clk_enable or gmii_tx_en or input_axis_tvalid:
yield clk.posedge
yield clk.posedge
while not clk_enable:
yield clk.posedge
yield clk.posedge
while not clk_enable or gmii_tx_en or input_axis_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')
@ -348,6 +295,7 @@ def bench():
# bad packet
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')

View File

@ -298,14 +298,8 @@ def bench():
test_frame.payload = bytearray(range(32))
source_0.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_eth_payload_tvalid or input_1_eth_payload_tvalid or input_2_eth_payload_tvalid or input_3_eth_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -323,14 +317,8 @@ def bench():
test_frame.payload = bytearray(range(32))
source_1.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_eth_payload_tvalid or input_1_eth_payload_tvalid or input_2_eth_payload_tvalid or input_3_eth_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -354,18 +342,13 @@ def bench():
source_0.send(test_frame1)
source_0.send(test_frame2)
yield clk.posedge
yield clk.posedge
while input_0_eth_payload_tvalid or input_1_eth_payload_tvalid or input_2_eth_payload_tvalid or input_3_eth_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -389,18 +372,13 @@ def bench():
source_1.send(test_frame1)
source_2.send(test_frame2)
yield clk.posedge
yield clk.posedge
while input_0_eth_payload_tvalid or input_1_eth_payload_tvalid or input_2_eth_payload_tvalid or input_3_eth_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -440,13 +418,13 @@ def bench():
source_2_pause.next = False
source_3_pause.next = False
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -480,14 +458,13 @@ def bench():
yield clk.posedge
sink_pause.next = False
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -521,31 +498,32 @@ def bench():
yield clk.posedge
source_1.send(test_frame1)
while input_0_eth_payload_tvalid or input_1_eth_payload_tvalid or input_2_eth_payload_tvalid or input_3_eth_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2

View File

@ -313,14 +313,8 @@ def bench():
test_frame.payload = bytearray(range(32))
source_0.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_eth_payload_tvalid or input_1_eth_payload_tvalid or input_2_eth_payload_tvalid or input_3_eth_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -338,14 +332,8 @@ def bench():
test_frame.payload = bytearray(range(32))
source_1.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_eth_payload_tvalid or input_1_eth_payload_tvalid or input_2_eth_payload_tvalid or input_3_eth_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -369,18 +357,13 @@ def bench():
source_0.send(test_frame1)
source_0.send(test_frame2)
yield clk.posedge
yield clk.posedge
while input_0_eth_payload_tvalid or input_1_eth_payload_tvalid or input_2_eth_payload_tvalid or input_3_eth_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -404,18 +387,13 @@ def bench():
source_1.send(test_frame1)
source_2.send(test_frame2)
yield clk.posedge
yield clk.posedge
while input_0_eth_payload_tvalid or input_1_eth_payload_tvalid or input_2_eth_payload_tvalid or input_3_eth_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -455,13 +433,13 @@ def bench():
source_2_pause.next = False
source_3_pause.next = False
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -495,14 +473,13 @@ def bench():
yield clk.posedge
sink_pause.next = False
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -536,31 +513,32 @@ def bench():
yield clk.posedge
source_1.send(test_frame1)
while input_0_eth_payload_tvalid or input_1_eth_payload_tvalid or input_2_eth_payload_tvalid or input_3_eth_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2

View File

@ -200,10 +200,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -238,14 +235,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -282,15 +277,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -330,14 +323,11 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert error_header_early_termination_asserted
rx_frame = sink.recv()
assert rx_frame == test_frame2
assert sink.empty()

View File

@ -206,10 +206,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -244,14 +241,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -288,15 +283,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -336,14 +329,11 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert error_header_early_termination_asserted
rx_frame = sink.recv()
assert rx_frame == test_frame2
assert sink.empty()

View File

@ -189,10 +189,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = eth_ep.EthFrame()
@ -227,10 +224,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = eth_ep.EthFrame()
@ -238,6 +232,7 @@ def bench():
assert check_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
check_frame = eth_ep.EthFrame()
@ -274,10 +269,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = eth_ep.EthFrame()
@ -286,6 +278,7 @@ def bench():
assert check_frame == test_frame1
assert rx_frame.user[-1]
yield sink.wait()
rx_frame = sink.recv()
check_frame = eth_ep.EthFrame()

View File

@ -195,10 +195,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = eth_ep.EthFrame()
@ -233,10 +230,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = eth_ep.EthFrame()
@ -244,6 +238,7 @@ def bench():
assert check_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
check_frame = eth_ep.EthFrame()
@ -280,10 +275,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = eth_ep.EthFrame()
@ -292,6 +284,7 @@ def bench():
assert check_frame == test_frame1
assert rx_frame.user[-1]
yield sink.wait()
rx_frame = sink.recv()
check_frame = eth_ep.EthFrame()

View File

@ -304,13 +304,8 @@ def bench():
test_frame.payload = bytearray(range(32))
source.send(test_frame)
yield clk.posedge
while input_eth_payload_tvalid or input_eth_hdr_valid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink_0.wait()
rx_frame = sink_0.recv()
assert rx_frame == test_frame
@ -330,13 +325,8 @@ def bench():
test_frame.payload = bytearray(range(32))
source.send(test_frame)
yield clk.posedge
while input_eth_payload_tvalid or input_eth_hdr_valid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame
@ -362,17 +352,13 @@ def bench():
source.send(test_frame1)
source.send(test_frame2)
yield clk.posedge
while input_eth_payload_tvalid or input_eth_hdr_valid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink_0.wait()
rx_frame = sink_0.recv()
assert rx_frame == test_frame1
yield sink_0.wait()
rx_frame = sink_0.recv()
assert rx_frame == test_frame2
@ -403,13 +389,13 @@ def bench():
while input_eth_payload_tvalid or input_eth_hdr_valid:
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame1
yield sink_2.wait()
rx_frame = sink_2.recv()
assert rx_frame == test_frame2
@ -445,13 +431,13 @@ def bench():
source_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame1
yield sink_2.wait()
rx_frame = sink_2.recv()
assert rx_frame == test_frame2
@ -493,13 +479,13 @@ def bench():
sink_3_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame1
yield sink_2.wait()
rx_frame = sink_2.recv()
assert rx_frame == test_frame2

View File

@ -319,13 +319,8 @@ def bench():
test_frame.payload = bytearray(range(32))
source.send(test_frame)
yield clk.posedge
while input_eth_payload_tvalid or input_eth_hdr_valid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink_0.wait()
rx_frame = sink_0.recv()
assert rx_frame == test_frame
@ -345,13 +340,8 @@ def bench():
test_frame.payload = bytearray(range(32))
source.send(test_frame)
yield clk.posedge
while input_eth_payload_tvalid or input_eth_hdr_valid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame
@ -377,17 +367,13 @@ def bench():
source.send(test_frame1)
source.send(test_frame2)
yield clk.posedge
while input_eth_payload_tvalid or input_eth_hdr_valid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink_0.wait()
rx_frame = sink_0.recv()
assert rx_frame == test_frame1
yield sink_0.wait()
rx_frame = sink_0.recv()
assert rx_frame == test_frame2
@ -418,13 +404,13 @@ def bench():
while input_eth_payload_tvalid or input_eth_hdr_valid:
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame1
yield sink_2.wait()
rx_frame = sink_2.recv()
assert rx_frame == test_frame2
@ -460,13 +446,13 @@ def bench():
source_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame1
yield sink_2.wait()
rx_frame = sink_2.recv()
assert rx_frame == test_frame2
@ -508,13 +494,13 @@ def bench():
sink_3_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame1
yield sink_2.wait()
rx_frame = sink_2.recv()
assert rx_frame == test_frame2

View File

@ -212,15 +212,8 @@ def bench():
axis_frame = test_frame.build_axis_fcs()
xgmii_source.send(b'\x55\x55\x55\x55\x55\x55\x55\xD5'+bytearray(axis_frame))
yield clk.posedge
yield clk.posedge
while xgmii_rxc != 0xff or rx_axis_tvalid or not xgmii_source.empty():
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield axis_sink.wait()
rx_frame = axis_sink.recv()
eth_frame = eth_ep.EthFrame()
@ -245,15 +238,8 @@ def bench():
axis_frame = test_frame.build_axis()
axis_source.send(axis_frame)
yield clk.posedge
yield clk.posedge
while xgmii_txc != 0xff or tx_axis_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield xgmii_sink.wait()
rx_frame = xgmii_sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')

View File

@ -240,20 +240,8 @@ def bench():
axis_frame = test_frame.build_axis_fcs()
xgmii_source.send(b'\x55\x55\x55\x55\x55\x55\x55\xD5'+bytearray(axis_frame))
yield clk.posedge
yield clk.posedge
while xgmii_rxc != 0xff:
yield clk.posedge
yield delay(100)
while rx_axis_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield axis_sink.wait()
rx_frame = axis_sink.recv()
eth_frame = eth_ep.EthFrame()
@ -278,20 +266,8 @@ def bench():
axis_frame = test_frame.build_axis()
axis_source.send(axis_frame)
yield clk.posedge
yield clk.posedge
while tx_axis_tvalid:
yield clk.posedge
yield delay(100)
while xgmii_txc != 0xff:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield xgmii_sink.wait()
rx_frame = xgmii_sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')

View File

@ -158,16 +158,8 @@ def bench():
xgmii_frame = xgmii_ep.XGMIIFrame(b'\x55\x55\x55\x55\x55\x55\x55\xD5'+bytearray(axis_frame))
source.send(xgmii_frame)
yield clk.posedge
yield clk.posedge
while xgmii_rxc != 0xff or output_axis_tvalid or not source.empty():
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -205,21 +197,8 @@ def bench():
source.send(xgmii_frame1)
source.send(xgmii_frame2)
yield clk.posedge
yield clk.posedge
while xgmii_rxc != 0xff or output_axis_tvalid or not source.empty():
yield clk.posedge
yield clk.posedge
while xgmii_rxc != 0xff or output_axis_tvalid or not source.empty():
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -228,6 +207,7 @@ def bench():
assert eth_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -270,28 +250,16 @@ def bench():
source.send(xgmii_frame1)
source.send(xgmii_frame2)
yield clk.posedge
yield clk.posedge
while xgmii_rxc != 0xff or output_axis_tvalid or not source.empty():
yield clk.posedge
yield clk.posedge
while xgmii_rxc != 0xff or output_axis_tvalid or not source.empty():
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert error_bad_frame_asserted
assert error_bad_fcs_asserted
rx_frame = sink.recv()
assert rx_frame.user[-1]
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -334,28 +302,16 @@ def bench():
source.send(xgmii_frame1)
source.send(xgmii_frame2)
yield clk.posedge
yield clk.posedge
while xgmii_rxc != 0xff or output_axis_tvalid or not source.empty():
yield clk.posedge
yield clk.posedge
while xgmii_rxc != 0xff or output_axis_tvalid or not source.empty():
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert error_bad_frame_asserted
assert not error_bad_fcs_asserted
rx_frame = sink.recv()
assert rx_frame.last_cycle_user
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()

View File

@ -151,16 +151,8 @@ def bench():
axis_frame = test_frame.build_axis()
source.send(axis_frame)
yield clk.posedge
yield clk.posedge
while xgmii_txc != 0xff or input_axis_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')
@ -204,16 +196,8 @@ def bench():
source.send(axis_frame1)
source.send(axis_frame2)
yield clk.posedge
yield clk.posedge
while xgmii_txc != 0xff or input_axis_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')
@ -231,6 +215,7 @@ def bench():
assert eth_frame.eth_type == test_frame1.eth_type
assert eth_frame.payload.data.index(test_frame1.payload.data) == 0
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')
@ -276,16 +261,8 @@ def bench():
source.send(axis_frame1)
source.send(axis_frame2)
yield clk.posedge
yield clk.posedge
while xgmii_txc != 0xff or input_axis_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')
@ -293,6 +270,7 @@ def bench():
# bad packet
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')

View File

@ -254,20 +254,8 @@ def bench():
axis_frame = test_frame.build_axis_fcs()
gmii_source.send(b'\x55\x55\x55\x55\x55\x55\x55\xD5'+bytearray(axis_frame))
yield clk.posedge
yield clk.posedge
while not rx_clk_enable or not tx_clk_enable or not (gmii_rx_dv or gmii_tx_en):
yield clk.posedge
yield clk.posedge
while not rx_clk_enable or not tx_clk_enable or gmii_rx_dv or gmii_tx_en or tx_axis_tvalid or rx_axis_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield axis_sink.wait()
rx_frame = axis_sink.recv()
eth_frame = eth_ep.EthFrame()
@ -292,20 +280,8 @@ def bench():
axis_frame = test_frame.build_axis()
axis_source.send(axis_frame)
yield clk.posedge
yield clk.posedge
while not rx_clk_enable or not tx_clk_enable or not (gmii_rx_dv or gmii_tx_en):
yield clk.posedge
yield clk.posedge
while not rx_clk_enable or not tx_clk_enable or gmii_rx_dv or gmii_tx_en or tx_axis_tvalid or rx_axis_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield gmii_sink.wait()
rx_frame = gmii_sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')

View File

@ -282,24 +282,8 @@ def bench():
axis_frame = test_frame.build_axis_fcs()
gmii_source.send(b'\x55\x55\x55\x55\x55\x55\x55\xD5'+bytearray(axis_frame))
yield clk.posedge
yield clk.posedge
while not rx_clk_enable or not tx_clk_enable or not (gmii_rx_dv or gmii_tx_en):
yield clk.posedge
yield clk.posedge
while not rx_clk_enable or not tx_clk_enable or gmii_rx_dv or gmii_tx_en or tx_axis_tvalid or rx_axis_tvalid:
yield clk.posedge
yield delay(100)
while rx_axis_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield axis_sink.wait()
rx_frame = axis_sink.recv()
eth_frame = eth_ep.EthFrame()
@ -324,19 +308,8 @@ def bench():
axis_frame = test_frame.build_axis()
axis_source.send(axis_frame)
yield clk.posedge
yield clk.posedge
while not rx_clk_enable or not tx_clk_enable or not (gmii_rx_dv or gmii_tx_en):
yield clk.posedge
yield clk.posedge
while not rx_clk_enable or not tx_clk_enable or gmii_rx_dv or gmii_tx_en or tx_axis_tvalid or rx_axis_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield gmii_sink.wait()
rx_frame = gmii_sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')

View File

@ -258,20 +258,8 @@ def bench():
axis_frame = test_frame.build_axis_fcs()
gmii_source.send(b'\x55\x55\x55\x55\x55\x55\x55\xD5'+bytearray(axis_frame))
yield gmii_rx_clk.posedge
yield gmii_rx_clk.posedge
while not (gmii_rx_dv or gmii_tx_en):
yield gmii_rx_clk.posedge
yield gmii_rx_clk.posedge
while gmii_rx_dv or gmii_tx_en or tx_axis_tvalid or rx_axis_tvalid:
yield gmii_rx_clk.posedge
yield gmii_rx_clk.posedge
yield gmii_rx_clk.posedge
yield gmii_rx_clk.posedge
yield axis_sink.wait()
rx_frame = axis_sink.recv()
eth_frame = eth_ep.EthFrame()
@ -296,20 +284,8 @@ def bench():
axis_frame = test_frame.build_axis()
axis_source.send(axis_frame)
yield gmii_rx_clk.posedge
yield gmii_rx_clk.posedge
while not (gmii_rx_dv or gmii_tx_en):
yield gmii_rx_clk.posedge
yield gmii_rx_clk.posedge
while gmii_rx_dv or gmii_tx_en or tx_axis_tvalid or rx_axis_tvalid:
yield gmii_rx_clk.posedge
yield gmii_rx_clk.posedge
yield gmii_rx_clk.posedge
yield gmii_rx_clk.posedge
yield gmii_sink.wait()
rx_frame = gmii_sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')

View File

@ -280,21 +280,8 @@ def bench():
axis_frame = test_frame.build_axis_fcs()
gmii_source.send(b'\x55\x55\x55\x55\x55\x55\x55\xD5'+bytearray(axis_frame))
yield gmii_rx_clk.posedge
yield gmii_rx_clk.posedge
while gmii_rx_dv:
yield gmii_rx_clk.posedge
for k in range(10):
yield gmii_rx_clk.posedge
while rx_axis_tvalid:
yield gmii_rx_clk.posedge
yield gmii_rx_clk.posedge
yield gmii_rx_clk.posedge
yield axis_sink.wait()
rx_frame = axis_sink.recv()
eth_frame = eth_ep.EthFrame()
@ -319,21 +306,8 @@ def bench():
axis_frame = test_frame.build_axis()
axis_source.send(axis_frame)
yield gmii_rx_clk.posedge
yield gmii_rx_clk.posedge
while tx_axis_tvalid:
yield gmii_rx_clk.posedge
for k in range(10):
yield gmii_rx_clk.posedge
while gmii_tx_en:
yield gmii_rx_clk.posedge
yield gmii_rx_clk.posedge
yield gmii_rx_clk.posedge
yield gmii_sink.wait()
rx_frame = gmii_sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')

View File

@ -260,20 +260,8 @@ def bench():
axis_frame = test_frame.build_axis_fcs()
rgmii_source.send(b'\x55\x55\x55\x55\x55\x55\x55\xD5'+bytearray(axis_frame))
yield rgmii_rx_clk.posedge
yield rgmii_rx_clk.posedge
while not (rgmii_rx_ctl or rgmii_tx_ctl):
yield rgmii_rx_clk.posedge
yield rgmii_rx_clk.posedge
while rgmii_rx_ctl or rgmii_tx_ctl or tx_axis_tvalid or rx_axis_tvalid:
yield rgmii_rx_clk.posedge
yield rgmii_rx_clk.posedge
yield rgmii_rx_clk.posedge
yield rgmii_rx_clk.posedge
yield axis_sink.wait()
rx_frame = axis_sink.recv()
eth_frame = eth_ep.EthFrame()
@ -298,20 +286,8 @@ def bench():
axis_frame = test_frame.build_axis()
axis_source.send(axis_frame)
yield rgmii_rx_clk.posedge
yield rgmii_rx_clk.posedge
while not (rgmii_rx_ctl or rgmii_tx_ctl):
yield rgmii_rx_clk.posedge
yield rgmii_rx_clk.posedge
while rgmii_rx_ctl or rgmii_tx_ctl or tx_axis_tvalid or rx_axis_tvalid:
yield rgmii_rx_clk.posedge
yield rgmii_rx_clk.posedge
yield rgmii_rx_clk.posedge
yield rgmii_rx_clk.posedge
yield rgmii_sink.wait()
rx_frame = rgmii_sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')

View File

@ -277,23 +277,8 @@ def bench():
axis_frame = test_frame.build_axis_fcs()
rgmii_source.send(b'\x55\x55\x55\x55\x55\x55\x55\xD5'+bytearray(axis_frame))
yield rgmii_rx_clk.posedge
yield rgmii_rx_clk.posedge
yield rgmii_rx_clk.posedge
while rgmii_rx_ctl:
yield rgmii_rx_clk.posedge
for k in range(10):
yield rgmii_rx_clk.posedge
while rx_axis_tvalid:
yield rgmii_rx_clk.posedge
yield rgmii_rx_clk.posedge
yield rgmii_rx_clk.posedge
yield rgmii_rx_clk.posedge
yield axis_sink.wait()
rx_frame = axis_sink.recv()
eth_frame = eth_ep.EthFrame()
@ -318,23 +303,8 @@ def bench():
axis_frame = test_frame.build_axis()
axis_source.send(axis_frame)
yield rgmii_rx_clk.posedge
yield rgmii_rx_clk.posedge
yield rgmii_rx_clk.posedge
while tx_axis_tvalid:
yield rgmii_rx_clk.posedge
for k in range(10):
yield rgmii_rx_clk.posedge
while rgmii_tx_ctl:
yield rgmii_rx_clk.posedge
yield rgmii_rx_clk.posedge
yield rgmii_rx_clk.posedge
yield rgmii_rx_clk.posedge
yield rgmii_sink.wait()
rx_frame = rgmii_sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')

View File

@ -155,16 +155,8 @@ def bench():
gmii_frame = gmii_ep.GMIIFrame(b'\x55\x55\x55\x55\x55\x55\x55\xD5'+bytearray(axis_frame))
source.send(gmii_frame)
yield clk.posedge
yield clk.posedge
while gmii_rx_dv or output_axis_tvalid or not source.empty():
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -201,21 +193,8 @@ def bench():
source.send(gmii_frame1)
source.send(gmii_frame2)
yield clk.posedge
yield clk.posedge
while gmii_rx_dv or output_axis_tvalid or not source.empty():
yield clk.posedge
yield clk.posedge
while gmii_rx_dv or output_axis_tvalid or not source.empty():
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -224,6 +203,7 @@ def bench():
assert eth_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -266,28 +246,16 @@ def bench():
source.send(gmii_frame1)
source.send(gmii_frame2)
yield clk.posedge
yield clk.posedge
while gmii_rx_dv or output_axis_tvalid or not source.empty():
yield clk.posedge
yield clk.posedge
while gmii_rx_dv or output_axis_tvalid or not source.empty():
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert error_bad_frame_asserted
assert error_bad_fcs_asserted
rx_frame = sink.recv()
assert rx_frame.user[-1]
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
@ -330,28 +298,16 @@ def bench():
source.send(gmii_frame1)
source.send(gmii_frame2)
yield clk.posedge
yield clk.posedge
while gmii_rx_dv or output_axis_tvalid or not source.empty():
yield clk.posedge
yield clk.posedge
while gmii_rx_dv or output_axis_tvalid or not source.empty():
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert error_bad_frame_asserted
assert not error_bad_fcs_asserted
rx_frame = sink.recv()
assert rx_frame.last_cycle_user
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()

View File

@ -151,16 +151,8 @@ def bench():
axis_frame = test_frame.build_axis()
source.send(axis_frame)
yield clk.posedge
yield clk.posedge
while gmii_tx_en or input_axis_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')
@ -204,16 +196,8 @@ def bench():
source.send(axis_frame1)
source.send(axis_frame2)
yield clk.posedge
yield clk.posedge
while gmii_tx_en or input_axis_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')
@ -231,6 +215,7 @@ def bench():
assert eth_frame.eth_type == test_frame1.eth_type
assert eth_frame.payload.data.index(test_frame1.payload.data) == 0
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')
@ -276,16 +261,8 @@ def bench():
source.send(axis_frame1)
source.send(axis_frame2)
yield clk.posedge
yield clk.posedge
while gmii_tx_en or input_axis_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')
@ -293,6 +270,7 @@ def bench():
# bad packet
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.data[0:8] == bytearray(b'\x55\x55\x55\x55\x55\x55\x55\xD5')

View File

@ -304,14 +304,8 @@ def bench():
test_frame.payload = bytearray(range(32))
source_0.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_eth_payload_tvalid or input_1_eth_payload_tvalid or input_2_eth_payload_tvalid or input_3_eth_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -331,14 +325,8 @@ def bench():
test_frame.payload = bytearray(range(32))
source_1.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_eth_payload_tvalid or input_1_eth_payload_tvalid or input_2_eth_payload_tvalid or input_3_eth_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -364,18 +352,13 @@ def bench():
source_0.send(test_frame1)
source_0.send(test_frame2)
yield clk.posedge
yield clk.posedge
while input_0_eth_payload_tvalid or input_1_eth_payload_tvalid or input_2_eth_payload_tvalid or input_3_eth_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -407,13 +390,13 @@ def bench():
while input_0_eth_payload_tvalid or input_1_eth_payload_tvalid or input_2_eth_payload_tvalid or input_3_eth_payload_tvalid:
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -456,13 +439,13 @@ def bench():
source_3_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -499,14 +482,13 @@ def bench():
sink_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2

View File

@ -319,14 +319,8 @@ def bench():
test_frame.payload = bytearray(range(32))
source_0.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_eth_payload_tvalid or input_1_eth_payload_tvalid or input_2_eth_payload_tvalid or input_3_eth_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -346,14 +340,8 @@ def bench():
test_frame.payload = bytearray(range(32))
source_1.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_eth_payload_tvalid or input_1_eth_payload_tvalid or input_2_eth_payload_tvalid or input_3_eth_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -379,18 +367,13 @@ def bench():
source_0.send(test_frame1)
source_0.send(test_frame2)
yield clk.posedge
yield clk.posedge
while input_0_eth_payload_tvalid or input_1_eth_payload_tvalid or input_2_eth_payload_tvalid or input_3_eth_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -422,13 +405,13 @@ def bench():
while input_0_eth_payload_tvalid or input_1_eth_payload_tvalid or input_2_eth_payload_tvalid or input_3_eth_payload_tvalid:
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -471,13 +454,13 @@ def bench():
source_3_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -514,14 +497,13 @@ def bench():
sink_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2

View File

@ -433,14 +433,7 @@ def bench():
eth_source.send(eth_frame)
yield clk.posedge
yield clk.posedge
yield wait_normal()
yield clk.posedge
yield clk.posedge
yield ip_sink.wait()
rx_frame = ip_sink.recv()
assert rx_frame == test_frame
@ -478,14 +471,7 @@ def bench():
ip_source.send(test_frame)
yield clk.posedge
yield clk.posedge
yield wait_normal()
yield clk.posedge
yield clk.posedge
yield eth_sink.wait()
rx_frame = eth_sink.recv()
check_frame = ip_ep.IPFrame()

View File

@ -445,14 +445,7 @@ def bench():
eth_source.send(eth_frame)
yield clk.posedge
yield clk.posedge
yield wait_normal()
yield clk.posedge
yield clk.posedge
yield ip_sink.wait()
rx_frame = ip_sink.recv()
assert rx_frame == test_frame
@ -490,14 +483,7 @@ def bench():
ip_source.send(test_frame)
yield clk.posedge
yield clk.posedge
yield wait_normal()
yield clk.posedge
yield clk.posedge
yield eth_sink.wait()
rx_frame = eth_sink.recv()
check_frame = ip_ep.IPFrame()

View File

@ -507,14 +507,8 @@ def bench():
test_frame.build()
source_0.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_ip_payload_tvalid or input_1_ip_payload_tvalid or input_2_ip_payload_tvalid or input_3_ip_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -546,14 +540,8 @@ def bench():
test_frame.build()
source_1.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_ip_payload_tvalid or input_1_ip_payload_tvalid or input_2_ip_payload_tvalid or input_3_ip_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -605,18 +593,13 @@ def bench():
source_0.send(test_frame1)
source_0.send(test_frame2)
yield clk.posedge
yield clk.posedge
while input_0_ip_payload_tvalid or input_1_ip_payload_tvalid or input_2_ip_payload_tvalid or input_3_ip_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -668,18 +651,13 @@ def bench():
source_1.send(test_frame1)
source_2.send(test_frame2)
yield clk.posedge
yield clk.posedge
while input_0_ip_payload_tvalid or input_1_ip_payload_tvalid or input_2_ip_payload_tvalid or input_3_ip_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -747,13 +725,13 @@ def bench():
source_2_pause.next = False
source_3_pause.next = False
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -815,14 +793,13 @@ def bench():
yield clk.posedge
sink_pause.next = False
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -884,31 +861,32 @@ def bench():
yield clk.posedge
source_1.send(test_frame1)
while input_0_ip_payload_tvalid or input_1_ip_payload_tvalid or input_2_ip_payload_tvalid or input_3_ip_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2

View File

@ -522,14 +522,8 @@ def bench():
test_frame.build()
source_0.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_ip_payload_tvalid or input_1_ip_payload_tvalid or input_2_ip_payload_tvalid or input_3_ip_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -561,14 +555,8 @@ def bench():
test_frame.build()
source_1.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_ip_payload_tvalid or input_1_ip_payload_tvalid or input_2_ip_payload_tvalid or input_3_ip_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -620,18 +608,13 @@ def bench():
source_0.send(test_frame1)
source_0.send(test_frame2)
yield clk.posedge
yield clk.posedge
while input_0_ip_payload_tvalid or input_1_ip_payload_tvalid or input_2_ip_payload_tvalid or input_3_ip_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -683,18 +666,13 @@ def bench():
source_1.send(test_frame1)
source_2.send(test_frame2)
yield clk.posedge
yield clk.posedge
while input_0_ip_payload_tvalid or input_1_ip_payload_tvalid or input_2_ip_payload_tvalid or input_3_ip_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -762,13 +740,13 @@ def bench():
source_2_pause.next = False
source_3_pause.next = False
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -830,14 +808,13 @@ def bench():
yield clk.posedge
sink_pause.next = False
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -899,31 +876,32 @@ def bench():
yield clk.posedge
source_1.send(test_frame1)
while input_0_ip_payload_tvalid or input_1_ip_payload_tvalid or input_2_ip_payload_tvalid or input_3_ip_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2

View File

@ -396,14 +396,7 @@ def bench():
eth_source.send(eth_frame)
yield clk.posedge
yield clk.posedge
yield wait_normal()
yield clk.posedge
yield clk.posedge
yield ip_sink.wait()
rx_frame = ip_sink.recv()
assert rx_frame == test_frame
@ -443,9 +436,7 @@ def bench():
ip_source.send(test_frame)
# wait for ARP request packet
while eth_sink.empty():
yield clk.posedge
yield eth_sink.wait()
rx_frame = eth_sink.recv()
check_frame = arp_ep.ARPFrame()
check_frame.parse_eth(rx_frame)
@ -479,14 +470,7 @@ def bench():
arp_frame.arp_tpa = 0xc0a80164
eth_source.send(arp_frame.build_eth())
yield clk.posedge
yield clk.posedge
yield wait_normal()
yield clk.posedge
yield clk.posedge
yield eth_sink.wait()
rx_frame = eth_sink.recv()
check_frame = ip_ep.IPFrame()

View File

@ -408,14 +408,7 @@ def bench():
eth_source.send(eth_frame)
yield clk.posedge
yield clk.posedge
yield wait_normal()
yield clk.posedge
yield clk.posedge
yield ip_sink.wait()
rx_frame = ip_sink.recv()
assert rx_frame == test_frame
@ -455,9 +448,7 @@ def bench():
ip_source.send(test_frame)
# wait for ARP request packet
while eth_sink.empty():
yield clk.posedge
yield eth_sink.wait()
rx_frame = eth_sink.recv()
check_frame = arp_ep.ARPFrame()
check_frame.parse_eth(rx_frame)
@ -491,14 +482,7 @@ def bench():
arp_frame.arp_tpa = 0xc0a80164
eth_source.send(arp_frame.build_eth())
yield clk.posedge
yield clk.posedge
yield wait_normal()
yield clk.posedge
yield clk.posedge
yield eth_sink.wait()
rx_frame = eth_sink.recv()
check_frame = ip_ep.IPFrame()

View File

@ -513,13 +513,8 @@ def bench():
test_frame.build()
source.send(test_frame)
yield clk.posedge
while input_ip_payload_tvalid or input_ip_hdr_valid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink_0.wait()
rx_frame = sink_0.recv()
assert rx_frame == test_frame
@ -553,13 +548,8 @@ def bench():
test_frame.build()
source.send(test_frame)
yield clk.posedge
while input_ip_payload_tvalid or input_ip_hdr_valid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame
@ -613,17 +603,13 @@ def bench():
source.send(test_frame1)
source.send(test_frame2)
yield clk.posedge
while input_ip_payload_tvalid or input_ip_hdr_valid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink_0.wait()
rx_frame = sink_0.recv()
assert rx_frame == test_frame1
yield sink_0.wait()
rx_frame = sink_0.recv()
assert rx_frame == test_frame2
@ -682,13 +668,13 @@ def bench():
while input_ip_payload_tvalid or input_ip_hdr_valid:
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame1
yield sink_2.wait()
rx_frame = sink_2.recv()
assert rx_frame == test_frame2
@ -752,13 +738,13 @@ def bench():
source_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame1
yield sink_2.wait()
rx_frame = sink_2.recv()
assert rx_frame == test_frame2
@ -828,13 +814,13 @@ def bench():
sink_3_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame1
yield sink_2.wait()
rx_frame = sink_2.recv()
assert rx_frame == test_frame2

View File

@ -528,13 +528,8 @@ def bench():
test_frame.build()
source.send(test_frame)
yield clk.posedge
while input_ip_payload_tvalid or input_ip_hdr_valid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink_0.wait()
rx_frame = sink_0.recv()
assert rx_frame == test_frame
@ -568,13 +563,8 @@ def bench():
test_frame.build()
source.send(test_frame)
yield clk.posedge
while input_ip_payload_tvalid or input_ip_hdr_valid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame
@ -628,17 +618,13 @@ def bench():
source.send(test_frame1)
source.send(test_frame2)
yield clk.posedge
while input_ip_payload_tvalid or input_ip_hdr_valid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink_0.wait()
rx_frame = sink_0.recv()
assert rx_frame == test_frame1
yield sink_0.wait()
rx_frame = sink_0.recv()
assert rx_frame == test_frame2
@ -697,13 +683,13 @@ def bench():
while input_ip_payload_tvalid or input_ip_hdr_valid:
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame1
yield sink_2.wait()
rx_frame = sink_2.recv()
assert rx_frame == test_frame2
@ -767,13 +753,13 @@ def bench():
source_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame1
yield sink_2.wait()
rx_frame = sink_2.recv()
assert rx_frame == test_frame2
@ -843,13 +829,13 @@ def bench():
sink_3_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame1
yield sink_2.wait()
rx_frame = sink_2.recv()
assert rx_frame == test_frame2

View File

@ -280,10 +280,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -342,14 +339,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -410,15 +405,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -479,14 +472,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -547,14 +538,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -616,15 +605,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -686,15 +673,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -757,15 +742,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.payload.user[-1]
assert error_payload_early_termination_asserted
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -828,15 +811,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.payload.user[-1]
assert error_payload_early_termination_asserted
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -897,14 +878,11 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert error_invalid_header_asserted
rx_frame = sink.recv()
assert rx_frame == test_frame2
assert sink.empty()
@ -963,14 +941,11 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert error_invalid_checksum_asserted
rx_frame = sink.recv()
assert rx_frame == test_frame2
assert sink.empty()
@ -1032,14 +1007,11 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert error_header_early_termination_asserted
rx_frame = sink.recv()
assert rx_frame == test_frame2
assert sink.empty()

View File

@ -286,10 +286,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -348,14 +345,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -416,15 +411,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -485,14 +478,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -553,14 +544,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -622,15 +611,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -692,15 +679,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -763,15 +748,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.payload.user[-1]
assert error_payload_early_termination_asserted
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -834,15 +817,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.payload.user[-1]
assert error_payload_early_termination_asserted
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -903,14 +884,11 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert error_invalid_header_asserted
rx_frame = sink.recv()
assert rx_frame == test_frame2
assert sink.empty()
@ -969,14 +947,11 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert error_invalid_checksum_asserted
rx_frame = sink.recv()
assert rx_frame == test_frame2
assert sink.empty()
@ -1038,14 +1013,11 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert error_header_early_termination_asserted
rx_frame = sink.recv()
assert rx_frame == test_frame2
assert sink.empty()

View File

@ -255,10 +255,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -317,10 +314,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -328,6 +322,7 @@ def bench():
assert check_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -388,10 +383,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -400,6 +392,7 @@ def bench():
assert check_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -461,10 +454,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -472,6 +462,7 @@ def bench():
assert check_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -533,10 +524,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -544,6 +532,7 @@ def bench():
assert check_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -606,10 +595,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -618,6 +604,7 @@ def bench():
assert check_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -680,10 +667,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -692,6 +676,7 @@ def bench():
assert check_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -755,15 +740,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.payload.user[-1]
assert error_payload_early_termination_asserted
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -827,15 +810,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.payload.user[-1]
assert error_payload_early_termination_asserted
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()

View File

@ -261,10 +261,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -323,10 +320,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -334,6 +328,7 @@ def bench():
assert check_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -394,10 +389,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -406,6 +398,7 @@ def bench():
assert check_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -467,10 +460,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -478,6 +468,7 @@ def bench():
assert check_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -539,10 +530,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -550,6 +538,7 @@ def bench():
assert check_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -612,10 +601,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -624,6 +610,7 @@ def bench():
assert check_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -686,10 +673,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -698,6 +682,7 @@ def bench():
assert check_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -761,15 +746,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.payload.user[-1]
assert error_payload_early_termination_asserted
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()
@ -833,15 +816,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.payload.user[-1]
assert error_payload_early_termination_asserted
yield sink.wait()
rx_frame = sink.recv()
check_frame = ip_ep.IPFrame()

View File

@ -513,14 +513,8 @@ def bench():
test_frame.build()
source_0.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_ip_payload_tvalid or input_1_ip_payload_tvalid or input_2_ip_payload_tvalid or input_3_ip_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -554,14 +548,8 @@ def bench():
test_frame.build()
source_1.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_ip_payload_tvalid or input_1_ip_payload_tvalid or input_2_ip_payload_tvalid or input_3_ip_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -615,18 +603,13 @@ def bench():
source_0.send(test_frame1)
source_0.send(test_frame2)
yield clk.posedge
yield clk.posedge
while input_0_ip_payload_tvalid or input_1_ip_payload_tvalid or input_2_ip_payload_tvalid or input_3_ip_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -686,13 +669,13 @@ def bench():
while input_0_ip_payload_tvalid or input_1_ip_payload_tvalid or input_2_ip_payload_tvalid or input_3_ip_payload_tvalid:
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -763,13 +746,13 @@ def bench():
source_3_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -834,14 +817,13 @@ def bench():
sink_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2

View File

@ -528,14 +528,8 @@ def bench():
test_frame.build()
source_0.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_ip_payload_tvalid or input_1_ip_payload_tvalid or input_2_ip_payload_tvalid or input_3_ip_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -569,14 +563,8 @@ def bench():
test_frame.build()
source_1.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_ip_payload_tvalid or input_1_ip_payload_tvalid or input_2_ip_payload_tvalid or input_3_ip_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -630,18 +618,13 @@ def bench():
source_0.send(test_frame1)
source_0.send(test_frame2)
yield clk.posedge
yield clk.posedge
while input_0_ip_payload_tvalid or input_1_ip_payload_tvalid or input_2_ip_payload_tvalid or input_3_ip_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -701,13 +684,13 @@ def bench():
while input_0_ip_payload_tvalid or input_1_ip_payload_tvalid or input_2_ip_payload_tvalid or input_3_ip_payload_tvalid:
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -778,13 +761,13 @@ def bench():
source_3_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -849,14 +832,13 @@ def bench():
sink_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2

View File

@ -435,16 +435,6 @@ def bench():
if (tx_error_payload_early_termination):
tx_error_payload_early_termination_asserted.next = 1
def wait_normal():
i = 8
while i > 0:
i = max(0, i-1)
if (input_ip_payload_tvalid or input_udp_payload_tvalid or
output_ip_payload_tvalid or output_udp_payload_tvalid or
input_ip_hdr_valid or input_udp_hdr_valid):
i = 8
yield clk.posedge
@instance
def check():
yield delay(100)
@ -485,14 +475,7 @@ def bench():
ip_source.send(ip_frame)
yield clk.posedge
yield clk.posedge
yield wait_normal()
yield clk.posedge
yield clk.posedge
yield udp_sink.wait()
rx_frame = udp_sink.recv()
assert rx_frame == test_frame
@ -532,14 +515,7 @@ def bench():
udp_source.send(test_frame)
yield clk.posedge
yield clk.posedge
yield wait_normal()
yield clk.posedge
yield clk.posedge
yield ip_sink.wait()
rx_frame = ip_sink.recv()
check_frame = udp_ep.UDPFrame()

View File

@ -447,16 +447,6 @@ def bench():
if (tx_error_payload_early_termination):
tx_error_payload_early_termination_asserted.next = 1
def wait_normal():
i = 8
while i > 0:
i = max(0, i-1)
if (input_ip_payload_tvalid or input_udp_payload_tvalid or
output_ip_payload_tvalid or output_udp_payload_tvalid or
input_ip_hdr_valid or input_udp_hdr_valid):
i = 8
yield clk.posedge
@instance
def check():
yield delay(100)
@ -497,14 +487,7 @@ def bench():
ip_source.send(ip_frame)
yield clk.posedge
yield clk.posedge
yield wait_normal()
yield clk.posedge
yield clk.posedge
yield udp_sink.wait()
rx_frame = udp_sink.recv()
assert rx_frame == test_frame
@ -544,14 +527,7 @@ def bench():
udp_source.send(test_frame)
yield clk.posedge
yield clk.posedge
yield wait_normal()
yield clk.posedge
yield clk.posedge
yield ip_sink.wait()
rx_frame = ip_sink.recv()
check_frame = udp_ep.UDPFrame()

View File

@ -571,14 +571,8 @@ def bench():
test_frame.build()
source_0.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_udp_payload_tvalid or input_1_udp_payload_tvalid or input_2_udp_payload_tvalid or input_3_udp_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -614,14 +608,8 @@ def bench():
test_frame.build()
source_1.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_udp_payload_tvalid or input_1_udp_payload_tvalid or input_2_udp_payload_tvalid or input_3_udp_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -681,18 +669,13 @@ def bench():
source_0.send(test_frame1)
source_0.send(test_frame2)
yield clk.posedge
yield clk.posedge
while input_0_udp_payload_tvalid or input_1_udp_payload_tvalid or input_2_udp_payload_tvalid or input_3_udp_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -752,18 +735,13 @@ def bench():
source_1.send(test_frame1)
source_2.send(test_frame2)
yield clk.posedge
yield clk.posedge
while input_0_udp_payload_tvalid or input_1_udp_payload_tvalid or input_2_udp_payload_tvalid or input_3_udp_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -839,13 +817,13 @@ def bench():
source_2_pause.next = False
source_3_pause.next = False
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -915,14 +893,13 @@ def bench():
yield clk.posedge
sink_pause.next = False
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -992,31 +969,32 @@ def bench():
yield clk.posedge
source_1.send(test_frame1)
while input_0_udp_payload_tvalid or input_1_udp_payload_tvalid or input_2_udp_payload_tvalid or input_3_udp_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2

View File

@ -586,14 +586,8 @@ def bench():
test_frame.build()
source_0.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_udp_payload_tvalid or input_1_udp_payload_tvalid or input_2_udp_payload_tvalid or input_3_udp_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -629,14 +623,8 @@ def bench():
test_frame.build()
source_1.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_udp_payload_tvalid or input_1_udp_payload_tvalid or input_2_udp_payload_tvalid or input_3_udp_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -696,18 +684,13 @@ def bench():
source_0.send(test_frame1)
source_0.send(test_frame2)
yield clk.posedge
yield clk.posedge
while input_0_udp_payload_tvalid or input_1_udp_payload_tvalid or input_2_udp_payload_tvalid or input_3_udp_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -767,18 +750,13 @@ def bench():
source_1.send(test_frame1)
source_2.send(test_frame2)
yield clk.posedge
yield clk.posedge
while input_0_udp_payload_tvalid or input_1_udp_payload_tvalid or input_2_udp_payload_tvalid or input_3_udp_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -854,13 +832,13 @@ def bench():
source_2_pause.next = False
source_3_pause.next = False
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -930,14 +908,13 @@ def bench():
yield clk.posedge
sink_pause.next = False
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -1007,31 +984,32 @@ def bench():
yield clk.posedge
source_1.send(test_frame1)
while input_0_udp_payload_tvalid or input_1_udp_payload_tvalid or input_2_udp_payload_tvalid or input_3_udp_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2

View File

@ -334,10 +334,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -401,14 +398,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -474,15 +469,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2

View File

@ -340,10 +340,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -407,14 +404,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -480,15 +475,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2

View File

@ -579,14 +579,7 @@ def bench():
eth_source.send(eth_frame)
yield clk.posedge
yield clk.posedge
yield wait_normal()
yield clk.posedge
yield clk.posedge
yield ip_sink.wait()
rx_frame = ip_sink.recv()
assert rx_frame == test_frame
@ -626,9 +619,7 @@ def bench():
ip_source.send(test_frame)
# wait for ARP request packet
while eth_sink.empty():
yield clk.posedge
yield eth_sink.wait()
rx_frame = eth_sink.recv()
check_frame = arp_ep.ARPFrame()
check_frame.parse_eth(rx_frame)
@ -662,14 +653,7 @@ def bench():
arp_frame.arp_tpa = 0xc0a80164
eth_source.send(arp_frame.build_eth())
yield clk.posedge
yield clk.posedge
yield wait_normal()
yield clk.posedge
yield clk.posedge
yield eth_sink.wait()
rx_frame = eth_sink.recv()
check_frame = ip_ep.IPFrame()
@ -783,14 +767,7 @@ def bench():
eth_source.send(eth_frame)
yield clk.posedge
yield clk.posedge
yield wait_normal()
yield clk.posedge
yield clk.posedge
yield udp_sink.wait()
rx_frame = udp_sink.recv()
assert rx_frame == test_frame
@ -830,14 +807,7 @@ def bench():
udp_source.send(test_frame)
yield clk.posedge
yield clk.posedge
yield wait_normal()
yield clk.posedge
yield clk.posedge
yield eth_sink.wait()
rx_frame = eth_sink.recv()
check_frame = udp_ep.UDPFrame()

View File

@ -597,14 +597,7 @@ def bench():
eth_source.send(eth_frame)
yield clk.posedge
yield clk.posedge
yield wait_normal()
yield clk.posedge
yield clk.posedge
yield ip_sink.wait()
rx_frame = ip_sink.recv()
assert rx_frame == test_frame
@ -644,9 +637,7 @@ def bench():
ip_source.send(test_frame)
# wait for ARP request packet
while eth_sink.empty():
yield clk.posedge
yield eth_sink.wait()
rx_frame = eth_sink.recv()
check_frame = arp_ep.ARPFrame()
check_frame.parse_eth(rx_frame)
@ -680,14 +671,7 @@ def bench():
arp_frame.arp_tpa = 0xc0a80164
eth_source.send(arp_frame.build_eth())
yield clk.posedge
yield clk.posedge
yield wait_normal()
yield clk.posedge
yield clk.posedge
yield eth_sink.wait()
rx_frame = eth_sink.recv()
check_frame = ip_ep.IPFrame()
@ -801,14 +785,7 @@ def bench():
eth_source.send(eth_frame)
yield clk.posedge
yield clk.posedge
yield wait_normal()
yield clk.posedge
yield clk.posedge
yield udp_sink.wait()
rx_frame = udp_sink.recv()
assert rx_frame == test_frame
@ -848,14 +825,7 @@ def bench():
udp_source.send(test_frame)
yield clk.posedge
yield clk.posedge
yield wait_normal()
yield clk.posedge
yield clk.posedge
yield eth_sink.wait()
rx_frame = eth_sink.recv()
check_frame = udp_ep.UDPFrame()

View File

@ -577,13 +577,8 @@ def bench():
test_frame.build()
source.send(test_frame)
yield clk.posedge
while input_udp_payload_tvalid or input_udp_hdr_valid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink_0.wait()
rx_frame = sink_0.recv()
assert rx_frame == test_frame
@ -621,13 +616,8 @@ def bench():
test_frame.build()
source.send(test_frame)
yield clk.posedge
while input_udp_payload_tvalid or input_udp_hdr_valid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame
@ -689,17 +679,13 @@ def bench():
source.send(test_frame1)
source.send(test_frame2)
yield clk.posedge
while input_udp_payload_tvalid or input_udp_hdr_valid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink_0.wait()
rx_frame = sink_0.recv()
assert rx_frame == test_frame1
yield sink_0.wait()
rx_frame = sink_0.recv()
assert rx_frame == test_frame2
@ -766,13 +752,13 @@ def bench():
while input_udp_payload_tvalid or input_udp_hdr_valid:
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame1
yield sink_2.wait()
rx_frame = sink_2.recv()
assert rx_frame == test_frame2
@ -844,13 +830,13 @@ def bench():
source_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame1
yield sink_2.wait()
rx_frame = sink_2.recv()
assert rx_frame == test_frame2
@ -928,13 +914,13 @@ def bench():
sink_3_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame1
yield sink_2.wait()
rx_frame = sink_2.recv()
assert rx_frame == test_frame2

View File

@ -592,13 +592,8 @@ def bench():
test_frame.build()
source.send(test_frame)
yield clk.posedge
while input_udp_payload_tvalid or input_udp_hdr_valid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink_0.wait()
rx_frame = sink_0.recv()
assert rx_frame == test_frame
@ -636,13 +631,8 @@ def bench():
test_frame.build()
source.send(test_frame)
yield clk.posedge
while input_udp_payload_tvalid or input_udp_hdr_valid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame
@ -704,17 +694,13 @@ def bench():
source.send(test_frame1)
source.send(test_frame2)
yield clk.posedge
while input_udp_payload_tvalid or input_udp_hdr_valid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink_0.wait()
rx_frame = sink_0.recv()
assert rx_frame == test_frame1
yield sink_0.wait()
rx_frame = sink_0.recv()
assert rx_frame == test_frame2
@ -781,13 +767,13 @@ def bench():
while input_udp_payload_tvalid or input_udp_hdr_valid:
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame1
yield sink_2.wait()
rx_frame = sink_2.recv()
assert rx_frame == test_frame2
@ -859,13 +845,13 @@ def bench():
source_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame1
yield sink_2.wait()
rx_frame = sink_2.recv()
assert rx_frame == test_frame2
@ -943,13 +929,13 @@ def bench():
sink_3_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink_1.wait()
rx_frame = sink_1.recv()
assert rx_frame == test_frame1
yield sink_2.wait()
rx_frame = sink_2.recv()
assert rx_frame == test_frame2

View File

@ -326,10 +326,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -396,14 +393,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -472,15 +467,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -549,14 +542,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -625,14 +616,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -702,15 +691,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -780,15 +767,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -859,15 +844,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.payload.user[-1]
assert error_payload_early_termination_asserted
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -938,15 +921,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.payload.user[-1]
assert error_payload_early_termination_asserted
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -1018,14 +999,11 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert error_header_early_termination_asserted
rx_frame = sink.recv()
assert rx_frame == test_frame2
assert sink.empty()

View File

@ -332,10 +332,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -402,14 +399,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -478,15 +473,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -555,14 +548,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -631,14 +622,12 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -708,15 +697,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -786,15 +773,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -865,15 +850,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.payload.user[-1]
assert error_payload_early_termination_asserted
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -944,15 +927,13 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame.payload.user[-1]
assert error_payload_early_termination_asserted
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -1024,14 +1005,11 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert error_header_early_termination_asserted
rx_frame = sink.recv()
assert rx_frame == test_frame2
assert sink.empty()

View File

@ -317,10 +317,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -387,10 +384,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -398,6 +392,7 @@ def bench():
assert check_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -466,10 +461,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -478,6 +470,7 @@ def bench():
assert check_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -547,10 +540,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -558,6 +548,7 @@ def bench():
assert check_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -627,10 +618,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -638,6 +626,7 @@ def bench():
assert check_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -708,10 +697,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -720,6 +706,7 @@ def bench():
assert check_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -790,10 +777,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -802,6 +786,7 @@ def bench():
assert check_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -873,10 +858,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -885,6 +867,7 @@ def bench():
assert rx_frame.payload.user[-1]
assert error_payload_early_termination_asserted
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -956,10 +939,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -968,6 +948,7 @@ def bench():
assert rx_frame.payload.user[-1]
assert error_payload_early_termination_asserted
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()

View File

@ -323,10 +323,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -393,10 +390,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -404,6 +398,7 @@ def bench():
assert check_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -472,10 +467,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -484,6 +476,7 @@ def bench():
assert check_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -553,10 +546,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -564,6 +554,7 @@ def bench():
assert check_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -633,10 +624,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -644,6 +632,7 @@ def bench():
assert check_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -714,10 +703,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -726,6 +712,7 @@ def bench():
assert check_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -796,10 +783,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -808,6 +792,7 @@ def bench():
assert check_frame == test_frame1
assert rx_frame.payload.user[-1]
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -879,10 +864,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -891,6 +873,7 @@ def bench():
assert rx_frame.payload.user[-1]
assert error_payload_early_termination_asserted
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -962,10 +945,7 @@ def bench():
yield wait()
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()
@ -974,6 +954,7 @@ def bench():
assert rx_frame.payload.user[-1]
assert error_payload_early_termination_asserted
yield sink.wait()
rx_frame = sink.recv()
check_frame = udp_ep.UDPFrame()

View File

@ -577,14 +577,8 @@ def bench():
test_frame.build()
source_0.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_udp_payload_tvalid or input_1_udp_payload_tvalid or input_2_udp_payload_tvalid or input_3_udp_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -622,14 +616,8 @@ def bench():
test_frame.build()
source_1.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_udp_payload_tvalid or input_1_udp_payload_tvalid or input_2_udp_payload_tvalid or input_3_udp_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -691,18 +679,13 @@ def bench():
source_0.send(test_frame1)
source_0.send(test_frame2)
yield clk.posedge
yield clk.posedge
while input_0_udp_payload_tvalid or input_1_udp_payload_tvalid or input_2_udp_payload_tvalid or input_3_udp_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -770,13 +753,13 @@ def bench():
while input_0_udp_payload_tvalid or input_1_udp_payload_tvalid or input_2_udp_payload_tvalid or input_3_udp_payload_tvalid:
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -855,13 +838,13 @@ def bench():
source_3_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -934,14 +917,13 @@ def bench():
sink_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2

View File

@ -592,14 +592,8 @@ def bench():
test_frame.build()
source_0.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_udp_payload_tvalid or input_1_udp_payload_tvalid or input_2_udp_payload_tvalid or input_3_udp_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -637,14 +631,8 @@ def bench():
test_frame.build()
source_1.send(test_frame)
yield clk.posedge
yield clk.posedge
while input_0_udp_payload_tvalid or input_1_udp_payload_tvalid or input_2_udp_payload_tvalid or input_3_udp_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame
@ -706,18 +694,13 @@ def bench():
source_0.send(test_frame1)
source_0.send(test_frame2)
yield clk.posedge
yield clk.posedge
while input_0_udp_payload_tvalid or input_1_udp_payload_tvalid or input_2_udp_payload_tvalid or input_3_udp_payload_tvalid:
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -785,13 +768,13 @@ def bench():
while input_0_udp_payload_tvalid or input_1_udp_payload_tvalid or input_2_udp_payload_tvalid or input_3_udp_payload_tvalid:
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -870,13 +853,13 @@ def bench():
source_3_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2
@ -949,14 +932,13 @@ def bench():
sink_pause.next = False
yield clk.posedge
select.next = 2
yield clk.posedge
yield clk.posedge
yield clk.posedge
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame1
yield sink.wait()
rx_frame = sink.recv()
assert rx_frame == test_frame2