From 2b237881d9cd9fe1e58b91bb5729480c409aecfc Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 15 Jul 2021 18:06:52 +0200 Subject: [PATCH] core/icmp: Use new LiteX's PacketFIFO. --- liteeth/core/icmp.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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)) ]