From 8e09a86e4ff74f8bce12194618ab63bdd8cf19f4 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 9 Mar 2015 20:20:25 +0100 Subject: [PATCH] genlib/misc: add increment parameter to Counter --- migen/genlib/misc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migen/genlib/misc.py b/migen/genlib/misc.py index cffb372d..8942ab0b 100644 --- a/migen/genlib/misc.py +++ b/migen/genlib/misc.py @@ -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) -- 2.30.2