2015-02-09 16:37:41 -05:00
|
|
|
from liteeth.common import *
|
2015-02-11 10:21:06 -05:00
|
|
|
|
|
|
|
from liteeth.generic.arbiter import Arbiter
|
|
|
|
from liteeth.generic.dispatcher import Dispatcher
|
|
|
|
|
2015-02-11 08:33:17 -05:00
|
|
|
from liteeth.core.etherbone.packet import *
|
2015-02-11 10:21:06 -05:00
|
|
|
from liteeth.core.etherbone.probe import *
|
|
|
|
from liteeth.core.etherbone.record import *
|
2015-02-11 13:44:02 -05:00
|
|
|
from liteeth.core.etherbone.wishbone import *
|
2015-02-09 16:37:41 -05:00
|
|
|
|
2015-02-11 08:33:17 -05:00
|
|
|
class LiteEthEtherbone(Module):
|
|
|
|
def __init__(self, udp, udp_port):
|
|
|
|
self.submodules.packet = packet = LiteEthEtherbonePacket(udp, udp_port)
|
2015-02-11 10:21:06 -05:00
|
|
|
self.submodules.probe = probe = LiteEthEtherboneProbe()
|
|
|
|
self.submodules.record = record = LiteEthEtherboneRecord()
|
|
|
|
|
|
|
|
dispatcher = Dispatcher(packet.source, [probe.sink, record.sink])
|
|
|
|
self.comb += dispatcher.sel.eq(~packet.source.pf)
|
|
|
|
self.submodules += dispatcher
|
2015-02-09 16:37:41 -05:00
|
|
|
|
2015-02-11 10:21:06 -05:00
|
|
|
arbiter = Arbiter([probe.source, record.source], packet.sink)
|
|
|
|
self.submodules += arbiter
|
2015-02-11 13:44:02 -05:00
|
|
|
|
|
|
|
self.submodules.wishbone = wishbone = LiteEthEtherboneWishboneMaster()
|
|
|
|
self.comb += [
|
|
|
|
Record.connect(record.receiver.wr_source, wishbone.wr_sink),
|
|
|
|
Record.connect(record.receiver.rd_source, wishbone.rd_sink),
|
|
|
|
Record.connect(wishbone.wr_source, record.sender.wr_sink),
|
|
|
|
Record.connect(wishbone.rd_source, record.sender.rd_sink)
|
|
|
|
]
|