diff --git a/litex_boards/targets/ac701.py b/litex_boards/targets/ac701.py index 12b3be1..93eb276 100755 --- a/litex_boards/targets/ac701.py +++ b/litex_boards/targets/ac701.py @@ -32,15 +32,16 @@ from liteeth.phy.s7rgmii import LiteEthPHYRGMII class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys4x = ClockDomain(reset_less=True) self.clock_domains.cd_sys4x_dqs = ClockDomain(reset_less=True) - self.clock_domains.cd_clk200 = ClockDomain() + self.clock_domains.cd_idelay = ClockDomain() # # # self.submodules.pll = pll = S7PLL(speedgrade=-1) - self.comb += pll.reset.eq(platform.request("cpu_reset")) + self.comb += pll.reset.eq(platform.request("cpu_reset") | self.rst) pll.register_clkin(platform.request("clk200"), 200e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq) diff --git a/litex_boards/targets/acorn_cle_215.py b/litex_boards/targets/acorn_cle_215.py index 2febf73..b2b774d 100755 --- a/litex_boards/targets/acorn_cle_215.py +++ b/litex_boards/targets/acorn_cle_215.py @@ -52,6 +52,7 @@ from litepcie.software import generate_litepcie_software class CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys4x = ClockDomain(reset_less=True) self.clock_domains.cd_sys4x_dqs = ClockDomain(reset_less=True) @@ -62,6 +63,7 @@ class CRG(Module): # PLL self.submodules.pll = pll = S7PLL() + self.comb += pll.reset.eq(self.rst) pll.register_clkin(clk200, 200e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq) diff --git a/litex_boards/targets/aller.py b/litex_boards/targets/aller.py index 57be2c2..9d5fe06 100755 --- a/litex_boards/targets/aller.py +++ b/litex_boards/targets/aller.py @@ -36,6 +36,7 @@ from litepcie.software import generate_litepcie_software class CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys4x = ClockDomain(reset_less=True) self.clock_domains.cd_sys4x_dqs = ClockDomain(reset_less=True) @@ -46,6 +47,7 @@ class CRG(Module): # PLL self.submodules.pll = pll = S7PLL() + self.comb += pll.reset.eq(self.rst) pll.register_clkin(clk100, 100e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq) diff --git a/litex_boards/targets/alveo_u250.py b/litex_boards/targets/alveo_u250.py index b6ca6e1..1cd0a2b 100755 --- a/litex_boards/targets/alveo_u250.py +++ b/litex_boards/targets/alveo_u250.py @@ -33,6 +33,7 @@ from litepcie.software import generate_litepcie_software class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys4x = ClockDomain(reset_less=True) self.clock_domains.cd_pll4x = ClockDomain(reset_less=True) @@ -41,7 +42,7 @@ class _CRG(Module): # # # self.submodules.pll = pll = USMMCM(speedgrade=-2) - self.comb += pll.reset.eq(0) # FIXME + self.comb += pll.reset.eq(self.rst) pll.register_clkin(platform.request("clk300", 0), 300e6) pll.create_clkout(self.cd_pll4x, sys_clk_freq*4, buf=None, with_reset=False) pll.create_clkout(self.cd_idelay, 500e6, with_reset=False) diff --git a/litex_boards/targets/arty.py b/litex_boards/targets/arty.py index e5a0727..f82f729 100755 --- a/litex_boards/targets/arty.py +++ b/litex_boards/targets/arty.py @@ -29,6 +29,7 @@ from liteeth.phy.mii import LiteEthPHYMII class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys4x = ClockDomain(reset_less=True) self.clock_domains.cd_sys4x_dqs = ClockDomain(reset_less=True) @@ -38,7 +39,7 @@ class _CRG(Module): # # # self.submodules.pll = pll = S7PLL(speedgrade=-1) - self.comb += pll.reset.eq(~platform.request("cpu_reset")) + self.comb += pll.reset.eq(~platform.request("cpu_reset") | self.rst) pll.register_clkin(platform.request("clk100"), 100e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq) diff --git a/litex_boards/targets/arty_s7.py b/litex_boards/targets/arty_s7.py index 192b63d..9075474 100755 --- a/litex_boards/targets/arty_s7.py +++ b/litex_boards/targets/arty_s7.py @@ -28,6 +28,7 @@ from litedram.phy import s7ddrphy class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys2x = ClockDomain(reset_less=True) self.clock_domains.cd_sys4x = ClockDomain(reset_less=True) @@ -37,7 +38,7 @@ class _CRG(Module): # # # self.submodules.pll = pll = S7PLL(speedgrade=-1) - self.comb += pll.reset.eq(~platform.request("cpu_reset")) + self.comb += pll.reset.eq(~platform.request("cpu_reset") | self.rst) pll.register_clkin(platform.request("clk100"), 100e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys2x, 2*sys_clk_freq) @@ -67,8 +68,7 @@ class BaseSoC(SoCCore): self.submodules.ddrphy = s7ddrphy.A7DDRPHY(platform.request("ddram"), memtype = "DDR3", nphases = 4, - sys_clk_freq = sys_clk_freq, - interface_type = "MEMORY") + sys_clk_freq = sys_clk_freq) self.add_csr("ddrphy") self.add_sdram("sdram", phy = self.ddrphy, diff --git a/litex_boards/targets/c10lprefkit.py b/litex_boards/targets/c10lprefkit.py index 2b46024..1d6b152 100755 --- a/litex_boards/targets/c10lprefkit.py +++ b/litex_boards/targets/c10lprefkit.py @@ -32,6 +32,7 @@ from litehyperbus.core.hyperbus import HyperRAM class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys_ps = ClockDomain(reset_less=True) @@ -42,7 +43,7 @@ class _CRG(Module): # PLL self.submodules.pll = pll = Cyclone10LPPLL(speedgrade="-A7") - self.comb += pll.reset.eq(~platform.request("cpu_reset")) + self.comb += pll.reset.eq(~platform.request("cpu_reset") | self.rst) pll.register_clkin(clk12, 12e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys_ps, sys_clk_freq, phase=90) diff --git a/litex_boards/targets/camlink_4k.py b/litex_boards/targets/camlink_4k.py index e0eadd3..4f12909 100755 --- a/litex_boards/targets/camlink_4k.py +++ b/litex_boards/targets/camlink_4k.py @@ -29,6 +29,7 @@ from litedram.phy import ECP5DDRPHY class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_init = ClockDomain() self.clock_domains.cd_por = ClockDomain(reset_less=True) self.clock_domains.cd_sys = ClockDomain() @@ -51,7 +52,7 @@ class _CRG(Module): # pll self.submodules.pll = pll = ECP5PLL() - self.comb += pll.reset.eq(~por_done) + self.comb += pll.reset.eq(~por_done | self.rst) pll.register_clkin(clk27, 27e6) pll.create_clkout(self.cd_sys2x_i, 2*sys_clk_freq) pll.create_clkout(self.cd_init, 27e6) diff --git a/litex_boards/targets/colorlight_5a_75x.py b/litex_boards/targets/colorlight_5a_75x.py index c83d666..e9a1563 100755 --- a/litex_boards/targets/colorlight_5a_75x.py +++ b/litex_boards/targets/colorlight_5a_75x.py @@ -66,6 +66,7 @@ from liteeth.phy.ecp5rgmii import LiteEthPHYRGMII class _CRG(Module): def __init__(self, platform, sys_clk_freq, use_internal_osc=False, with_usb_pll=False, with_rst=True, sdram_rate="1:1"): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() if sdram_rate == "1:2": self.clock_domains.cd_sys2x = ClockDomain() @@ -91,7 +92,7 @@ class _CRG(Module): # PLL self.submodules.pll = pll = ECP5PLL() - self.comb += pll.reset.eq(~rst_n) + self.comb += pll.reset.eq(~rst_n | self.rst) pll.register_clkin(clk, clk_freq) pll.create_clkout(self.cd_sys, sys_clk_freq) if sdram_rate == "1:2": @@ -103,7 +104,7 @@ class _CRG(Module): # USB PLL if with_usb_pll: self.submodules.usb_pll = usb_pll = ECP5PLL() - self.comb += usb_pll.reset.eq(~rst_n) + self.comb += usb_pll.reset.eq(~rst_n | self.rst) usb_pll.register_clkin(clk, clk_freq) self.clock_domains.cd_usb_12 = ClockDomain() self.clock_domains.cd_usb_48 = ClockDomain() diff --git a/litex_boards/targets/crosslink_nx_evn.py b/litex_boards/targets/crosslink_nx_evn.py index f01911c..dcb4a03 100755 --- a/litex_boards/targets/crosslink_nx_evn.py +++ b/litex_boards/targets/crosslink_nx_evn.py @@ -33,6 +33,7 @@ mB = 1024*kB class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_por = ClockDomain() @@ -49,7 +50,7 @@ class _CRG(Module): self.comb += self.cd_por.clk.eq(self.cd_sys.clk) self.sync.por += If(por_counter != 0, por_counter.eq(por_counter - 1)) self.specials += AsyncResetSynchronizer(self.cd_por, ~rst_n) - self.specials += AsyncResetSynchronizer(self.cd_sys, (por_counter != 0)) + self.specials += AsyncResetSynchronizer(self.cd_sys, (por_counter != 0) | self.rst) # BaseSoC ------------------------------------------------------------------------------------------ diff --git a/litex_boards/targets/crosslink_nx_vip.py b/litex_boards/targets/crosslink_nx_vip.py index 299f000..1da6c5b 100755 --- a/litex_boards/targets/crosslink_nx_vip.py +++ b/litex_boards/targets/crosslink_nx_vip.py @@ -39,6 +39,7 @@ mB = 1024*kB class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_por = ClockDomain() @@ -55,7 +56,7 @@ class _CRG(Module): self.comb += self.cd_por.clk.eq(self.cd_sys.clk) self.sync.por += If(por_counter != 0, por_counter.eq(por_counter - 1)) self.specials += AsyncResetSynchronizer(self.cd_por, ~rst_n) - self.specials += AsyncResetSynchronizer(self.cd_sys, (por_counter != 0)) + self.specials += AsyncResetSynchronizer(self.cd_sys, (por_counter != 0) | self.rst) # BaseSoC ------------------------------------------------------------------------------------------ diff --git a/litex_boards/targets/de0nano.py b/litex_boards/targets/de0nano.py index c8717be..8f3d5b8 100755 --- a/litex_boards/targets/de0nano.py +++ b/litex_boards/targets/de0nano.py @@ -29,6 +29,7 @@ from litedram.phy import GENSDRPHY, HalfRateGENSDRPHY class _CRG(Module): def __init__(self, platform, sys_clk_freq, sdram_rate="1:1"): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() if sdram_rate == "1:2": self.clock_domains.cd_sys2x = ClockDomain() @@ -43,6 +44,7 @@ class _CRG(Module): # PLL self.submodules.pll = pll = CycloneIVPLL(speedgrade="-6") + self.comb += pll.reset.eq(self.rst) pll.register_clkin(clk50, 50e6) pll.create_clkout(self.cd_sys, sys_clk_freq) if sdram_rate == "1:2": diff --git a/litex_boards/targets/de10lite.py b/litex_boards/targets/de10lite.py index 8374a3e..10ff746 100755 --- a/litex_boards/targets/de10lite.py +++ b/litex_boards/targets/de10lite.py @@ -32,6 +32,7 @@ from litevideo.terminal.core import Terminal class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys_ps = ClockDomain(reset_less=True) self.clock_domains.cd_vga = ClockDomain(reset_less=True) @@ -43,6 +44,7 @@ class _CRG(Module): # PLL self.submodules.pll = pll = Max10PLL(speedgrade="-7") + self.comb += pll.reset.eq(self.rst) pll.register_clkin(clk50, 50e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys_ps, sys_clk_freq, phase=90) diff --git a/litex_boards/targets/de10nano.py b/litex_boards/targets/de10nano.py index af0897b..2dbd757 100755 --- a/litex_boards/targets/de10nano.py +++ b/litex_boards/targets/de10nano.py @@ -32,6 +32,7 @@ from litevideo.terminal.core import Terminal class _CRG(Module): def __init__(self, platform, sys_clk_freq, with_sdram=False, sdram_rate="1:1"): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() if sdram_rate == "1:2": self.clock_domains.cd_sys2x = ClockDomain() @@ -47,6 +48,7 @@ class _CRG(Module): # PLL self.submodules.pll = pll = CycloneVPLL(speedgrade="-I7") + self.comb += pll.reset.eq(self.rst) pll.register_clkin(clk50, 50e6) pll.create_clkout(self.cd_sys, sys_clk_freq) if sdram_rate == "1:2": diff --git a/litex_boards/targets/de1soc.py b/litex_boards/targets/de1soc.py index a9da9bf..574d82c 100755 --- a/litex_boards/targets/de1soc.py +++ b/litex_boards/targets/de1soc.py @@ -28,6 +28,7 @@ from litedram.phy import GENSDRPHY class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys_ps = ClockDomain(reset_less=True) @@ -38,6 +39,7 @@ class _CRG(Module): # PLL self.submodules.pll = pll = CycloneVPLL(speedgrade="-C6") + self.comb += pll.reset.eq(self.rst) pll.register_clkin(clk50, 50e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys_ps, sys_clk_freq, phase=90) diff --git a/litex_boards/targets/de2_115.py b/litex_boards/targets/de2_115.py index 12edf06..e108ed0 100755 --- a/litex_boards/targets/de2_115.py +++ b/litex_boards/targets/de2_115.py @@ -28,6 +28,7 @@ from litedram.phy import GENSDRPHY class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys_ps = ClockDomain(reset_less=True) @@ -38,6 +39,7 @@ class _CRG(Module): # PLL self.submodules.pll = pll = CycloneIVPLL(speedgrade="-7") + self.comb += pll.reset.eq(self.rst) pll.register_clkin(clk50, 50e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys_ps, sys_clk_freq, phase=90) diff --git a/litex_boards/targets/ecp5_evn.py b/litex_boards/targets/ecp5_evn.py index 49688e0..f97e600 100755 --- a/litex_boards/targets/ecp5_evn.py +++ b/litex_boards/targets/ecp5_evn.py @@ -23,6 +23,7 @@ from litex.soc.cores.led import LedChaser class _CRG(Module): def __init__(self, platform, sys_clk_freq, x5_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() # # # @@ -37,7 +38,7 @@ class _CRG(Module): # pll self.submodules.pll = pll = ECP5PLL() - self.comb += pll.reset.eq(~rst_n) + self.comb += pll.reset.eq(~rst_n | self.rst) pll.register_clkin(clk, x5_clk_freq or 12e6) pll.create_clkout(self.cd_sys, sys_clk_freq) diff --git a/litex_boards/targets/ecpix5.py b/litex_boards/targets/ecpix5.py index cfe72b6..0a21bcb 100755 --- a/litex_boards/targets/ecpix5.py +++ b/litex_boards/targets/ecpix5.py @@ -30,6 +30,7 @@ from liteeth.phy.ecp5rgmii import LiteEthPHYRGMII class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_init = ClockDomain() self.clock_domains.cd_por = ClockDomain(reset_less=True) self.clock_domains.cd_sys = ClockDomain() @@ -54,7 +55,7 @@ class _CRG(Module): # PLL self.submodules.pll = pll = ECP5PLL() - self.comb += pll.reset.eq(~por_done | ~rst_n) + self.comb += pll.reset.eq(~por_done | ~rst_n | self.rst) pll.register_clkin(clk100, 100e6) pll.create_clkout(self.cd_sys2x_i, 2*sys_clk_freq) pll.create_clkout(self.cd_init, 25e6) @@ -69,8 +70,8 @@ class _CRG(Module): i_CLKI = self.cd_sys2x.clk, i_RST = self.reset, o_CDIVX = self.cd_sys.clk), - AsyncResetSynchronizer(self.cd_sys, ~pll.locked | self.reset), - AsyncResetSynchronizer(self.cd_sys2x, ~pll.locked | self.reset), + AsyncResetSynchronizer(self.cd_sys, ~pll.locked | self.reset | self.rst), + AsyncResetSynchronizer(self.cd_sys2x, ~pll.locked | self.reset | self.rst), ] # BaseSoC ------------------------------------------------------------------------------------------ diff --git a/litex_boards/targets/fk33.py b/litex_boards/targets/fk33.py index 310b7bb..c112695 100755 --- a/litex_boards/targets/fk33.py +++ b/litex_boards/targets/fk33.py @@ -29,11 +29,13 @@ from litepcie.software import generate_litepcie_software class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() # # # self.submodules.pll = pll = USPMMCM(speedgrade=-2) + self.comb += pll.reset.eq(self.rst) pll.register_clkin(platform.request("clk200"), 200e6) pll.create_clkout(self.cd_sys, sys_clk_freq) diff --git a/litex_boards/targets/fomu.py b/litex_boards/targets/fomu.py index f8a73fd..7ebce41 100755 --- a/litex_boards/targets/fomu.py +++ b/litex_boards/targets/fomu.py @@ -33,6 +33,7 @@ mB = 1024*kB class _CRG(Module): def __init__(self, platform, sys_clk_freq): assert sys_clk_freq == 12e6 + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_por = ClockDomain(reset_less=True) self.clock_domains.cd_usb_12 = ClockDomain() @@ -53,6 +54,7 @@ class _CRG(Module): # USB PLL self.submodules.pll = pll = iCE40PLL() + self.comb += pll.reset.eq(self.rst) pll.clko_freq_range = ( 12e6, 275e9) # FIXME: improve iCE40PLL to avoid lowering clko_freq_min. pll.register_clkin(clk48, 48e6) pll.create_clkout(self.cd_usb_12, 12e6, with_reset=False) diff --git a/litex_boards/targets/genesys2.py b/litex_boards/targets/genesys2.py index b2ea77d..002db8b 100755 --- a/litex_boards/targets/genesys2.py +++ b/litex_boards/targets/genesys2.py @@ -28,6 +28,7 @@ from liteeth.phy.s7rgmii import LiteEthPHYRGMII class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys4x = ClockDomain(reset_less=True) self.clock_domains.cd_idelay = ClockDomain() @@ -35,7 +36,7 @@ class _CRG(Module): # # # self.submodules.pll = pll = S7MMCM(speedgrade=-2) - self.comb += pll.reset.eq(~platform.request("cpu_reset_n")) + self.comb += pll.reset.eq(~platform.request("cpu_reset_n") | self.rst) pll.register_clkin(platform.request("clk200"), 200e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq) diff --git a/litex_boards/targets/hadbadge.py b/litex_boards/targets/hadbadge.py index 9a6e8fe..c35ce9d 100755 --- a/litex_boards/targets/hadbadge.py +++ b/litex_boards/targets/hadbadge.py @@ -35,6 +35,7 @@ from litedram.modules import AS4C32M8 class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys_ps = ClockDomain(reset_less=True) @@ -45,6 +46,7 @@ class _CRG(Module): # PLL self.submodules.pll = pll = ECP5PLL() + self.comb += pll.reset.eq(self.rst) pll.register_clkin(clk8, 8e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys_ps, sys_clk_freq, phase=90) diff --git a/litex_boards/targets/icebreaker.py b/litex_boards/targets/icebreaker.py index 3440d37..806f27a 100755 --- a/litex_boards/targets/icebreaker.py +++ b/litex_boards/targets/icebreaker.py @@ -40,6 +40,7 @@ mB = 1024*kB class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_por = ClockDomain(reset_less=True) @@ -58,7 +59,7 @@ class _CRG(Module): # PLL self.submodules.pll = pll = iCE40PLL(primitive="SB_PLL40_PAD") - self.comb += pll.reset.eq(~rst_n) + self.comb += pll.reset.eq(~rst_n | self.rst) pll.register_clkin(clk12, 12e6) pll.create_clkout(self.cd_sys, sys_clk_freq, with_reset=False) self.specials += AsyncResetSynchronizer(self.cd_sys, ~por_done | ~pll.locked) diff --git a/litex_boards/targets/kc705.py b/litex_boards/targets/kc705.py index 4c67880..ad5a21c 100755 --- a/litex_boards/targets/kc705.py +++ b/litex_boards/targets/kc705.py @@ -30,6 +30,7 @@ from liteeth.phy import LiteEthPHY class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys4x = ClockDomain(reset_less=True) self.clock_domains.cd_idelay = ClockDomain() @@ -37,7 +38,7 @@ class _CRG(Module): # # # self.submodules.pll = pll = S7MMCM(speedgrade=-2) - self.comb += pll.reset.eq(platform.request("cpu_reset")) + self.comb += pll.reset.eq(platform.request("cpu_reset") | self.rst) pll.register_clkin(platform.request("clk200"), 200e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq) diff --git a/litex_boards/targets/kcu105.py b/litex_boards/targets/kcu105.py index 65fb8ed..9668934 100755 --- a/litex_boards/targets/kcu105.py +++ b/litex_boards/targets/kcu105.py @@ -28,6 +28,7 @@ from liteeth.phy.ku_1000basex import KU_1000BASEX class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys4x = ClockDomain(reset_less=True) self.clock_domains.cd_pll4x = ClockDomain(reset_less=True) @@ -37,7 +38,7 @@ class _CRG(Module): # # # self.submodules.pll = pll = USMMCM(speedgrade=-2) - self.comb += pll.reset.eq(platform.request("cpu_reset")) + self.comb += pll.reset.eq(platform.request("cpu_reset") | self.rst) pll.register_clkin(platform.request("clk125"), 125e6) pll.create_clkout(self.cd_pll4x, sys_clk_freq*4, buf=None, with_reset=False) pll.create_clkout(self.cd_idelay, 200e6, with_reset=False) diff --git a/litex_boards/targets/kx2.py b/litex_boards/targets/kx2.py index ae31996..e581ad0 100755 --- a/litex_boards/targets/kx2.py +++ b/litex_boards/targets/kx2.py @@ -26,6 +26,7 @@ from litedram.phy import s7ddrphy class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys4x = ClockDomain(reset_less=True) self.clock_domains.cd_idelay = ClockDomain() @@ -33,7 +34,7 @@ class _CRG(Module): # # # self.submodules.pll = pll = S7MMCM(speedgrade=-2) - self.comb += pll.reset.eq(~platform.request("cpu_reset_n")) + self.comb += pll.reset.eq(~platform.request("cpu_reset_n") | self.rst) pll.register_clkin(platform.request("clk200"), 200e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq) diff --git a/litex_boards/targets/linsn_rv901t.py b/litex_boards/targets/linsn_rv901t.py index d810edd..c57951f 100755 --- a/litex_boards/targets/linsn_rv901t.py +++ b/litex_boards/targets/linsn_rv901t.py @@ -31,6 +31,7 @@ from liteeth.mac import LiteEthMAC class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys_ps = ClockDomain(reset_less=True) @@ -39,6 +40,7 @@ class _CRG(Module): clk25 = platform.request("clk25") self.submodules.pll = pll = S6PLL(speedgrade=-2) + self.comb += pll.reset.eq(self.rst) pll.register_clkin(clk25, 25e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys_ps, sys_clk_freq, phase=90) diff --git a/litex_boards/targets/logicbone.py b/litex_boards/targets/logicbone.py index beff7fd..b35624d 100755 --- a/litex_boards/targets/logicbone.py +++ b/litex_boards/targets/logicbone.py @@ -31,6 +31,7 @@ from liteeth.phy.ecp5rgmii import LiteEthPHYRGMII class _CRG(Module): def __init__(self, platform, sys_clk_freq, with_usb_pll=False): + self.rst = Signal() self.clock_domains.cd_init = ClockDomain() self.clock_domains.cd_por = ClockDomain(reset_less=True) self.clock_domains.cd_sys = ClockDomain() @@ -55,7 +56,7 @@ class _CRG(Module): # PLL sys2x_clk_ecsout = Signal() self.submodules.pll = pll = ECP5PLL() - self.comb += pll.reset.eq(~por_done) + self.comb += pll.reset.eq(~por_done | self.rst) pll.register_clkin(clk25, 25e6) pll.create_clkout(self.cd_sys2x_i, 2*sys_clk_freq) pll.create_clkout(self.cd_init, 24e6) @@ -84,7 +85,7 @@ class _CRG(Module): self.clock_domains.cd_usb_48 = ClockDomain() usb_pll = ECP5PLL() self.submodules += usb_pll - self.comb += usb_pll.reset.eq(~por_done) + self.comb += usb_pll.reset.eq(~por_done | self.rst) usb_pll.register_clkin(clk25, 25e6) usb_pll.create_clkout(self.cd_usb_48, 48e6) usb_pll.create_clkout(self.cd_usb_12, 12e6) diff --git a/litex_boards/targets/mercury_xu5.py b/litex_boards/targets/mercury_xu5.py index 89803e2..8a77494 100755 --- a/litex_boards/targets/mercury_xu5.py +++ b/litex_boards/targets/mercury_xu5.py @@ -27,6 +27,7 @@ from litedram.phy import usddrphy class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys4x = ClockDomain(reset_less=True) self.clock_domains.cd_pll4x = ClockDomain(reset_less=True) @@ -35,6 +36,7 @@ class _CRG(Module): # # # self.submodules.pll = pll = USMMCM(speedgrade=-1) + self.comb += pll.reset.eq(self.rst) pll.register_clkin(platform.request("clk100"), 100e6) pll.create_clkout(self.cd_pll4x, sys_clk_freq*4, buf=None, with_reset=False) diff --git a/litex_boards/targets/mimas_a7.py b/litex_boards/targets/mimas_a7.py index 26af0d1..d7c7ea8 100755 --- a/litex_boards/targets/mimas_a7.py +++ b/litex_boards/targets/mimas_a7.py @@ -30,6 +30,7 @@ from liteeth.phy.s7rgmii import LiteEthPHYRGMII class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys4x = ClockDomain(reset_less=True) self.clock_domains.cd_sys4x_dqs = ClockDomain(reset_less=True) @@ -38,7 +39,7 @@ class _CRG(Module): # # # self.submodules.pll = pll = S7PLL(speedgrade=-1) - self.comb += pll.reset.eq(platform.request("cpu_reset")) + self.comb += pll.reset.eq(platform.request("cpu_reset") | self.rst) pll.register_clkin(platform.request("clk100"), 100e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq) diff --git a/litex_boards/targets/minispartan6.py b/litex_boards/targets/minispartan6.py index 15fd3b0..69372c6 100755 --- a/litex_boards/targets/minispartan6.py +++ b/litex_boards/targets/minispartan6.py @@ -32,6 +32,7 @@ from litedram.phy import GENSDRPHY, HalfRateGENSDRPHY class _CRG(Module): def __init__(self, platform, sys_clk_freq, sdram_rate="1:1"): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() if sdram_rate == "1:2": self.clock_domains.cd_sys2x = ClockDomain() @@ -46,6 +47,7 @@ class _CRG(Module): # PLL self.submodules.pll = pll = S6PLL(speedgrade=-1) + self.comb += pll.reset.eq(self.rst) pll.register_clkin(clk32, 32e6) pll.create_clkout(self.cd_sys, sys_clk_freq) if sdram_rate == "1:2": diff --git a/litex_boards/targets/mist.py b/litex_boards/targets/mist.py index 9307442..ae1a8d2 100755 --- a/litex_boards/targets/mist.py +++ b/litex_boards/targets/mist.py @@ -32,6 +32,7 @@ from litevideo.terminal.core import Terminal class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys_ps = ClockDomain(reset_less=True) self.clock_domains.cd_vga = ClockDomain(reset_less=True) @@ -43,6 +44,7 @@ class _CRG(Module): # PLL self.submodules.pll = pll = CycloneIVPLL(speedgrade="-8") + self.comb += pll.reset.eq(self.rst) pll.register_clkin(clk27, 27e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys_ps, sys_clk_freq, phase=90) diff --git a/litex_boards/targets/nereid.py b/litex_boards/targets/nereid.py index 1a72402..366ad6c 100755 --- a/litex_boards/targets/nereid.py +++ b/litex_boards/targets/nereid.py @@ -35,6 +35,7 @@ from litepcie.software import generate_litepcie_software class CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys4x = ClockDomain(reset_less=True) self.clock_domains.cd_idelay = ClockDomain() @@ -44,6 +45,7 @@ class CRG(Module): # PLL self.submodules.pll = pll = S7PLL() + self.comb += pll.reset.eq(self.rst) pll.register_clkin(clk100, 100e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq) diff --git a/litex_boards/targets/netv2.py b/litex_boards/targets/netv2.py index 964130d..0196fb2 100755 --- a/litex_boards/targets/netv2.py +++ b/litex_boards/targets/netv2.py @@ -28,6 +28,7 @@ from liteeth.phy.rmii import LiteEthPHYRMII class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys4x = ClockDomain(reset_less=True) self.clock_domains.cd_sys4x_dqs = ClockDomain(reset_less=True) @@ -38,6 +39,7 @@ class _CRG(Module): # # # self.submodules.pll = pll = S7PLL(speedgrade=-1) + self.comb += pll.reset.eq(self.rst) pll.register_clkin(platform.request("clk50"), 50e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq) diff --git a/litex_boards/targets/nexys4ddr.py b/litex_boards/targets/nexys4ddr.py index fca79a6..d72b766 100755 --- a/litex_boards/targets/nexys4ddr.py +++ b/litex_boards/targets/nexys4ddr.py @@ -28,6 +28,7 @@ from liteeth.phy.rmii import LiteEthPHYRMII class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys2x = ClockDomain(reset_less=True) self.clock_domains.cd_sys2x_dqs = ClockDomain(reset_less=True) @@ -37,7 +38,7 @@ class _CRG(Module): # # # self.submodules.pll = pll = S7MMCM(speedgrade=-1) - self.comb += pll.reset.eq(~platform.request("cpu_reset")) + self.comb += pll.reset.eq(~platform.request("cpu_reset") | self.rst) pll.register_clkin(platform.request("clk100"), 100e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys2x, 2*sys_clk_freq) diff --git a/litex_boards/targets/nexys_video.py b/litex_boards/targets/nexys_video.py index 96c35c3..17b7bb7 100755 --- a/litex_boards/targets/nexys_video.py +++ b/litex_boards/targets/nexys_video.py @@ -28,6 +28,7 @@ from liteeth.phy.s7rgmii import LiteEthPHYRGMII class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys4x = ClockDomain(reset_less=True) self.clock_domains.cd_sys4x_dqs = ClockDomain(reset_less=True) @@ -37,7 +38,7 @@ class _CRG(Module): # # # self.submodules.pll = pll = S7MMCM(speedgrade=-1) - self.comb += pll.reset.eq(~platform.request("cpu_reset")) + self.comb += pll.reset.eq(~platform.request("cpu_reset") | self.rst) pll.register_clkin(platform.request("clk100"), 100e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq) diff --git a/litex_boards/targets/orangecrab.py b/litex_boards/targets/orangecrab.py index 646055f..5bbe14a 100755 --- a/litex_boards/targets/orangecrab.py +++ b/litex_boards/targets/orangecrab.py @@ -31,6 +31,7 @@ from litedram.phy import ECP5DDRPHY class _CRG(Module): def __init__(self, platform, sys_clk_freq, with_usb_pll=False): + self.rst = Signal() self.clock_domains.cd_por = ClockDomain(reset_less=True) self.clock_domains.cd_sys = ClockDomain() @@ -49,7 +50,7 @@ class _CRG(Module): # PLL self.submodules.pll = pll = ECP5PLL() - self.comb += pll.reset.eq(~por_done | ~rst_n) + self.comb += pll.reset.eq(~por_done | ~rst_n | self.rst) pll.register_clkin(clk48, 48e6) pll.create_clkout(self.cd_sys, sys_clk_freq) @@ -59,7 +60,7 @@ class _CRG(Module): self.clock_domains.cd_usb_48 = ClockDomain() usb_pll = ECP5PLL() self.submodules += usb_pll - self.comb += usb_pll.reset.eq(~por_done | ~rst_n) + self.comb += usb_pll.reset.eq(~por_done | ~rst_n | self.rst) usb_pll.register_clkin(clk48, 48e6) usb_pll.create_clkout(self.cd_usb_48, 48e6) usb_pll.create_clkout(self.cd_usb_12, 12e6) diff --git a/litex_boards/targets/pano_logic_g2.py b/litex_boards/targets/pano_logic_g2.py index 91a5b45..0d4d426 100755 --- a/litex_boards/targets/pano_logic_g2.py +++ b/litex_boards/targets/pano_logic_g2.py @@ -25,6 +25,7 @@ from liteeth.phy import LiteEthPHY class _CRG(Module): def __init__(self, platform, clk_freq, with_ethernet=False): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() # # # @@ -35,7 +36,7 @@ class _CRG(Module): self.comb += platform.request("eth_rst_n").eq(1) self.submodules.pll = pll = S6PLL(speedgrade=-2) - self.comb += pll.reset.eq(~platform.request("user_btn_n")) + self.comb += pll.reset.eq(~platform.request("user_btn_n") | self.rst) pll.register_clkin(platform.request("clk125"), 125e6) pll.create_clkout(self.cd_sys, clk_freq) diff --git a/litex_boards/targets/pipistrello.py b/litex_boards/targets/pipistrello.py index 80d48fa..4cae76c 100755 --- a/litex_boards/targets/pipistrello.py +++ b/litex_boards/targets/pipistrello.py @@ -32,6 +32,7 @@ from litedram.phy import s6ddrphy class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sdram_half = ClockDomain() self.clock_domains.cd_sdram_full_wr = ClockDomain() @@ -104,7 +105,7 @@ class _CRG(Module): ) # Power on reset - reset = platform.request("user_btn") | self.reset + reset = platform.request("user_btn") | self.reset | self.rst self.clock_domains.cd_por = ClockDomain() por = Signal(max=1 << 11, reset=(1 << 11) - 1) self.sync.por += If(por != 0, por.eq(por - 1)) diff --git a/litex_boards/targets/tagus.py b/litex_boards/targets/tagus.py index 3212c75..96903e4 100755 --- a/litex_boards/targets/tagus.py +++ b/litex_boards/targets/tagus.py @@ -36,6 +36,7 @@ from litepcie.software import generate_litepcie_software class CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys4x = ClockDomain(reset_less=True) self.clock_domains.cd_sys4x_dqs = ClockDomain(reset_less=True) @@ -46,6 +47,7 @@ class CRG(Module): # PLL self.submodules.pll = pll = S7PLL() + self.comb += pll.reset.eq(self.rst) pll.register_clkin(clk100, 100e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq) diff --git a/litex_boards/targets/tec0117.py b/litex_boards/targets/tec0117.py index 2578576..73bb250 100755 --- a/litex_boards/targets/tec0117.py +++ b/litex_boards/targets/tec0117.py @@ -26,9 +26,7 @@ kB = 1024 mB = 1024*kB class BaseSoC(SoCCore): - mem_map = {**SoCCore.mem_map, **{"spiflash": 0x80000000}} - def __init__(self, bios_flash_offset, **kwargs): platform = tec0117.Platform() sys_clk_freq = int(1e9/platform.default_clk_period) diff --git a/litex_boards/targets/trellisboard.py b/litex_boards/targets/trellisboard.py index d29cd0e..807e57d 100755 --- a/litex_boards/targets/trellisboard.py +++ b/litex_boards/targets/trellisboard.py @@ -31,8 +31,9 @@ from liteeth.phy.ecp5rgmii import LiteEthPHYRGMII class _CRG(Module): def __init__(self, platform, sys_clk_freq): - self.clock_domains.cd_por = ClockDomain(reset_less=True) - self.clock_domains.cd_sys = ClockDomain() + self.rst = Signal() + self.clock_domains.cd_por = ClockDomain(reset_less=True) + self.clock_domains.cd_sys = ClockDomain() # # # @@ -49,12 +50,13 @@ class _CRG(Module): # PLL self.submodules.pll = pll = ECP5PLL() - self.comb += pll.reset.eq(~por_done | rst) + self.comb += pll.reset.eq(~por_done | rst | self.rst) pll.register_clkin(clk12, 12e6) pll.create_clkout(self.cd_sys, sys_clk_freq) class _CRGSDRAM(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_init = ClockDomain() self.clock_domains.cd_por = ClockDomain(reset_less=True) self.clock_domains.cd_sys = ClockDomain() @@ -80,7 +82,7 @@ class _CRGSDRAM(Module): # PLL sys2x_clk_ecsout = Signal() self.submodules.pll = pll = ECP5PLL() - self.comb += pll.reset.eq(~por_done | rst) + self.comb += pll.reset.eq(~por_done | rst | self.rst) pll.register_clkin(clk12, 12e6) pll.create_clkout(self.cd_sys2x_i, 2*sys_clk_freq) pll.create_clkout(self.cd_init, 25e6) diff --git a/litex_boards/targets/ulx3s.py b/litex_boards/targets/ulx3s.py index 316d668..1adc9e0 100755 --- a/litex_boards/targets/ulx3s.py +++ b/litex_boards/targets/ulx3s.py @@ -35,6 +35,7 @@ from litedram.phy import GENSDRPHY, HalfRateGENSDRPHY class _CRG(Module): def __init__(self, platform, sys_clk_freq, with_usb_pll=False, sdram_rate="1:1"): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() if sdram_rate == "1:2": self.clock_domains.cd_sys2x = ClockDomain() @@ -50,7 +51,7 @@ class _CRG(Module): # PLL self.submodules.pll = pll = ECP5PLL() - self.comb += pll.reset.eq(rst) + self.comb += pll.reset.eq(rst | self.rst) pll.register_clkin(clk25, 25e6) pll.create_clkout(self.cd_sys, sys_clk_freq) if sdram_rate == "1:2": @@ -62,7 +63,7 @@ class _CRG(Module): # USB PLL if with_usb_pll: self.submodules.usb_pll = usb_pll = ECP5PLL() - self.comb += usb_pll.reset.eq(rst) + self.comb += usb_pll.reset.eq(rst | self.rst) usb_pll.register_clkin(clk25, 25e6) self.clock_domains.cd_usb_12 = ClockDomain() self.clock_domains.cd_usb_48 = ClockDomain() diff --git a/litex_boards/targets/vc707.py b/litex_boards/targets/vc707.py index 0be2798..4c1649f 100755 --- a/litex_boards/targets/vc707.py +++ b/litex_boards/targets/vc707.py @@ -25,6 +25,7 @@ from litedram.phy import s7ddrphy class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys4x = ClockDomain(reset_less=True) self.clock_domains.cd_idelay = ClockDomain() @@ -32,7 +33,7 @@ class _CRG(Module): # # # self.submodules.pll = pll = S7MMCM(speedgrade=-2) - self.comb += pll.reset.eq(platform.request("cpu_reset")) + self.comb += pll.reset.eq(platform.request("cpu_reset") | self.rst) pll.register_clkin(platform.request("clk200"), 200e6) pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq) diff --git a/litex_boards/targets/vcu118.py b/litex_boards/targets/vcu118.py index cf00272..c1deb57 100755 --- a/litex_boards/targets/vcu118.py +++ b/litex_boards/targets/vcu118.py @@ -27,6 +27,7 @@ from litedram.phy import usddrphy class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys4x = ClockDomain(reset_less=True) self.clock_domains.cd_pll4x = ClockDomain(reset_less=True) @@ -35,7 +36,7 @@ class _CRG(Module): # # # self.submodules.pll = pll = USMMCM(speedgrade=-2) - self.comb += pll.reset.eq(platform.request("cpu_reset")) + self.comb += pll.reset.eq(platform.request("cpu_reset") | self.rst) pll.register_clkin(platform.request("clk125"), 125e6) pll.create_clkout(self.cd_pll4x, sys_clk_freq*4, buf=None, with_reset=False) pll.create_clkout(self.cd_idelay, 500e6, with_reset=False) diff --git a/litex_boards/targets/versa_ecp5.py b/litex_boards/targets/versa_ecp5.py index 22d3152..a4d134a 100755 --- a/litex_boards/targets/versa_ecp5.py +++ b/litex_boards/targets/versa_ecp5.py @@ -32,6 +32,7 @@ from liteeth.phy.ecp5rgmii import LiteEthPHYRGMII class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_init = ClockDomain() self.clock_domains.cd_por = ClockDomain(reset_less=True) self.clock_domains.cd_sys = ClockDomain() @@ -56,7 +57,7 @@ class _CRG(Module): # PLL self.submodules.pll = pll = ECP5PLL() - self.comb += pll.reset.eq(~por_done | ~rst_n) + self.comb += pll.reset.eq(~por_done | ~rst_n | self.rst) pll.register_clkin(clk100, 100e6) pll.create_clkout(self.cd_sys2x_i, 2*sys_clk_freq) pll.create_clkout(self.cd_init, 25e6) diff --git a/litex_boards/targets/xcu1525.py b/litex_boards/targets/xcu1525.py index 6c68ffc..dab99e5 100755 --- a/litex_boards/targets/xcu1525.py +++ b/litex_boards/targets/xcu1525.py @@ -32,6 +32,7 @@ from litepcie.software import generate_litepcie_software class _CRG(Module): def __init__(self, platform, sys_clk_freq, ddram_channel): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys4x = ClockDomain(reset_less=True) self.clock_domains.cd_pll4x = ClockDomain(reset_less=True) @@ -40,6 +41,7 @@ class _CRG(Module): # # # self.submodules.pll = pll = USPMMCM(speedgrade=-2) + self.comb += pll.reset.eq(self.rst) pll.register_clkin(platform.request("clk300", ddram_channel), 300e6) pll.create_clkout(self.cd_pll4x, sys_clk_freq*4, buf=None, with_reset=False) pll.create_clkout(self.cd_idelay, 500e6, with_reset=False) diff --git a/litex_boards/targets/zcu104.py b/litex_boards/targets/zcu104.py index 74d554e..3187864 100755 --- a/litex_boards/targets/zcu104.py +++ b/litex_boards/targets/zcu104.py @@ -28,6 +28,7 @@ from litedram.phy import usddrphy class _CRG(Module): def __init__(self, platform, sys_clk_freq): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys4x = ClockDomain(reset_less=True) self.clock_domains.cd_pll4x = ClockDomain(reset_less=True) @@ -36,6 +37,7 @@ class _CRG(Module): # # # self.submodules.pll = pll = USMMCM(speedgrade=-2) + self.comb += pll.reset.eq(self.rst) pll.register_clkin(platform.request("clk125"), 125e6) pll.create_clkout(self.cd_pll4x, sys_clk_freq*4, buf=None, with_reset=False) pll.create_clkout(self.cd_idelay, 500e6, with_reset=False) diff --git a/litex_boards/targets/zybo_z7.py b/litex_boards/targets/zybo_z7.py index 6241d28..e845263 100755 --- a/litex_boards/targets/zybo_z7.py +++ b/litex_boards/targets/zybo_z7.py @@ -26,6 +26,7 @@ from litex.soc.cores.led import LedChaser class _CRG(Module): def __init__(self, platform, sys_clk_freq, use_ps7_clk=False): + self.rst = Signal() self.clock_domains.cd_sys = ClockDomain() # # # @@ -33,9 +34,10 @@ class _CRG(Module): if use_ps7_clk: assert sys_clk_freq == 100e6 self.comb += ClockSignal("sys").eq(ClockSignal("ps7")) - self.comb += ResetSignal("sys").eq(ResetSignal("ps7")) + self.comb += ResetSignal("sys").eq(ResetSignal("ps7") | self.rst) else: self.submodules.pll = pll = S7PLL(speedgrade=-1) + self.comb += pll.reset.eq(self.rst) pll.register_clkin(platform.request("clk125"), 125e6) pll.create_clkout(self.cd_sys, sys_clk_freq)