targets/ulx3s: for now revert to 25MHz clock/no pll

This commit is contained in:
Florent Kermarrec 2018-11-12 09:44:32 +01:00
parent d1baae36a6
commit 87c7d23d16
1 changed files with 17 additions and 44 deletions

View File

@ -26,65 +26,38 @@ class _CRG(Module):
rst = platform.request("rst") rst = platform.request("rst")
# sys_clk # sys_clk
self.comb += self.cd_sys.clk.eq(clk25)
# FIXME: AsyncResetSynchronizer needs FD1S3BX support. # FIXME: AsyncResetSynchronizer needs FD1S3BX support.
#self.specials += AsyncResetSynchronizer(self.cd_sys, rst) #self.specials += AsyncResetSynchronizer(self.cd_sys, rst)
self.comb += self.cd_sys.rst.eq(rst) self.comb += self.cd_sys.rst.eq(rst)
self.comb += self.cd_sys_ps.rst.eq(rst)
sys_clk = Signal() # sys_clk phase shifted (for sdram)
sdram_ps_clk = Signal() sdram_ps_clk = self.cd_sys.clk
# FIXME: phase shift with luts, needs PLL support.
self.specials += Instance( sdram_ps_luts = 5
"EHXPLLL", for i in range(sdram_ps_luts):
i_CLKI=clk25, new_sdram_ps_clk = Signal()
i_CLKFB=sys_clk, self.specials += Instance("LUT4",
i_PHASESEL1=0, p_INIT=2,
i_PHASESEL0=0, i_A=sdram_ps_clk,
i_PHASEDIR=0, i_B=0,
i_PHASESTEP=0, i_C=0,
i_PHASELOADREG=0, i_D=0,
i_STDBY=0, o_Z=new_sdram_ps_clk)
i_PLLWAKESYNC=0, sdram_ps_clk = new_sdram_ps_clk
i_RST=0,
i_ENCLKOP=0,
i_ENCLKOS=0,
o_CLKOP=sys_clk,
o_CLKOS=sdram_ps_clk,
p_CLKOS_FPHASE=2,
p_CLKOS_CPHASE=15,
p_CLKOP_FPHASE=0,
p_CLKOP_CPHASE=12,
p_PLL_LOCK_MODE=0,
p_OUTDIVIDER_MUXB="DIVB",
p_CLKOS_ENABLE="ENABLED",
p_CLKOP_ENABLE="ENABLED",
p_CLKOS_DIV=13,
p_CLKOP_DIV=13,
p_CLKFB_DIV=2,
p_CLKI_DIV=1,
p_FEEDBK_PATH="CLKOP",
attr=[("ICP_CURRENT", "6"), ("LPF_RESISTOR", "16"), ("MFG_ENABLE_FILTEROPAMP", "1"), ("MFG_GMCREF_SEL", "2")]
)
self.comb += self.cd_sys.clk.eq(sys_clk)
self.comb += self.cd_sys_ps.clk.eq(sdram_ps_clk) self.comb += self.cd_sys_ps.clk.eq(sdram_ps_clk)
sdram_clock = platform.request("sdram_clock") sdram_clock = platform.request("sdram_clock")
self.comb += sdram_clock.eq(sys_clk) self.comb += sdram_clock.eq(sdram_ps_clk)
# Stop ESP32 from resetting FPGA # Stop ESP32 from resetting FPGA
wifi_gpio0 = platform.request("wifi_gpio0") wifi_gpio0 = platform.request("wifi_gpio0")
self.comb += wifi_gpio0.eq(1) self.comb += wifi_gpio0.eq(1)
ext0p = platform.request("ext0p")
self.comb += ext0p.eq(sdram_ps_clk)
ext1p = platform.request("ext1p")
self.comb += ext1p.eq(self.cd_sys.clk)
class BaseSoC(SoCSDRAM): class BaseSoC(SoCSDRAM):
def __init__(self, **kwargs): def __init__(self, **kwargs):
platform = ulx3s.Platform(toolchain="prjtrellis") platform = ulx3s.Platform(toolchain="prjtrellis")
sys_clk_freq = int(50e6) sys_clk_freq = int(25e6)
SoCSDRAM.__init__(self, platform, clk_freq=sys_clk_freq, SoCSDRAM.__init__(self, platform, clk_freq=sys_clk_freq,
l2_size=32, l2_size=32,
integrated_rom_size=0x8000, integrated_rom_size=0x8000,