From ea45c8704f3afc8663e8cb4d1622ffbcee8c1399 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 31 Jul 2023 17:26:58 +0200 Subject: [PATCH] core/arp: Add enable signals for Cache/Clear for optional external control. --- liteeth/core/arp.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/liteeth/core/arp.py b/liteeth/core/arp.py index fac1722..5edfbb8 100644 --- a/liteeth/core/arp.py +++ b/liteeth/core/arp.py @@ -165,6 +165,10 @@ class LiteEthARPCache(LiteXModule): self.request = stream.Endpoint([("ip_address", 32)]) self.response = stream.Endpoint([("mac_address", 48), ("error", 1)]) + # Enable. + self.enable = Signal(reset=1) + self.clear_enable = Signal(reset=1) + # # # # Parameters. @@ -208,14 +212,14 @@ class LiteEthARPCache(LiteXModule): ) ) fsm.act("IDLE", - If(self.update.valid, + If(self.enable & self.update.valid, NextState("MEM_UPDATE") ), - If(self.request.valid, + If(self.enable & self.request.valid, NextValue(search_count, 0), NextState("MEM_SEARCH") ), - If(self.clear_timer.done, + If(self.clear_enable & self.clear_timer.done, NextValue(update_count, 0), NextState("CLEAR") )