taobao_a_e115fb: Minor cleanups.

This commit is contained in:
Florent Kermarrec 2022-06-15 11:55:22 +02:00
parent 0ae1417eb5
commit 29b72fac7e
2 changed files with 9 additions and 10 deletions

View File

@ -13,14 +13,14 @@ from litex.build.altera.programmer import USBBlaster
_io = [ _io = [
# Clk # Clk
("clk25", 0, Pins("AB11"), IOStandard("3.3-V LVTTL")), ("clk25", 0, Pins("AB11"), IOStandard("3.3-V LVTTL")),
("clk27", 0, Pins("A11"), IOStandard("3.3-V LVTTL")), ("clk27", 0, Pins("A11"), IOStandard("3.3-V LVTTL")),
# Rst # Rst
("cpu_reset_n", 0, Pins("N21"), IOStandard("1.8-V")), # N21 ("cpu_reset_n", 0, Pins("N21"), IOStandard("1.8-V")), # N21
# Serial # Serial
("serial", 0, ("serial", 0,
Subsignal("tx", Pins("V3"), IOStandard("3.3-V LVTTL")), # GPIOs close to voltage selector Subsignal("tx", Pins("V3"), IOStandard("3.3-V LVTTL")), # GPIOs close to voltage selector
Subsignal("rx", Pins("AA1"), IOStandard("3.3-V LVTTL")) Subsignal("rx", Pins("AA1"), IOStandard("3.3-V LVTTL"))
), ),
@ -32,7 +32,7 @@ _io = [
# Buttons # Buttons
("user_btn_n", 0, Pins("T1"), IOStandard("3.3-V LVTTL")), # K3 ("user_btn_n", 0, Pins("T1"), IOStandard("3.3-V LVTTL")), # K3
("user_btn_n", 1, Pins("N22"), IOStandard("3.3-V LVTTL")), # K4 ("user_btn_n", 1, Pins("N22"), IOStandard("3.3-V LVTTL")), # K4
] ]
# Platform ----------------------------------------------------------------------------------------- # Platform -----------------------------------------------------------------------------------------

View File

@ -11,35 +11,34 @@ from migen.genlib.resetsync import AsyncResetSynchronizer
from litex_boards.platforms import taobao_a_e115fb from litex_boards.platforms import taobao_a_e115fb
from litex.soc.cores.clock import CycloneIVPLL
from litex.soc.cores.led import LedChaser
from litex.soc.integration.soc_core import * from litex.soc.integration.soc_core import *
from litex.soc.integration.builder import * from litex.soc.integration.builder import *
from litex.soc.cores.clock import CycloneIVPLL
from litex.soc.cores.led import LedChaser
# CRG ---------------------------------------------------------------------------------------------- # CRG ----------------------------------------------------------------------------------------------
class _CRG(Module): class _CRG(Module):
def __init__(self, platform, sys_clk_freq): def __init__(self, platform, sys_clk_freq):
self.rst = Signal() self.rst = Signal()
self.clock_domains.cd_sys = ClockDomain() self.clock_domains.cd_sys = ClockDomain()
# # # # # #
# Clk / Rst # Clk / Rst
clk25 = platform.request("clk25") clk25 = platform.request("clk25")
rst_n = platform.request("cpu_reset_n") rst_n = platform.request("cpu_reset_n")
# PLL # PLL
self.submodules.pll = pll = CycloneIVPLL(speedgrade="-7") self.submodules.pll = pll = CycloneIVPLL(speedgrade="-7")
self.comb += pll.reset.eq(~rst_n | self.rst) self.comb += pll.reset.eq(~rst_n | self.rst)
pll.register_clkin(clk25, 25e6) pll.register_clkin(clk25, 25e6)
pll.create_clkout(self.cd_sys, sys_clk_freq) pll.create_clkout(self.cd_sys, sys_clk_freq)
# BaseSoC ------------------------------------------------------------------------------------------ # BaseSoC ------------------------------------------------------------------------------------------
class BaseSoC(SoCCore): class BaseSoC(SoCCore):
def __init__(self, sys_clk_freq=int(50e6), with_led_chaser=True, def __init__(self, sys_clk_freq=int(50e6), with_led_chaser=True, **kwargs):
**kwargs):
platform = taobao_a_e115fb.Platform() platform = taobao_a_e115fb.Platform()
# CRG -------------------------------------------------------------------------------------- # CRG --------------------------------------------------------------------------------------