diff --git a/liteeth/core/icmp.py b/liteeth/core/icmp.py index 06aaaec..d9d7cc2 100644 --- a/liteeth/core/icmp.py +++ b/liteeth/core/icmp.py @@ -6,7 +6,7 @@ from liteeth.common import * -from litex.soc.interconnect.packet import Depacketizer, Packetizer +from litex.soc.interconnect.packet import Depacketizer, Packetizer, PacketFIFO # ICMP TX ------------------------------------------------------------------------------------------ @@ -133,11 +133,14 @@ class LiteEthICMPEcho(Module): # # # - # TODO: optimize ressources (no need to store parameters as datas) - self.submodules.buffer = stream.SyncFIFO(eth_icmp_user_description(dw), 128//(dw//8), buffered=True) + self.submodules.buffer = PacketFIFO(eth_icmp_user_description(dw), + payload_depth = 128//(dw//8), + param_depth = 1, + buffered = True + ) self.comb += [ sink.connect(self.buffer.sink), - self.buffer.source.connect(source), + self.buffer.source.connect(source, omit={"checksum"}), self.source.msgtype.eq(0x0), self.source.checksum.eq(self.buffer.source.checksum + 0x800 + (self.buffer.source.checksum >= 0xf800)) ]