self.platform = platform
self.variant = variant
self.reset = Signal()
- self.clk = ClockSignal("cpu")
+ self.cpu_clk = ClockSignal()
irq_en = "noirq" not in variant
self.cpu_params = dict(
# Clock / Reset
- i_clk = self.clk,
+ i_clk = self.cpu_clk,
i_rst = ResetSignal() | self.reset,
# Monitoring / Debugging
self.pll_vco_o = Signal()
self.clk_sel = Signal(2)
self.pll_test_o = Signal()
- self.pllclk_o = Signal()
+ self.pll_24_i = Signal()
+ self.pllclk_o = ClockSignal("pll")
self.cpu_params['i_clk_sel_i'] = self.clk_sel
+ self.cpu_params['i_clk_24_i'] = self.pll_24_i
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
+ self.cpu_params['o_pllclk_clk'] = self.pllclk_o
# add wishbone buses to cpu params
self.cpu_params.update(make_wb_bus("ibus", ibus, True))
def io():
_io = [
# CLK/RST: 2 pins
- ("sys_clk", 0, Pins("G2"), IOStandard("LVCMOS33")),
+ ("sys_pllclk", 0, Pins("G2"), IOStandard("LVCMOS33")),
("sys_rst", 0, Pins("R1"), IOStandard("LVCMOS33")),
("sys_clksel_i", 0, Pins("R1 R2"), IOStandard("LVCMOS33")),
("sys_pll_testout_o", 0, Pins("R1"), IOStandard("LVCMOS33")),
from operator import or_
from migen import (Signal, FSM, If, Display, Finish, NextValue, NextState,
- Cat, Record, ClockSignal, wrap, ResetInserter)
+ Cat, Record, ClockSignal, wrap, ResetInserter,
+ ClockDomain, ResetSignal)
from litex.build.generic_platform import Pins, Subsignal
from litex.build.sim import SimPlatform
self.bus.add_slave(name=name, slave=sram_wb, region=ics_region)
# CRG -----------------------------------------------------------------
- self.submodules.crg = CRG(platform.request("sys_clk"),
+ # power-on-reset still based on PLL, leave sys_rst HI until
+ # PLL stabilises
+ pll_clk = self.cpu.pllclk_o # PLL into cpu
+ self.submodules.crg = CRG(pll_clk,
platform.request("sys_rst"))
if hasattr(self.cpu, "clk_sel"):
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
- cpu_clk = ClockDomain("cpu")
- self.comb += cpu_clk.eq(self.cpu.pllclk_o) # PLL out into cpu
+ cd_cpu = ClockDomain()
+ cd_pll = ClockDomain("pll", reset_less=True)
+ self.clock_domains.cd_pll = cd_pll
+ sys_clk = platform.request("sys_pllclk") # incoming clock
+ self.comb += self.cpu.pll_24_i.eq(sys_clk)
+ self.comb += self.cd_pll.clk.eq(self.cpu.pllclk_o) # PLL into cpu
+ #self.comb += self.cd_cpu.rst.eq(ResetSignal())
+ #self.comb += self.cpu.cpu_clk.eq(cd_cpu.clk)
#ram_init = []