Skip to content

Commit

Permalink
frontend/etherbone/LiteEthEtherbonePacketRX: Only enable LiteEthLastH…
Browse files Browse the repository at this point in the history
…andler for 64-bit case.
  • Loading branch information
enjoy-digital committed Sep 20, 2024
1 parent d5a9f9d commit dd1988a
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions liteeth/frontend/etherbone.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,22 @@ def __init__(self):


class LiteEthEtherbonePacketRX(LiteXModule):
def __init__(self):
def __init__(self, with_last_handler=False):
self.sink = sink = stream.Endpoint(eth_udp_user_description(32))
self.source = source = stream.Endpoint(eth_etherbone_packet_user_description(32))

# # #

self.last_handler = LiteEthLastHandler(eth_udp_user_description(32))

self.depacketizer = depacketizer = LiteEthEtherbonePacketDepacketizer()
self.comb += [
sink.connect(self.last_handler.sink),
self.last_handler.source.connect(depacketizer.sink),
]

if with_last_handler:
self.last_handler = LiteEthLastHandler(eth_udp_user_description(32))
self.comb += [
sink.connect(self.last_handler.sink),
self.last_handler.source.connect(depacketizer.sink),
]
else:
self.comb += sink.connect(depacketizer.sink)

self.fsm = fsm = FSM(reset_state="IDLE")
fsm.act("IDLE",
Expand Down Expand Up @@ -131,7 +134,7 @@ def __init__(self):
class LiteEthEtherbonePacket(LiteXModule):
def __init__(self, udp, udp_port, cd="sys"):
self.tx = tx = LiteEthEtherbonePacketTX(udp_port)
self.rx = rx = LiteEthEtherbonePacketRX()
self.rx = rx = LiteEthEtherbonePacketRX(with_last_handler=(udp.crossbar.dw == 64)) # FIXME: Avoid 64-bit specific behavior.
udp_port = udp.crossbar.get_port(udp_port, dw=32, cd=cd)
self.comb += [
tx.source.connect(udp_port.sink),
Expand Down

0 comments on commit dd1988a

Please sign in to comment.