litex/liteeth/core/etherbone/probe.py

25 lines
623 B
Python
Raw Normal View History

from liteeth.common import *
from liteeth.generic import *
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
###
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")
)
)