litex/misoclib/com/liteeth/frontend/etherbone/__init__.py

30 lines
1.2 KiB
Python
Raw Normal View History

from misoclib.com.liteeth.common import *
from misoclib.com.liteeth.core.etherbone.packet import *
from misoclib.com.liteeth.core.etherbone.probe import *
from misoclib.com.liteeth.core.etherbone.record import *
from misoclib.com.liteeth.core.etherbone.wishbone import *
2015-02-09 16:37:41 -05:00
2015-04-13 04:20:02 -04:00
class LiteEthEtherbone(Module):
def __init__(self, udp, udp_port):
# decode/encode etherbone packets
self.submodules.packet = packet = LiteEthEtherbonePacket(udp, udp_port)
2015-02-11 19:12:52 -05:00
# packets can be probe (etherbone discovering) or records with
# writes and reads
self.submodules.probe = probe = LiteEthEtherboneProbe()
self.submodules.record = record = LiteEthEtherboneRecord()
# arbitrate/dispatch probe/records packets
dispatcher = Dispatcher(packet.source, [probe.sink, record.sink])
self.comb += dispatcher.sel.eq(~packet.source.pf)
arbiter = Arbiter([probe.source, record.source], packet.sink)
self.submodules += dispatcher, arbiter
2015-02-11 13:44:02 -05:00
# create mmap ŵishbone master
self.submodules.master = master = LiteEthEtherboneWishboneMaster()
self.comb += [
Record.connect(record.receiver.source, master.sink),
Record.connect(master.source, record.sender.sink)
]