Open paul-demo opened 1 year ago
In other words, I think you've assumed that the payload stream deasserts tvalid
in the cycle after the tlast
transfer, something which is not necessarily true. As far as I know from the AXI4-STREAM AMBA spec, you can have a transfer the cycle immediately following tlast
.
An example would be an upstream FIFO that simply packs the tlast
bit adjacent to tdata
for each beat: if the FIFO was storing more than one packet, it would immediately assert tvalid
in the cycle after tlast
, and the first beat of the second packet would get lost due to this bug (again, not 100% sure since I have not simulated it).
Yep, I think you're right about that being a problem corner case. Looks like it probably affects both the 1G and the 10G modules.
I haven't simulated this; I have just been looking at your code to see if verilog-ethernet could be a compatible replacement for a similar, lesser version that I wrote and shipped in a previous project.
I was looking at what happens when there's an ARP cache miss when trying to send a Tx packet. In
ip_64.v
it looks like the top of tree implementation would drain one too many transfers from the payload stream, sincedrop_packet_reg
would remain asserted into the first cycle where state becomesSTATE_IDLE
. This means thats_ip_payload_axis_tready
would be asserted and consequently thes_ip_payload_axis
stream could silently lose 8 bytes of data after every packet where a cache miss occurred if the upstream source of payload data is still assertingtvalid
.I'll leave it to you to verify, but it seems like you need to conditionally set
drop_packet_next
as shown below, instead. I could be wrong though -- again, I haven't simulated this.