Skip to content

Commit

Permalink
cores/clock/ECP5PLL: ensure ECP5PLL's locked is deasserted on reset.
Browse files Browse the repository at this point in the history
It seems EHXPLLL does not loose locked when reseted.
  • Loading branch information
enjoy-digital committed Nov 26, 2020
1 parent b02753e commit e5a7375
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion litex/soc/cores/clock/lattice_ecp5.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def compute_config(self):
def do_finalize(self):
config = self.compute_config()
clkfb = Signal()
locked = Signal()
self.params.update(
attr=[
("FREQUENCY_PIN_CLKI", str(self.clkin_freq/1e6)),
Expand All @@ -99,7 +100,7 @@ def do_finalize(self):
("MFG_GMCREF_SEL", "2")],
i_RST = self.reset,
i_CLKI = self.clkin,
o_LOCK = self.locked,
o_LOCK = locked,
p_FEEDBK_PATH = "INT_OS3", # CLKOS3 reserved for feedback with div=1.
p_CLKOS3_ENABLE = "ENABLED",
p_CLKOS3_DIV = 1,
Expand All @@ -108,6 +109,7 @@ def do_finalize(self):
p_CLKFB_DIV = config["clkfb_div"],
p_CLKI_DIV = config["clki_div"],
)
self.comb += self.locked.eq(locked & ~self.reset)
for n, (clk, f, p, m) in sorted(self.clkouts.items()):
n_to_l = {0: "P", 1: "S", 2: "S2"}
div = config["clko{}_div".format(n)]
Expand Down

0 comments on commit e5a7375

Please sign in to comment.