mirror of
https://github.com/alexforencich/verilog-ethernet.git
synced 2025-01-14 06:43:18 +08:00
Add asserts to check for orphaned payloads
This commit is contained in:
parent
8aa5ec5118
commit
8b762a6009
@ -420,6 +420,10 @@ def IPFrameSink(clk, rst,
|
|||||||
frame.payload = ip_payload_fifo.get()
|
frame.payload = ip_payload_fifo.get()
|
||||||
fifo.put(frame)
|
fifo.put(frame)
|
||||||
|
|
||||||
|
# ensure all payloads have been matched to headers
|
||||||
|
if ip_header_fifo.empty():
|
||||||
|
assert ip_payload_fifo.empty()
|
||||||
|
|
||||||
if name is not None:
|
if name is not None:
|
||||||
print("[%s] Got frame %s" % (name, repr(frame)))
|
print("[%s] Got frame %s" % (name, repr(frame)))
|
||||||
|
|
||||||
|
@ -519,6 +519,10 @@ def UDPFrameSink(clk, rst,
|
|||||||
frame.payload = udp_payload_fifo.get()
|
frame.payload = udp_payload_fifo.get()
|
||||||
fifo.put(frame)
|
fifo.put(frame)
|
||||||
|
|
||||||
|
# ensure all payloads have been matched to headers
|
||||||
|
if udp_header_fifo.empty():
|
||||||
|
assert udp_payload_fifo.empty()
|
||||||
|
|
||||||
if name is not None:
|
if name is not None:
|
||||||
print("[%s] Got frame %s" % (name, repr(frame)))
|
print("[%s] Got frame %s" % (name, repr(frame)))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user