mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
genlib/misc: add increment parameter to Counter
This commit is contained in:
parent
ebcea3c000
commit
8e09a86e4f
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue