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") NextState("SEND")
) )
) )
fsm.act("SEND", self.comb += [
packetizer.source.connect(source), packetizer.source.connect(source, omit={"valid", "ready"}),
source.length.eq(sink.length + icmp_header.length), source.length.eq(sink.length + icmp_header.length),
source.protocol.eq(icmp_protocol), source.protocol.eq(icmp_protocol),
source.ip_address.eq(sink.ip_address), source.ip_address.eq(sink.ip_address),
]
fsm.act("SEND",
packetizer.source.connect(source, keep={"valid", "ready"}),
If(source.valid & source.last & source.ready, If(source.valid & source.last & source.ready,
NextState("IDLE") NextState("IDLE")
) )