core/icmp: Use new LiteX's PacketFIFO.

This commit is contained in:
Florent Kermarrec 2021-07-15 18:06:52 +02:00
parent c294a3848e
commit 2b237881d9
1 changed files with 7 additions and 4 deletions

View File

@ -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))
]