From 69451c753fba2093c55f35aa20c29d337ce83d07 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Fri, 6 Feb 2015 12:42:42 +0100 Subject: [PATCH] fix timeout --- litesata/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litesata/common.py b/litesata/common.py index 2a7bca0c..743edeb8 100644 --- a/litesata/common.py +++ b/litesata/common.py @@ -270,8 +270,8 @@ class Timeout(Module): self.reached = Signal() ### value = Signal(max=length) - self.sync += value.eq(value+1) - self.comb += self.reached.eq(value == length) + self.sync += If(~self.reached, value.eq(value+1)) + self.comb += self.reached.eq(value == (length-1)) class BufferizeEndpoints(ModuleDecorator): def __init__(self, submodule, *args): -- 2.30.2