2015-01-28 19:03:47 -05:00
|
|
|
from liteeth.common import *
|
|
|
|
from liteeth.mac import LiteEthMAC
|
2015-01-30 07:23:06 -05:00
|
|
|
from liteeth.arp import LiteEthARP
|
|
|
|
from liteeth.ip import LiteEthIP
|
2015-01-28 19:03:47 -05:00
|
|
|
|
|
|
|
class LiteEthIPStack(Module, AutoCSR):
|
2015-01-30 07:23:06 -05:00
|
|
|
def __init__(self, phy, mac_address, ip_address):
|
2015-01-28 19:03:47 -05:00
|
|
|
self.phy = phy
|
2015-01-30 11:44:44 -05:00
|
|
|
self.submodules.mac = mac = LiteEthMAC(phy, 8, interface="crossbar", with_hw_preamble_crc=True)
|
2015-01-30 10:27:56 -05:00
|
|
|
self.submodules.arp = arp = LiteEthARP(mac, mac_address, ip_address)
|
2015-01-30 12:32:55 -05:00
|
|
|
self.submodules.ip = ip = LiteEthIP(mac, mac_address, ip_address, arp.table)
|
2015-01-30 10:27:56 -05:00
|
|
|
self.sink, self.source = self.ip.sink, self.ip.source
|