From 5d7adcfa7c88a4704f8a9225a5adc0cb2528ba59 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 1 Nov 2021 14:58:41 +0100 Subject: [PATCH] core/refresher: Add assert on clk_freq/tREFI ratio. Prevent generating a controller with tREFI too low to accept any transaction. --- litedram/core/refresher.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/litedram/core/refresher.py b/litedram/core/refresher.py index 6c92a74..f78ae05 100644 --- a/litedram/core/refresher.py +++ b/litedram/core/refresher.py @@ -230,6 +230,8 @@ class Refresher(Module): wants_zqcs = Signal() # Refresh Timer ---------------------------------------------------------------------------- + if settings.timing.tREFI < 100: # FIXME: Reduce Margin. + raise ValueError("Clk/tREFI is ratio too low , please increase Clk frequency or disable Refresh.") timer = RefreshTimer(settings.timing.tREFI) self.submodules.timer = timer self.comb += timer.wait.eq(~timer.done)