fix timeout

This commit is contained in:
Florent Kermarrec 2015-02-06 12:42:42 +01:00
parent 2d05c31cc0
commit 69451c753f
1 changed files with 2 additions and 2 deletions

View File

@ -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):