Skip to content

Commit

Permalink
core/arp/LiteEthARPTX: Simplify last_be generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-digital committed Apr 4, 2024
1 parent d5ba0d2 commit c18cfb8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions liteeth/core/arp.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ def __init__(self, mac_address, ip_address, dw=8):
self.comb += [
packetizer.sink.last.eq(counter == (packet_words - 1)),
If(packetizer.sink.last,
packetizer.sink.last_be.eq(1 if len(packetizer.sink.last_be) == 1 else
2**(packet_length % (dw // 8) - 1)
),
packetizer.sink.last_be.eq(max(1, 2**(packet_length % (dw // 8) - 1))),
),
packetizer.sink.hwtype.eq(arp_hwtype_ethernet),
packetizer.sink.proto.eq(arp_proto_ip),
Expand Down

0 comments on commit c18cfb8

Please sign in to comment.