2015-02-11 10:21:06 -05:00
|
|
|
from liteeth.common import *
|
2015-02-11 19:19:36 -05:00
|
|
|
from liteeth.generic import *
|
2015-02-11 10:21:06 -05:00
|
|
|
|
|
|
|
class LiteEthEtherboneProbe(Module):
|
|
|
|
def __init__(self):
|
|
|
|
self.sink = sink = Sink(eth_etherbone_packet_user_description(32))
|
|
|
|
self.source = source = Source(eth_etherbone_packet_user_description(32))
|
2015-02-11 19:12:52 -05:00
|
|
|
###
|
2015-02-11 10:21:06 -05:00
|
|
|
self.submodules.fsm = fsm = FSM(reset_state="IDLE")
|
|
|
|
fsm.act("IDLE",
|
|
|
|
sink.ack.eq(1),
|
|
|
|
If(sink.stb & sink.sop,
|
|
|
|
sink.ack.eq(0),
|
|
|
|
NextState("PROBE_RESPONSE")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
fsm.act("PROBE_RESPONSE",
|
|
|
|
Record.connect(sink, source),
|
|
|
|
source.pf.eq(0),
|
|
|
|
source.pr.eq(1),
|
|
|
|
If(source.stb & source.eop & source.ack,
|
|
|
|
NextState("IDLE")
|
|
|
|
)
|
|
|
|
)
|