84ba069a24d6e085201768af4bfaa5dc5dff50a9
[litex.git] / liteeth / core / etherbone / probe.py
1 from liteeth.common import *
2
3 class LiteEthEtherboneProbe(Module):
4 def __init__(self):
5 self.sink = sink = Sink(eth_etherbone_packet_user_description(32))
6 self.source = source = Source(eth_etherbone_packet_user_description(32))
7
8 self.submodules.fsm = fsm = FSM(reset_state="IDLE")
9
10 fsm.act("IDLE",
11 sink.ack.eq(1),
12 If(sink.stb & sink.sop,
13 sink.ack.eq(0),
14 NextState("PROBE_RESPONSE")
15 )
16 )
17 fsm.act("PROBE_RESPONSE",
18 Record.connect(sink, source),
19 source.pf.eq(0),
20 source.pr.eq(1),
21 If(source.stb & source.eop & source.ack,
22 NextState("IDLE")
23 )
24 )