Merge pull request #2139 from piotro888/pll-intel-reset

cores/clock/intel: add reset to Intel PLLs
This commit is contained in:
enjoy-digital 2024-12-18 14:52:21 +01:00 committed by GitHub
commit a6bdbedc07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 1 deletions

View File

@ -105,8 +105,15 @@ class IntelClocking(LiteXModule):
return best_config return best_config
raise ValueError("No PLL config found") raise ValueError("No PLL config found")
def add_reset_delay(self, cycles):
for _ in range(cycles):
reset = Signal()
self.specials += Instance("DFFE", i_clk=self.clkin, i_d=self.reset, o_q=reset, i_ena=1, i_clrn=1, i_prn=1)
self.reset = reset
def do_finalize(self): def do_finalize(self):
assert hasattr(self, "clkin") assert hasattr(self, "clkin")
self.add_reset_delay(cycles=8) # Prevents interlock when reset driven from sys_clk.
config = self.compute_config() config = self.compute_config()
clks = Signal(self.nclkouts) clks = Signal(self.nclkouts)
self.params.update( self.params.update(
@ -116,7 +123,7 @@ class IntelClocking(LiteXModule):
p_OPERATION_MODE = "NORMAL", p_OPERATION_MODE = "NORMAL",
i_INCLK = self.clkin, i_INCLK = self.clkin,
o_CLK = clks, o_CLK = clks,
i_ARESET = 0, i_ARESET = self.reset,
i_CLKENA = 2**self.nclkouts_max - 1, i_CLKENA = 2**self.nclkouts_max - 1,
i_EXTCLKENA = 0xf, i_EXTCLKENA = 0xf,
i_FBIN = 1, i_FBIN = 1,