core/icmp/LiteEthICMPTX: Move datapath outside of FSM (minor logic optimization).

This commit is contained in:
Florent Kermarrec 2021-07-15 18:12:57 +02:00
parent 43a2ea8118
commit a12d3991e5
1 changed files with 5 additions and 2 deletions

View File

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