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

Add zero IFG forced offset start test

This commit is contained in:
Alex Forencich 2019-01-22 18:47:32 -08:00
parent 5b2d4fd465
commit a743f6f789

View File

@ -384,6 +384,41 @@ def bench():
yield delay(100)
for payload_len in list(range(46,54)):
yield clk.posedge
print("test 6: test stream with zero IFG and offset start, length %d" % payload_len)
current_test.next = 6
source.ifg = 0
source.force_offset_start = True
for i in range(10):
test_frame = eth_ep.EthFrame()
test_frame.eth_dest_mac = 0xDAD1D2D3D4D5
test_frame.eth_src_mac = 0x5A5152535455
test_frame.eth_type = 0x8000
test_frame.payload = bytearray(range(payload_len))
test_frame.update_fcs()
axis_frame = test_frame.build_axis_fcs()
source.send(b'\x55\x55\x55\x55\x55\x55\x55\xD5'+bytearray(axis_frame))
for i in range(10):
yield sink.wait()
rx_frame = sink.recv()
eth_frame = eth_ep.EthFrame()
eth_frame.parse_axis(rx_frame)
eth_frame.update_fcs()
assert eth_frame == test_frame
source.ifg = 12
source.force_offset_start = False
yield delay(100)
yield clk.posedge
print("test 7: Ensure 0xfb in FCS in lane 4 is not detected as start code in lane 0")
current_test.next = 7