)
)
self.comb += [
+ source.sop.eq(counter.value == 0),
+ source.eop.eq(counter.value == max(arp_header_len, eth_min_len)-1),
source.hwtype.eq(arp_hwtype_ethernet),
source.proto.eq(arp_proto_ip),
source.hwsize.eq(6),
]
fsm.act("SEND",
source.stb.eq(1),
- source.sop.eq(counter.value == 0),
- source.eop.eq(counter.value == max(arp_header_len, eth_min_len)-1),
Record.connect(packetizer.source, self.source),
self.source.target_mac.eq(source.target_mac),
self.source.sender_mac.eq(mac_address),
NextState("SEND_MAC_ADDRESS_REQUEST")
)
)
+ self.comb += arp_table.request.ip_address.eq(self.sink.ip_address)
fsm.act("SEND_MAC_ADDRESS_REQUEST",
arp_table.request.stb.eq(1),
- arp_table.request.ip_address.eq(self.sink.ip_address),
If(arp_table.request.stb & arp_table.request.ack,
NextState("WAIT_MAC_ADDRESS_RESPONSE")
)
).Else(
NextState("DROP")
)
- ),
- fsm.act("PRESENT",
- source.stb.eq(sink.stb),
+ )
+ self.comb += [
source.sop.eq(sink.sop),
source.eop.eq(sink.eop),
- sink.ack.eq(source.ack),
source.length.eq(sink.total_length - (sink.ihl*4)),
source.protocol.eq(sink.protocol),
source.ip_address.eq(sink.target_ip),
source.data.eq(sink.data),
- source.error.eq(sink.error),
+ source.error.eq(sink.error)
+ ]
+ fsm.act("PRESENT",
+ source.stb.eq(sink.stb),
+ sink.ack.eq(source.ack),
If(source.stb & source.eop & source.ack,
NextState("IDLE")
)
)
fsm.act("DROP",
sink.ack.eq(1),
- If(source.stb & source.eop & source.ack,
+ If(sink.stb & sink.eop & sink.ack,
NextState("IDLE")
)
)
).Else(
NextState("DROP")
)
- ),
- fsm.act("PRESENT",
- source.stb.eq(sink.stb),
+ )
+ self.comb += [
source.sop.eq(sink.sop),
source.eop.eq(sink.eop),
- sink.ack.eq(source.ack),
source.src_port.eq(sink.src_port),
source.dst_port.eq(sink.dst_port),
source.ip_address.eq(0),
source.length.eq(sink.length - udp_header_len),
source.data.eq(sink.data),
- source.error.eq(sink.error),
+ source.error.eq(sink.error)
+ ]
+ fsm.act("PRESENT",
+ source.stb.eq(sink.stb),
+ sink.ack.eq(source.ack),
If(source.stb & source.eop & source.ack,
NextState("IDLE")
)