Skip to content

Commit

Permalink
clock/efinix: Avoid manual n parameter and handle it internally.
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-digital committed Sep 11, 2023
1 parent 112f78b commit 36ce71d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions litex/soc/cores/clock/efinix.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
# 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":
Expand All @@ -33,7 +34,8 @@ def __init__(self, platform, n=0, version="V1_V2"):
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 = {}
Expand Down Expand Up @@ -131,12 +133,12 @@ def do_finalize(self):

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")

0 comments on commit 36ce71d

Please sign in to comment.