mirror of
https://github.com/litex-hub/litex-boards.git
synced 2025-01-03 03:43:36 -05:00
targets/xilinx: use generic name for idelay clk (avoid clk200, clk400, etc...) since we somtimes want to change it.
This commit is contained in:
parent
06137452d2
commit
814e7630e4
22 changed files with 73 additions and 71 deletions
|
@ -45,9 +45,9 @@ class _CRG(Module):
|
|||
pll.create_clkout(self.cd_sys, sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys4x_dqs, 4*sys_clk_freq, phase=90)
|
||||
pll.create_clkout(self.cd_clk200, 200e6)
|
||||
pll.create_clkout(self.cd_idelay, 200e6)
|
||||
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_clk200)
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_idelay)
|
||||
|
||||
# BaseSoC ------------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ class CRG(Module):
|
|||
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()
|
||||
|
||||
# Clk/Rst
|
||||
clk200 = platform.request("clk200")
|
||||
|
@ -66,9 +66,9 @@ class CRG(Module):
|
|||
pll.create_clkout(self.cd_sys, sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys4x_dqs, 4*sys_clk_freq, phase=90)
|
||||
pll.create_clkout(self.cd_clk200, 200e6)
|
||||
pll.create_clkout(self.cd_idelay, 200e6)
|
||||
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_clk200)
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_idelay)
|
||||
|
||||
# BaseSoC -----------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ class CRG(Module):
|
|||
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()
|
||||
|
||||
# Clk/Rst
|
||||
clk100 = platform.request("clk100")
|
||||
|
@ -50,9 +50,9 @@ class CRG(Module):
|
|||
pll.create_clkout(self.cd_sys, sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys4x_dqs, 4*sys_clk_freq, phase=90)
|
||||
pll.create_clkout(self.cd_clk200, 200e6)
|
||||
pll.create_clkout(self.cd_idelay, 200e6)
|
||||
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_clk200)
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_idelay)
|
||||
|
||||
# BaseSoC -----------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ class _CRG(Module):
|
|||
self.clock_domains.cd_sys = ClockDomain()
|
||||
self.clock_domains.cd_sys4x = ClockDomain(reset_less=True)
|
||||
self.clock_domains.cd_pll4x = ClockDomain(reset_less=True)
|
||||
self.clock_domains.cd_clk500 = ClockDomain()
|
||||
self.clock_domains.cd_idelay = ClockDomain()
|
||||
|
||||
# # #
|
||||
|
||||
|
@ -44,7 +44,7 @@ class _CRG(Module):
|
|||
self.comb += pll.reset.eq(0) # FIXME
|
||||
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_clk500, 500e6, with_reset=False)
|
||||
pll.create_clkout(self.cd_idelay, 500e6, with_reset=False)
|
||||
|
||||
self.specials += [
|
||||
Instance("BUFGCE_DIV", name="main_bufgce_div",
|
||||
|
@ -52,10 +52,10 @@ class _CRG(Module):
|
|||
i_CE=1, i_I=self.cd_pll4x.clk, o_O=self.cd_sys.clk),
|
||||
Instance("BUFGCE", name="main_bufgce",
|
||||
i_CE=1, i_I=self.cd_pll4x.clk, o_O=self.cd_sys4x.clk),
|
||||
AsyncResetSynchronizer(self.cd_clk500, ~pll.locked),
|
||||
AsyncResetSynchronizer(self.cd_idelay, ~pll.locked),
|
||||
]
|
||||
|
||||
self.submodules.idelayctrl = USIDELAYCTRL(cd_ref=self.cd_clk500, cd_sys=self.cd_sys)
|
||||
self.submodules.idelayctrl = USIDELAYCTRL(cd_ref=self.cd_idelay, cd_sys=self.cd_sys)
|
||||
|
||||
# BaseSoC ------------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ class _CRG(Module):
|
|||
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.clock_domains.cd_eth = ClockDomain()
|
||||
|
||||
# # #
|
||||
|
@ -43,10 +43,10 @@ class _CRG(Module):
|
|||
pll.create_clkout(self.cd_sys, sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys4x_dqs, 4*sys_clk_freq, phase=90)
|
||||
pll.create_clkout(self.cd_clk200, 200e6)
|
||||
pll.create_clkout(self.cd_idelay, 200e6)
|
||||
pll.create_clkout(self.cd_eth, 25e6)
|
||||
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_clk200)
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_idelay)
|
||||
|
||||
self.comb += platform.request("eth_ref_clk").eq(self.cd_eth.clk)
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ class _CRG(Module):
|
|||
self.clock_domains.cd_sys2x = ClockDomain(reset_less=True)
|
||||
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()
|
||||
|
||||
# # #
|
||||
|
||||
|
@ -43,9 +43,9 @@ class _CRG(Module):
|
|||
pll.create_clkout(self.cd_sys2x, 2*sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys4x_dqs, 4*sys_clk_freq, phase=90)
|
||||
pll.create_clkout(self.cd_clk200, 200e6)
|
||||
pll.create_clkout(self.cd_idelay, 200e6)
|
||||
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_clk200)
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_idelay)
|
||||
|
||||
# BaseSoC ------------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ class _CRG(Module):
|
|||
def __init__(self, platform, sys_clk_freq):
|
||||
self.clock_domains.cd_sys = ClockDomain()
|
||||
self.clock_domains.cd_sys4x = ClockDomain(reset_less=True)
|
||||
self.clock_domains.cd_clk200 = ClockDomain()
|
||||
self.clock_domains.cd_idelay = ClockDomain()
|
||||
|
||||
# # #
|
||||
|
||||
|
@ -39,9 +39,9 @@ class _CRG(Module):
|
|||
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)
|
||||
pll.create_clkout(self.cd_clk200, 200e6)
|
||||
pll.create_clkout(self.cd_idelay, 200e6)
|
||||
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_clk200)
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_idelay)
|
||||
|
||||
# BaseSoC ------------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ class _CRG(Module):
|
|||
def __init__(self, platform, sys_clk_freq):
|
||||
self.clock_domains.cd_sys = ClockDomain()
|
||||
self.clock_domains.cd_sys4x = ClockDomain(reset_less=True)
|
||||
self.clock_domains.cd_clk200 = ClockDomain()
|
||||
self.clock_domains.cd_idelay = ClockDomain()
|
||||
|
||||
# # #
|
||||
|
||||
|
@ -41,9 +41,9 @@ class _CRG(Module):
|
|||
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)
|
||||
pll.create_clkout(self.cd_clk200, 200e6)
|
||||
pll.create_clkout(self.cd_idelay, 200e6)
|
||||
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_clk200)
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_idelay)
|
||||
|
||||
# BaseSoC ------------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class _CRG(Module):
|
|||
self.clock_domains.cd_sys = ClockDomain()
|
||||
self.clock_domains.cd_sys4x = ClockDomain(reset_less=True)
|
||||
self.clock_domains.cd_pll4x = ClockDomain(reset_less=True)
|
||||
self.clock_domains.cd_clk200 = ClockDomain()
|
||||
self.clock_domains.cd_idelay = ClockDomain()
|
||||
self.clock_domains.cd_eth = ClockDomain()
|
||||
|
||||
# # #
|
||||
|
@ -40,7 +40,7 @@ class _CRG(Module):
|
|||
self.comb += pll.reset.eq(platform.request("cpu_reset"))
|
||||
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_clk200, 200e6, with_reset=False)
|
||||
pll.create_clkout(self.cd_idelay, 200e6, with_reset=False)
|
||||
pll.create_clkout(self.cd_eth, 200e6)
|
||||
|
||||
self.specials += [
|
||||
|
@ -49,10 +49,10 @@ class _CRG(Module):
|
|||
i_CE=1, i_I=self.cd_pll4x.clk, o_O=self.cd_sys.clk),
|
||||
Instance("BUFGCE", name="main_bufgce",
|
||||
i_CE=1, i_I=self.cd_pll4x.clk, o_O=self.cd_sys4x.clk),
|
||||
AsyncResetSynchronizer(self.cd_clk200, ~pll.locked),
|
||||
AsyncResetSynchronizer(self.cd_idelay, ~pll.locked),
|
||||
]
|
||||
|
||||
self.submodules.idelayctrl = USIDELAYCTRL(cd_ref=self.cd_clk200, cd_sys=self.cd_sys)
|
||||
self.submodules.idelayctrl = USIDELAYCTRL(cd_ref=self.cd_idelay, cd_sys=self.cd_sys)
|
||||
|
||||
# BaseSoC ------------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class _CRG(Module):
|
|||
def __init__(self, platform, sys_clk_freq):
|
||||
self.clock_domains.cd_sys = ClockDomain()
|
||||
self.clock_domains.cd_sys4x = ClockDomain(reset_less=True)
|
||||
self.clock_domains.cd_clk200 = ClockDomain()
|
||||
self.clock_domains.cd_idelay = ClockDomain()
|
||||
|
||||
# # #
|
||||
|
||||
|
@ -37,9 +37,9 @@ class _CRG(Module):
|
|||
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)
|
||||
pll.create_clkout(self.cd_clk200, 200e6)
|
||||
pll.create_clkout(self.cd_idelay, 200e6)
|
||||
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_clk200)
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_idelay)
|
||||
|
||||
|
||||
# BaseSoC ------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -93,8 +93,10 @@ class _CRG(Module):
|
|||
|
||||
class BaseSoC(SoCCore):
|
||||
def __init__(self, revision="rev0", device="45F", sdram_device="MT41K512M16",
|
||||
with_ethernet=False,
|
||||
sys_clk_freq=int(75e6), toolchain="trellis", **kwargs):
|
||||
with_ethernet = False,
|
||||
sys_clk_freq = int(75e6),
|
||||
toolchain = "trellis",
|
||||
**kwargs):
|
||||
platform = logicbone.Platform(revision=revision, device=device ,toolchain=toolchain)
|
||||
|
||||
# Serial -----------------------------------------------------------------------------------
|
||||
|
|
|
@ -30,7 +30,7 @@ class _CRG(Module):
|
|||
self.clock_domains.cd_sys = ClockDomain()
|
||||
self.clock_domains.cd_sys4x = ClockDomain(reset_less=True)
|
||||
self.clock_domains.cd_pll4x = ClockDomain(reset_less=True)
|
||||
self.clock_domains.cd_clk500 = ClockDomain()
|
||||
self.clock_domains.cd_idelay = ClockDomain()
|
||||
|
||||
# # #
|
||||
|
||||
|
@ -38,7 +38,7 @@ class _CRG(Module):
|
|||
pll.register_clkin(platform.request("clk100"), 100e6)
|
||||
|
||||
pll.create_clkout(self.cd_pll4x, sys_clk_freq*4, buf=None, with_reset=False)
|
||||
pll.create_clkout(self.cd_clk500, 500e6, with_reset=False)
|
||||
pll.create_clkout(self.cd_idelay, 500e6, with_reset=False)
|
||||
|
||||
self.specials += [
|
||||
Instance("BUFGCE_DIV", name="main_bufgce_div",
|
||||
|
@ -46,10 +46,10 @@ class _CRG(Module):
|
|||
i_CE=1, i_I=self.cd_pll4x.clk, o_O=self.cd_sys.clk),
|
||||
Instance("BUFGCE", name="main_bufgce",
|
||||
i_CE=1, i_I=self.cd_pll4x.clk, o_O=self.cd_sys4x.clk),
|
||||
AsyncResetSynchronizer(self.cd_clk500, ~pll.locked),
|
||||
AsyncResetSynchronizer(self.cd_idelay, ~pll.locked),
|
||||
]
|
||||
|
||||
self.submodules.idelayctrl = USIDELAYCTRL(cd_ref=self.cd_clk500, cd_sys=self.cd_sys)
|
||||
self.submodules.idelayctrl = USIDELAYCTRL(cd_ref=self.cd_idelay, cd_sys=self.cd_sys)
|
||||
|
||||
# BaseSoC ------------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ class _CRG(Module):
|
|||
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()
|
||||
|
||||
# # #
|
||||
|
||||
|
@ -43,9 +43,9 @@ class _CRG(Module):
|
|||
pll.create_clkout(self.cd_sys, sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys4x_dqs, 4*sys_clk_freq, phase=90)
|
||||
pll.create_clkout(self.cd_clk200, 200e6)
|
||||
pll.create_clkout(self.cd_idelay, 200e6)
|
||||
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_clk200)
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_idelay)
|
||||
|
||||
# BaseSoC ------------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ class CRG(Module):
|
|||
def __init__(self, platform, sys_clk_freq):
|
||||
self.clock_domains.cd_sys = ClockDomain()
|
||||
self.clock_domains.cd_sys4x = ClockDomain(reset_less=True)
|
||||
self.clock_domains.cd_clk200 = ClockDomain()
|
||||
self.clock_domains.cd_idelay = ClockDomain()
|
||||
|
||||
# Clk/Rst
|
||||
clk100 = platform.request("clk100")
|
||||
|
@ -47,9 +47,9 @@ class CRG(Module):
|
|||
pll.register_clkin(clk100, 100e6)
|
||||
pll.create_clkout(self.cd_sys, sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq)
|
||||
pll.create_clkout(self.cd_clk200, 200e6)
|
||||
pll.create_clkout(self.cd_idelay, 200e6)
|
||||
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_clk200)
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_idelay)
|
||||
|
||||
# BaseSoC -----------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class _CRG(Module):
|
|||
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.clock_domains.cd_clk100 = ClockDomain()
|
||||
self.clock_domains.cd_eth = ClockDomain()
|
||||
|
||||
|
@ -42,11 +42,11 @@ class _CRG(Module):
|
|||
pll.create_clkout(self.cd_sys, sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys4x_dqs, 4*sys_clk_freq, phase=90)
|
||||
pll.create_clkout(self.cd_clk200, 200e6)
|
||||
pll.create_clkout(self.cd_idelay, 200e6)
|
||||
pll.create_clkout(self.cd_clk100, 100e6)
|
||||
pll.create_clkout(self.cd_eth, 50e6)
|
||||
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_clk200)
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_idelay)
|
||||
|
||||
# BaseSoC ------------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class _CRG(Module):
|
|||
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)
|
||||
self.clock_domains.cd_clk200 = ClockDomain()
|
||||
self.clock_domains.cd_idelay = ClockDomain()
|
||||
self.clock_domains.cd_eth = ClockDomain()
|
||||
|
||||
# # #
|
||||
|
@ -42,10 +42,10 @@ class _CRG(Module):
|
|||
pll.create_clkout(self.cd_sys, sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys2x, 2*sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys2x_dqs, 2*sys_clk_freq, phase=90)
|
||||
pll.create_clkout(self.cd_clk200, 200e6)
|
||||
pll.create_clkout(self.cd_idelay, 200e6)
|
||||
pll.create_clkout(self.cd_eth, 50e6)
|
||||
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_clk200)
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_idelay)
|
||||
|
||||
# BaseSoC ------------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class _CRG(Module):
|
|||
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.clock_domains.cd_clk100 = ClockDomain()
|
||||
|
||||
# # #
|
||||
|
@ -42,10 +42,10 @@ class _CRG(Module):
|
|||
pll.create_clkout(self.cd_sys, sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys4x_dqs, 4*sys_clk_freq, phase=90)
|
||||
pll.create_clkout(self.cd_clk200, 200e6)
|
||||
pll.create_clkout(self.cd_idelay, 200e6)
|
||||
pll.create_clkout(self.cd_clk100, 100e6)
|
||||
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_clk200)
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_idelay)
|
||||
|
||||
# BaseSoC ------------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ class CRG(Module):
|
|||
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()
|
||||
|
||||
# Clk/Rst
|
||||
clk100 = platform.request("clk100")
|
||||
|
@ -50,9 +50,9 @@ class CRG(Module):
|
|||
pll.create_clkout(self.cd_sys, sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys4x, 4*sys_clk_freq)
|
||||
pll.create_clkout(self.cd_sys4x_dqs, 4*sys_clk_freq, phase=90)
|
||||
pll.create_clkout(self.cd_clk200, 200e6)
|
||||
pll.create_clkout(self.cd_idelay, 200e6)
|
||||
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_clk200)
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_idelay)
|
||||
|
||||
# BaseSoC -----------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ class _CRG(Module):
|
|||
def __init__(self, platform, sys_clk_freq):
|
||||
self.clock_domains.cd_sys = ClockDomain()
|
||||
self.clock_domains.cd_sys4x = ClockDomain(reset_less=True)
|
||||
self.clock_domains.cd_clk200 = ClockDomain()
|
||||
self.clock_domains.cd_idelay = ClockDomain()
|
||||
|
||||
# # #
|
||||
|
||||
|
@ -36,9 +36,9 @@ class _CRG(Module):
|
|||
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)
|
||||
pll.create_clkout(self.cd_clk200, 200e6)
|
||||
pll.create_clkout(self.cd_idelay, 200e6)
|
||||
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_clk200)
|
||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_idelay)
|
||||
|
||||
# BaseSoC ------------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ class _CRG(Module):
|
|||
self.clock_domains.cd_sys = ClockDomain()
|
||||
self.clock_domains.cd_sys4x = ClockDomain(reset_less=True)
|
||||
self.clock_domains.cd_pll4x = ClockDomain(reset_less=True)
|
||||
self.clock_domains.cd_clk500 = ClockDomain()
|
||||
self.clock_domains.cd_idelay = ClockDomain()
|
||||
|
||||
# # #
|
||||
|
||||
|
@ -38,7 +38,7 @@ class _CRG(Module):
|
|||
self.comb += pll.reset.eq(platform.request("cpu_reset"))
|
||||
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_clk500, 500e6, with_reset=False)
|
||||
pll.create_clkout(self.cd_idelay, 500e6, with_reset=False)
|
||||
|
||||
self.specials += [
|
||||
Instance("BUFGCE_DIV", name="main_bufgce_div",
|
||||
|
@ -46,10 +46,10 @@ class _CRG(Module):
|
|||
i_CE=1, i_I=self.cd_pll4x.clk, o_O=self.cd_sys.clk),
|
||||
Instance("BUFGCE", name="main_bufgce",
|
||||
i_CE=1, i_I=self.cd_pll4x.clk, o_O=self.cd_sys4x.clk),
|
||||
AsyncResetSynchronizer(self.cd_clk500, ~pll.locked),
|
||||
AsyncResetSynchronizer(self.cd_idelay, ~pll.locked),
|
||||
]
|
||||
|
||||
self.submodules.idelayctrl = USIDELAYCTRL(cd_ref=self.cd_clk500, cd_sys=self.cd_sys)
|
||||
self.submodules.idelayctrl = USIDELAYCTRL(cd_ref=self.cd_idelay, cd_sys=self.cd_sys)
|
||||
|
||||
# BaseSoC ------------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -35,14 +35,14 @@ class _CRG(Module):
|
|||
self.clock_domains.cd_sys = ClockDomain()
|
||||
self.clock_domains.cd_sys4x = ClockDomain(reset_less=True)
|
||||
self.clock_domains.cd_pll4x = ClockDomain(reset_less=True)
|
||||
self.clock_domains.cd_clk500 = ClockDomain()
|
||||
self.clock_domains.cd_idelay = ClockDomain()
|
||||
|
||||
# # #
|
||||
|
||||
self.submodules.pll = pll = USPMMCM(speedgrade=-2)
|
||||
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_clk500, 500e6, with_reset=False)
|
||||
pll.create_clkout(self.cd_idelay, 500e6, with_reset=False)
|
||||
|
||||
self.specials += [
|
||||
Instance("BUFGCE_DIV", name="main_bufgce_div",
|
||||
|
@ -50,10 +50,10 @@ class _CRG(Module):
|
|||
i_CE=1, i_I=self.cd_pll4x.clk, o_O=self.cd_sys.clk),
|
||||
Instance("BUFGCE", name="main_bufgce",
|
||||
i_CE=1, i_I=self.cd_pll4x.clk, o_O=self.cd_sys4x.clk),
|
||||
AsyncResetSynchronizer(self.cd_clk500, ~pll.locked),
|
||||
AsyncResetSynchronizer(self.cd_idelay, ~pll.locked),
|
||||
]
|
||||
|
||||
self.submodules.idelayctrl = USPIDELAYCTRL(cd_ref=self.cd_clk500, cd_sys=self.cd_sys)
|
||||
self.submodules.idelayctrl = USPIDELAYCTRL(cd_ref=self.cd_idelay, cd_sys=self.cd_sys)
|
||||
|
||||
# BaseSoC ------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -68,7 +68,7 @@ class BaseSoC(SoCCore):
|
|||
**kwargs)
|
||||
|
||||
# CRG --------------------------------------------------------------------------------------
|
||||
self.submodules.crg = _CRG(platform, sys_clk_freq)
|
||||
self.submodules.crg = _CRG(platform, sys_clk_freq, ddram_channel)
|
||||
|
||||
# DDR4 SDRAM -------------------------------------------------------------------------------
|
||||
if not self.integrated_main_ram_size:
|
||||
|
|
|
@ -31,14 +31,14 @@ class _CRG(Module):
|
|||
self.clock_domains.cd_sys = ClockDomain()
|
||||
self.clock_domains.cd_sys4x = ClockDomain(reset_less=True)
|
||||
self.clock_domains.cd_pll4x = ClockDomain(reset_less=True)
|
||||
self.clock_domains.cd_clk500 = ClockDomain()
|
||||
self.clock_domains.cd_idelay = ClockDomain()
|
||||
|
||||
# # #
|
||||
|
||||
self.submodules.pll = pll = USMMCM(speedgrade=-2)
|
||||
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_clk500, 500e6, with_reset=False)
|
||||
pll.create_clkout(self.cd_idelay, 500e6, with_reset=False)
|
||||
|
||||
self.specials += [
|
||||
Instance("BUFGCE_DIV", name="main_bufgce_div",
|
||||
|
@ -46,10 +46,10 @@ class _CRG(Module):
|
|||
i_CE=1, i_I=self.cd_pll4x.clk, o_O=self.cd_sys.clk),
|
||||
Instance("BUFGCE", name="main_bufgce",
|
||||
i_CE=1, i_I=self.cd_pll4x.clk, o_O=self.cd_sys4x.clk),
|
||||
AsyncResetSynchronizer(self.cd_clk500, ~pll.locked),
|
||||
AsyncResetSynchronizer(self.cd_idelay, ~pll.locked),
|
||||
]
|
||||
|
||||
self.submodules.idelayctrl = USIDELAYCTRL(cd_ref=self.cd_clk500, cd_sys=self.cd_sys)
|
||||
self.submodules.idelayctrl = USIDELAYCTRL(cd_ref=self.cd_idelay, cd_sys=self.cd_sys)
|
||||
|
||||
# BaseSoC ------------------------------------------------------------------------------------------
|
||||
|
||||
|
|
Loading…
Reference in a new issue