sipeed_tang_nano_4k: Integrate new LiteX's GW1NSRPLL.

This commit is contained in:
Florent Kermarrec 2021-09-20 08:40:19 +02:00
parent a5c5ba7652
commit 7161ad18ec

View file

@ -12,6 +12,7 @@ import argparse
from migen import *
from migen.genlib.resetsync import AsyncResetSynchronizer
from litex.soc.cores.clock.gowin_gw1nsr import GW1NSRPLL
from litex.soc.integration.soc_core import *
from litex.soc.integration.soc import SoCRegion
from litex.soc.integration.builder import *
@ -36,8 +37,12 @@ class _CRG(Module):
# Clk / Rst
clk27 = platform.request("clk27")
rst_n = platform.request("user_btn", 0)
self.comb += self.cd_sys.clk.eq(clk27)
self.specials += AsyncResetSynchronizer(self.cd_sys, ~rst_n)
# PLL
self.submodules.pll = pll = GW1NSRPLL(device="GW1NSR-4C")
self.comb += pll.reset.eq(~rst_n)
pll.register_clkin(clk27, 27e6)
pll.create_clkout(self.cd_sys, sys_clk_freq)
# BaseSoC ------------------------------------------------------------------------------------------