From a12d3991e5f7983d0017dbf6fa2e4ad46944cd64 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 15 Jul 2021 18:12:57 +0200 Subject: [PATCH] core/icmp/LiteEthICMPTX: Move datapath outside of FSM (minor logic optimization). --- liteeth/core/icmp.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/liteeth/core/icmp.py b/liteeth/core/icmp.py index d9d7cc2..d9817ab 100644 --- a/liteeth/core/icmp.py +++ b/liteeth/core/icmp.py @@ -46,11 +46,14 @@ class LiteEthICMPTX(Module): NextState("SEND") ) ) - fsm.act("SEND", - packetizer.source.connect(source), + self.comb += [ + packetizer.source.connect(source, omit={"valid", "ready"}), source.length.eq(sink.length + icmp_header.length), source.protocol.eq(icmp_protocol), source.ip_address.eq(sink.ip_address), + ] + fsm.act("SEND", + packetizer.source.connect(source, keep={"valid", "ready"}), If(source.valid & source.last & source.ready, NextState("IDLE") )