liteeth/core/__init__.py: Switch to LiteXModule.

This commit is contained in:
Florent Kermarrec 2024-09-20 16:19:03 +02:00
parent a75f4e5ea7
commit af746ec973
1 changed files with 8 additions and 6 deletions

View File

@ -5,6 +5,8 @@
# Copyright (c) 2023 LumiGuide Fietsdetectie B.V. <goemansrowan@gmail.com> # Copyright (c) 2023 LumiGuide Fietsdetectie B.V. <goemansrowan@gmail.com>
# SPDX-License-Identifier: BSD-2-Clause # SPDX-License-Identifier: BSD-2-Clause
from litex.gen import *
from liteeth.common import * from liteeth.common import *
from liteeth.mac import LiteEthMAC from liteeth.mac import LiteEthMAC
from liteeth.core.arp import LiteEthARP from liteeth.core.arp import LiteEthARP
@ -14,7 +16,7 @@ from liteeth.core.icmp import LiteEthICMP
# IP Core ------------------------------------------------------------------------------------------ # IP Core ------------------------------------------------------------------------------------------
class LiteEthIPCore(Module, AutoCSR): class LiteEthIPCore(LiteXModule):
def __init__(self, phy, mac_address, ip_address, clk_freq, arp_entries=1, dw=8, def __init__(self, phy, mac_address, ip_address, clk_freq, arp_entries=1, dw=8,
with_icmp = True, icmp_fifo_depth=128, with_icmp = True, icmp_fifo_depth=128,
with_ip_broadcast = True, with_ip_broadcast = True,
@ -32,7 +34,7 @@ class LiteEthIPCore(Module, AutoCSR):
# MAC. # MAC.
# ---- # ----
self.submodules.mac = LiteEthMAC( self.mac = LiteEthMAC(
phy = phy, phy = phy,
dw = dw, dw = dw,
interface = interface, interface = interface,
@ -48,7 +50,7 @@ class LiteEthIPCore(Module, AutoCSR):
# ARP. # ARP.
# ---- # ----
self.submodules.arp = LiteEthARP( self.arp = LiteEthARP(
mac = self.mac, mac = self.mac,
mac_address = mac_address, mac_address = mac_address,
ip_address = ip_address, ip_address = ip_address,
@ -59,7 +61,7 @@ class LiteEthIPCore(Module, AutoCSR):
# IP. # IP.
# --- # ---
self.submodules.ip = LiteEthIP( self.ip = LiteEthIP(
mac = self.mac, mac = self.mac,
mac_address = mac_address, mac_address = mac_address,
ip_address = ip_address, ip_address = ip_address,
@ -70,7 +72,7 @@ class LiteEthIPCore(Module, AutoCSR):
# ICMP (Optional). # ICMP (Optional).
# ---------------- # ----------------
if with_icmp: if with_icmp:
self.submodules.icmp = LiteEthICMP( self.icmp = LiteEthICMP(
ip = self.ip, ip = self.ip,
ip_address = ip_address, ip_address = ip_address,
dw = dw, dw = dw,
@ -117,7 +119,7 @@ class LiteEthUDPIPCore(LiteEthIPCore):
) )
# UDP. # UDP.
# ---- # ----
self.submodules.udp = LiteEthUDP( self.udp = LiteEthUDP(
ip = self.ip, ip = self.ip,
ip_address = ip_address, ip_address = ip_address,
dw = dw, dw = dw,