From 265db950ed9b9adeea925075104676757fee4471 Mon Sep 17 00:00:00 2001 From: Xiretza Date: Thu, 30 Jun 2022 12:15:54 +0200 Subject: [PATCH] liteeth/core: expose hybrid MAC mode This allows using both the hardware IP/UDP stack as well as a CPU attached directly to the MAC at the same time. --- liteeth/core/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/liteeth/core/__init__.py b/liteeth/core/__init__.py index 772c76a..f46eea7 100644 --- a/liteeth/core/__init__.py +++ b/liteeth/core/__init__.py @@ -15,6 +15,7 @@ from liteeth.core.icmp import LiteEthICMP class LiteEthIPCore(Module, AutoCSR): def __init__(self, phy, mac_address, ip_address, clk_freq, dw=8, + hybrid = False, with_icmp = True, with_ip_broadcast = True, with_sys_datapath = False): @@ -27,7 +28,7 @@ class LiteEthIPCore(Module, AutoCSR): self.submodules.mac = LiteEthMAC( phy = phy, dw = dw, - interface = "crossbar", + interface = "hybrid" if hybrid else "crossbar", with_preamble_crc = True, with_sys_datapath = with_sys_datapath, ) @@ -65,6 +66,7 @@ class LiteEthIPCore(Module, AutoCSR): class LiteEthUDPIPCore(LiteEthIPCore): def __init__(self, phy, mac_address, ip_address, clk_freq, dw=8, + hybrid = False, with_icmp = True, with_ip_broadcast = True, with_sys_datapath = False): @@ -83,6 +85,7 @@ class LiteEthUDPIPCore(LiteEthIPCore): dw = dw, with_ip_broadcast = with_ip_broadcast, with_sys_datapath = with_sys_datapath, + hybrid = hybrid, ) # UDP. # ----