genlib/misc: add increment parameter to Counter

This commit is contained in:
Florent Kermarrec 2015-03-09 20:20:25 +01:00
parent ebcea3c000
commit 8e09a86e4f
1 changed files with 2 additions and 2 deletions

View File

@ -97,10 +97,10 @@ class FlipFlop(Module):
@DecorateModule(InsertReset)
@DecorateModule(InsertCE)
class Counter(Module):
def __init__(self, *args, **kwargs):
def __init__(self, *args, increment=1, **kwargs):
self.value = Signal(*args, **kwargs)
self.width = flen(self.value)
self.sync += self.value.eq(self.value+1)
self.sync += self.value.eq(self.value+increment)
@DecorateModule(InsertReset)
@DecorateModule(InsertCE)