From dbc42a5cf0453f5e9f7f0ec2a042f785c48e2a4a Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 9 Jun 2021 14:41:10 +0100 Subject: [PATCH] add PLL clock loop-back into CPU --- libresoc/core.py | 2 ++ ls180soc.py | 1 + 2 files changed, 3 insertions(+) diff --git a/libresoc/core.py b/libresoc/core.py index 6c39cd9..178ebe8 100644 --- a/libresoc/core.py +++ b/libresoc/core.py @@ -276,9 +276,11 @@ class LibreSoC(CPU): self.pll_vco_o = Signal() self.clk_sel = Signal(2) self.pll_test_o = Signal() + self.pllclk_o = Signal() self.cpu_params['i_clk_sel_i'] = self.clk_sel self.cpu_params['o_pll_vco_o'] = self.pll_vco_o self.cpu_params['o_pll_test_o'] = self.pll_test_o + self.cpu_params['o_pllclk_o'] = self.pllclk_o # add wishbone buses to cpu params self.cpu_params.update(make_wb_bus("ibus", ibus, True)) diff --git a/ls180soc.py b/ls180soc.py index 6321b01..a240839 100755 --- a/ls180soc.py +++ b/ls180soc.py @@ -433,6 +433,7 @@ class LibreSoCSim(SoCCore): self.comb += self.cpu.clk_sel.eq(clksel_i) # allow clock src select self.comb += pll_test_o.eq(self.cpu.pll_test_o) # "test" from PLL self.comb += pll_vco_o.eq(self.cpu.pll_vco_o) # PLL lock flag + self.comb += self.cpu.clk.eq(self.cpu.pllclk_o) # PLL out into cpu #ram_init = [] -- 2.30.2