2015-02-09 05:19:26 -05:00
|
|
|
from liteeth.common import *
|
|
|
|
|
|
|
|
class LiteEthUDPMasterPort:
|
|
|
|
def __init__(self, dw):
|
2015-02-10 04:30:39 -05:00
|
|
|
self.dw = dw
|
2015-02-09 05:19:26 -05:00
|
|
|
self.source = Source(eth_udp_user_description(dw))
|
|
|
|
self.sink = Sink(eth_udp_user_description(dw))
|
|
|
|
|
|
|
|
def connect(self, slave):
|
|
|
|
return [
|
|
|
|
Record.connect(self.source, slave.sink),
|
|
|
|
Record.connect(slave.source, self.sink)
|
|
|
|
]
|
|
|
|
|
|
|
|
class LiteEthUDPSlavePort:
|
|
|
|
def __init__(self, dw):
|
2015-02-10 04:30:39 -05:00
|
|
|
self.dw =dw
|
2015-02-09 05:19:26 -05:00
|
|
|
self.sink = Sink(eth_udp_user_description(dw))
|
|
|
|
self.source = Source(eth_udp_user_description(dw))
|
|
|
|
|
|
|
|
def connect(self, master):
|
|
|
|
return [
|
|
|
|
Record.connect(self.sink, master.source),
|
|
|
|
Record.connect(master.sink, self.source)
|
|
|
|
]
|
|
|
|
|
|
|
|
class LiteEthUDPUserPort(LiteEthUDPSlavePort):
|
|
|
|
def __init__(self, dw):
|
|
|
|
LiteEthUDPSlavePort.__init__(self, dw)
|