From 36ce71d59b002d6e0bb99a39e52e248853926b3e Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 11 Sep 2023 10:11:58 +0200 Subject: [PATCH] clock/efinix: Avoid manual n parameter and handle it internally. --- litex/soc/cores/clock/efinix.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/litex/soc/cores/clock/efinix.py b/litex/soc/cores/clock/efinix.py index 14794294b..28e64a244 100644 --- a/litex/soc/cores/clock/efinix.py +++ b/litex/soc/cores/clock/efinix.py @@ -16,8 +16,9 @@ from litex.soc.cores.clock.common import * # Efinix / TRIONPLL ---------------------------------------------------------------------------------- class EFINIXPLL(LiteXModule): + n = 0 nclkouts_max = 3 - def __init__(self, platform, n=0, version="V1_V2"): + def __init__(self, platform,version="V1_V2"): self.logger = logging.getLogger("EFINIXPLL") if version == "V1_V2": @@ -33,7 +34,8 @@ class EFINIXPLL(LiteXModule): self.nclkouts = 0 self.reset = Signal() self.locked = Signal() - self.name = f"pll{n}" + self.name = f"pll{self.n}" + EFINIXPLL.n += 1 # FIXME: Improve. # Create PLL block. block = {} @@ -131,12 +133,12 @@ class EFINIXPLL(LiteXModule): class TITANIUMPLL(EFINIXPLL): nclkouts_max = 5 - def __init__(self, platform, n=0): - EFINIXPLL.__init__(self, platform, n, version="V3") + def __init__(self, platform): + EFINIXPLL.__init__(self, platform, version="V3") # Efinix / TRION ---------------------------------------------------------------------------------- class TRIONPLL(EFINIXPLL): nclkouts_max = 3 - def __init__(self, platform, n=0): - EFINIXPLL.__init__(self, platform, n, version="V1_V2") + def __init__(self, platform): + EFINIXPLL.__init__(self, platform, version="V1_V2")