From: Florent Kermarrec Date: Fri, 6 Feb 2015 11:42:42 +0000 (+0100) Subject: fix timeout X-Git-Tag: 24jan2021_ls180~2572^2~8 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=69451c753fba2093c55f35aa20c29d337ce83d07;p=litex.git fix timeout --- 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):