mirror of
https://github.com/saymrwulf/litex-boards.git
synced 2026-11-21 09:54:20 +00:00
partner/community/targets: uniformize, improve presentation
This commit is contained in:
parent
1b1370d086
commit
f7fbfb4639
10 changed files with 256 additions and 219 deletions
|
|
@ -53,20 +53,27 @@ class _CRG(Module):
|
||||||
class BaseSoC(SoCSDRAM):
|
class BaseSoC(SoCSDRAM):
|
||||||
def __init__(self, sys_clk_freq=int(100e6), **kwargs):
|
def __init__(self, sys_clk_freq=int(100e6), **kwargs):
|
||||||
platform = ac701.Platform()
|
platform = ac701.Platform()
|
||||||
|
|
||||||
|
# SoCSDRAM ---------------------------------------------------------------------------------
|
||||||
SoCSDRAM.__init__(self, platform, clk_freq=sys_clk_freq,
|
SoCSDRAM.__init__(self, platform, clk_freq=sys_clk_freq,
|
||||||
integrated_rom_size=0x8000,
|
integrated_rom_size=0x8000,
|
||||||
integrated_sram_size=0x8000,
|
integrated_sram_size=0x8000,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
|
# CRG --------------------------------------------------------------------------------------
|
||||||
self.submodules.crg = _CRG(platform, sys_clk_freq)
|
self.submodules.crg = _CRG(platform, sys_clk_freq)
|
||||||
|
|
||||||
# sdram
|
# DDR3 SDRAM -------------------------------------------------------------------------------
|
||||||
self.submodules.ddrphy = s7ddrphy.A7DDRPHY(platform.request("ddram"), sys_clk_freq=sys_clk_freq)
|
if not self.integrated_main_ram_size:
|
||||||
|
self.submodules.ddrphy = s7ddrphy.A7DDRPHY(platform.request("ddram"),
|
||||||
|
memtype = "DDR3",
|
||||||
|
nphases = 4,
|
||||||
|
sys_clk_freq = sys_clk_freq)
|
||||||
self.add_csr("ddrphy")
|
self.add_csr("ddrphy")
|
||||||
sdram_module = MT8JTF12864(sys_clk_freq, "1:4")
|
sdram_module = MT8JTF12864(sys_clk_freq, "1:4")
|
||||||
self.register_sdram(self.ddrphy,
|
self.register_sdram(self.ddrphy,
|
||||||
sdram_module.geom_settings,
|
geom_settings = sdram_module.geom_settings,
|
||||||
sdram_module.timing_settings)
|
timing_settings = sdram_module.timing_settings)
|
||||||
|
|
||||||
# EthernetSoC --------------------------------------------------------------------------------------
|
# EthernetSoC --------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
@ -80,6 +87,7 @@ class EthernetSoC(BaseSoC):
|
||||||
assert phy in ["rgmii", "1000basex"]
|
assert phy in ["rgmii", "1000basex"]
|
||||||
BaseSoC.__init__(self, **kwargs)
|
BaseSoC.__init__(self, **kwargs)
|
||||||
|
|
||||||
|
# RGMII Ethernet PHY -----------------------------------------------------------------------
|
||||||
if phy == "rgmii":
|
if phy == "rgmii":
|
||||||
self.submodules.ethphy = LiteEthPHYRGMII(self.platform.request("eth_clocks"),
|
self.submodules.ethphy = LiteEthPHYRGMII(self.platform.request("eth_clocks"),
|
||||||
self.platform.request("eth"))
|
self.platform.request("eth"))
|
||||||
|
|
@ -93,6 +101,7 @@ class EthernetSoC(BaseSoC):
|
||||||
self.ethphy.crg.cd_eth_rx.clk,
|
self.ethphy.crg.cd_eth_rx.clk,
|
||||||
self.ethphy.crg.cd_eth_tx.clk)
|
self.ethphy.crg.cd_eth_tx.clk)
|
||||||
|
|
||||||
|
# 1000BaseX Ethernet PHY -------------------------------------------------------------------
|
||||||
if phy == "1000basex":
|
if phy == "1000basex":
|
||||||
self.comb += self.platform.request("sfp_mgt_clk_sel0", 0).eq(0)
|
self.comb += self.platform.request("sfp_mgt_clk_sel0", 0).eq(0)
|
||||||
self.comb += self.platform.request("sfp_mgt_clk_sel1", 0).eq(0)
|
self.comb += self.platform.request("sfp_mgt_clk_sel1", 0).eq(0)
|
||||||
|
|
@ -120,6 +129,7 @@ class EthernetSoC(BaseSoC):
|
||||||
self.ethphy.txoutclk,
|
self.ethphy.txoutclk,
|
||||||
self.ethphy.rxoutclk)
|
self.ethphy.rxoutclk)
|
||||||
|
|
||||||
|
# Ethernet MAC -----------------------------------------------------------------------------
|
||||||
self.submodules.ethmac = LiteEthMAC(phy=self.ethphy, dw=32,
|
self.submodules.ethmac = LiteEthMAC(phy=self.ethphy, dw=32,
|
||||||
interface="wishbone", endianness=self.cpu.endianness)
|
interface="wishbone", endianness=self.cpu.endianness)
|
||||||
self.add_wb_slave(mem_decoder(self.mem_map["ethmac"]), self.ethmac.bus)
|
self.add_wb_slave(mem_decoder(self.mem_map["ethmac"]), self.ethmac.bus)
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ from litedram.modules import IS42S16320
|
||||||
from litedram.phy import GENSDRPHY
|
from litedram.phy import GENSDRPHY
|
||||||
|
|
||||||
# CRG ----------------------------------------------------------------------------------------------
|
# CRG ----------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class _CRG(Module):
|
class _CRG(Module):
|
||||||
def __init__(self, platform):
|
def __init__(self, platform):
|
||||||
self.clock_domains.cd_sys = ClockDomain()
|
self.clock_domains.cd_sys = ClockDomain()
|
||||||
|
|
@ -69,18 +70,22 @@ class BaseSoC(SoCSDRAM):
|
||||||
def __init__(self, sys_clk_freq=int(50e6), **kwargs):
|
def __init__(self, sys_clk_freq=int(50e6), **kwargs):
|
||||||
assert sys_clk_freq == int(50e6)
|
assert sys_clk_freq == int(50e6)
|
||||||
platform = de10lite.Platform()
|
platform = de10lite.Platform()
|
||||||
|
|
||||||
|
# SoCSDRAM ---------------------------------------------------------------------------------
|
||||||
SoCSDRAM.__init__(self, platform, clk_freq=sys_clk_freq,
|
SoCSDRAM.__init__(self, platform, clk_freq=sys_clk_freq,
|
||||||
integrated_rom_size=0x8000,
|
integrated_rom_size=0x8000,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
|
# CRG --------------------------------------------------------------------------------------
|
||||||
self.submodules.crg = _CRG(platform)
|
self.submodules.crg = _CRG(platform)
|
||||||
|
|
||||||
|
# SDR SDRAM --------------------------------------------------------------------------------
|
||||||
if not self.integrated_main_ram_size:
|
if not self.integrated_main_ram_size:
|
||||||
self.submodules.sdrphy = GENSDRPHY(platform.request("sdram"))
|
self.submodules.sdrphy = GENSDRPHY(platform.request("sdram"))
|
||||||
sdram_module = IS42S16320(self.clk_freq, "1:1")
|
sdram_module = IS42S16320(self.clk_freq, "1:1")
|
||||||
self.register_sdram(self.sdrphy,
|
self.register_sdram(self.sdrphy,
|
||||||
sdram_module.geom_settings,
|
geom_settings = sdram_module.geom_settings,
|
||||||
sdram_module.timing_settings)
|
timing_settings = sdram_module.timing_settings)
|
||||||
|
|
||||||
# Build --------------------------------------------------------------------------------------------
|
# Build --------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ from litex.soc.integration.builder import *
|
||||||
from litedram.modules import IS42S16320
|
from litedram.modules import IS42S16320
|
||||||
from litedram.phy import GENSDRPHY
|
from litedram.phy import GENSDRPHY
|
||||||
|
|
||||||
# CRG ------------------------------------------------------------------
|
# CRG ----------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class _CRG(Module):
|
class _CRG(Module):
|
||||||
def __init__(self, platform):
|
def __init__(self, platform):
|
||||||
|
|
@ -62,18 +62,22 @@ class _CRG(Module):
|
||||||
)
|
)
|
||||||
self.comb += platform.request("sdram_clock").eq(self.cd_sys_ps.clk)
|
self.comb += platform.request("sdram_clock").eq(self.cd_sys_ps.clk)
|
||||||
|
|
||||||
# BaseSoC --------------------------------------------------------------
|
# BaseSoC ------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class BaseSoC(SoCSDRAM):
|
class BaseSoC(SoCSDRAM):
|
||||||
def __init__(self, sys_clk_freq=int(50e6), **kwargs):
|
def __init__(self, sys_clk_freq=int(50e6), **kwargs):
|
||||||
assert sys_clk_freq == int(50e6)
|
assert sys_clk_freq == int(50e6)
|
||||||
platform = de1soc.Platform()
|
platform = de1soc.Platform()
|
||||||
|
|
||||||
|
# SoCSDRAM ---------------------------------------------------------------------------------
|
||||||
SoCSDRAM.__init__(self, platform, clk_freq=sys_clk_freq,
|
SoCSDRAM.__init__(self, platform, clk_freq=sys_clk_freq,
|
||||||
integrated_rom_size=0x8000,
|
integrated_rom_size=0x8000,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
|
# CRG --------------------------------------------------------------------------------------
|
||||||
self.submodules.crg = _CRG(platform)
|
self.submodules.crg = _CRG(platform)
|
||||||
|
|
||||||
|
# SDR SDRAM --------------------------------------------------------------------------------
|
||||||
if not self.integrated_main_ram_size:
|
if not self.integrated_main_ram_size:
|
||||||
self.submodules.sdrphy = GENSDRPHY(platform.request("sdram"))
|
self.submodules.sdrphy = GENSDRPHY(platform.request("sdram"))
|
||||||
# ISSI IS42S16320D-7TL
|
# ISSI IS42S16320D-7TL
|
||||||
|
|
@ -82,7 +86,7 @@ class BaseSoC(SoCSDRAM):
|
||||||
sdram_module.geom_settings,
|
sdram_module.geom_settings,
|
||||||
sdram_module.timing_settings)
|
sdram_module.timing_settings)
|
||||||
|
|
||||||
# Build ----------------------------------------------------------------
|
# Build --------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser(description="LiteX SoC on DE1-SoC")
|
parser = argparse.ArgumentParser(description="LiteX SoC on DE1-SoC")
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ from litex.soc.integration.builder import *
|
||||||
from litedram.modules import IS42S16320
|
from litedram.modules import IS42S16320
|
||||||
from litedram.phy import GENSDRPHY
|
from litedram.phy import GENSDRPHY
|
||||||
|
|
||||||
# CRG ------------------------------------------------------------------
|
# CRG ----------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class _CRG(Module):
|
class _CRG(Module):
|
||||||
def __init__(self, platform):
|
def __init__(self, platform):
|
||||||
|
|
@ -62,27 +62,31 @@ class _CRG(Module):
|
||||||
)
|
)
|
||||||
self.comb += platform.request("sdram_clock").eq(self.cd_sys_ps.clk)
|
self.comb += platform.request("sdram_clock").eq(self.cd_sys_ps.clk)
|
||||||
|
|
||||||
# BaseSoC --------------------------------------------------------------
|
# BaseSoC ------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class BaseSoC(SoCSDRAM):
|
class BaseSoC(SoCSDRAM):
|
||||||
def __init__(self, sys_clk_freq=int(50e6), **kwargs):
|
def __init__(self, sys_clk_freq=int(50e6), **kwargs):
|
||||||
assert sys_clk_freq == int(50e6)
|
assert sys_clk_freq == int(50e6)
|
||||||
platform = de2_115.Platform()
|
platform = de2_115.Platform()
|
||||||
|
|
||||||
|
# SoCSDRAM ---------------------------------------------------------------------------------
|
||||||
SoCSDRAM.__init__(self, platform, clk_freq=sys_clk_freq,
|
SoCSDRAM.__init__(self, platform, clk_freq=sys_clk_freq,
|
||||||
integrated_rom_size=0x8000,
|
integrated_rom_size=0x8000,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
|
# CRG --------------------------------------------------------------------------------------
|
||||||
self.submodules.crg = _CRG(platform)
|
self.submodules.crg = _CRG(platform)
|
||||||
|
|
||||||
|
# SDR SDRAM --------------------------------------------------------------------------------
|
||||||
if not self.integrated_main_ram_size:
|
if not self.integrated_main_ram_size:
|
||||||
self.submodules.sdrphy = GENSDRPHY(platform.request("sdram"))
|
self.submodules.sdrphy = GENSDRPHY(platform.request("sdram"))
|
||||||
# ISSI IS42S16320D-7TL
|
# ISSI IS42S16320D-7TL
|
||||||
sdram_module = IS42S16320(self.clk_freq, "1:1")
|
sdram_module = IS42S16320(self.clk_freq, "1:1")
|
||||||
self.register_sdram(self.sdrphy,
|
self.register_sdram(self.sdrphy,
|
||||||
sdram_module.geom_settings,
|
geom_settings = sdram_module.geom_settings,
|
||||||
sdram_module.timing_settings)
|
timing_settings = sdram_module.timing_settings)
|
||||||
|
|
||||||
# Build ----------------------------------------------------------------
|
# Build --------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser(description="LiteX SoC on DE2-115")
|
parser = argparse.ArgumentParser(description="LiteX SoC on DE2-115")
|
||||||
|
|
|
||||||
|
|
@ -45,11 +45,13 @@ class _CRG(Module):
|
||||||
class BaseSoC(SoCCore):
|
class BaseSoC(SoCCore):
|
||||||
def __init__(self, sys_clk_freq=int(50e6), x5_clk_freq=None, toolchain="diamond", **kwargs):
|
def __init__(self, sys_clk_freq=int(50e6), x5_clk_freq=None, toolchain="diamond", **kwargs):
|
||||||
platform = ecp5_evn.Platform(toolchain=toolchain)
|
platform = ecp5_evn.Platform(toolchain=toolchain)
|
||||||
|
|
||||||
|
# SoCCore ----------------------------------------------------------------------------------
|
||||||
SoCCore.__init__(self, platform, clk_freq=sys_clk_freq,
|
SoCCore.__init__(self, platform, clk_freq=sys_clk_freq,
|
||||||
integrated_rom_size=0x8000,
|
integrated_rom_size=0x8000,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
# crg
|
# CRG --------------------------------------------------------------------------------------
|
||||||
crg = _CRG(platform, sys_clk_freq, x5_clk_freq)
|
crg = _CRG(platform, sys_clk_freq, x5_clk_freq)
|
||||||
self.submodules.crg = crg
|
self.submodules.crg = crg
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ class CRG(Module):
|
||||||
|
|
||||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_clk200)
|
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_clk200)
|
||||||
|
|
||||||
# AllerSoC ------------------------------------------------------------------------------------------
|
# AllerSoC -----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class AllerSoC(SoCSDRAM):
|
class AllerSoC(SoCSDRAM):
|
||||||
SoCSDRAM.mem_map["csr"] = 0x00000000
|
SoCSDRAM.mem_map["csr"] = 0x00000000
|
||||||
|
|
@ -55,6 +55,8 @@ class AllerSoC(SoCSDRAM):
|
||||||
|
|
||||||
def __init__(self, platform, with_pcie_uart=True):
|
def __init__(self, platform, with_pcie_uart=True):
|
||||||
sys_clk_freq = int(100e6)
|
sys_clk_freq = int(100e6)
|
||||||
|
|
||||||
|
# SoCSDRAM ---------------------------------------------------------------------------------
|
||||||
SoCSDRAM.__init__(self, platform, sys_clk_freq,
|
SoCSDRAM.__init__(self, platform, sys_clk_freq,
|
||||||
csr_data_width = 32,
|
csr_data_width = 32,
|
||||||
integrated_rom_size = 0x10000,
|
integrated_rom_size = 0x10000,
|
||||||
|
|
@ -75,26 +77,25 @@ class AllerSoC(SoCSDRAM):
|
||||||
self.submodules.xadc = xadc.XADC()
|
self.submodules.xadc = xadc.XADC()
|
||||||
self.add_csr("xadc")
|
self.add_csr("xadc")
|
||||||
|
|
||||||
# SDRAM ------------------------------------------------------------------------------------
|
# DDR3 SDRAM -------------------------------------------------------------------------------
|
||||||
if not self.integrated_main_ram_size:
|
if not self.integrated_main_ram_size:
|
||||||
self.submodules.ddrphy = s7ddrphy.A7DDRPHY(
|
self.submodules.ddrphy = s7ddrphy.A7DDRPHY(platform.request("ddram"),
|
||||||
platform.request("ddram"),
|
memtype = "DDR3",
|
||||||
|
nphases = 4,
|
||||||
sys_clk_freq = sys_clk_freq,
|
sys_clk_freq = sys_clk_freq,
|
||||||
iodelay_clk_freq = 200e6)
|
iodelay_clk_freq = 200e6)
|
||||||
|
self.add_csr("ddrphy")
|
||||||
sdram_module = MT41J128M16(sys_clk_freq, "1:4")
|
sdram_module = MT41J128M16(sys_clk_freq, "1:4")
|
||||||
self.register_sdram(self.ddrphy,
|
self.register_sdram(self.ddrphy,
|
||||||
sdram_module.geom_settings,
|
geom_settings = sdram_module.geom_settings,
|
||||||
sdram_module.timing_settings)
|
timing_settings = sdram_module.timing_settings)
|
||||||
self.add_csr("ddrphy")
|
|
||||||
|
|
||||||
# PCIe -------------------------------------------------------------------------------------
|
# PCIe -------------------------------------------------------------------------------------
|
||||||
# pcie phy
|
# pcie phy
|
||||||
self.submodules.pcie_phy = S7PCIEPHY(platform, platform.request("pcie_x1"), bar0_size=0x20000)
|
self.submodules.pcie_phy = S7PCIEPHY(platform, platform.request("pcie_x1"), bar0_size=0x20000)
|
||||||
self.pcie_phy.cd_pcie.clk.attr.add("keep")
|
self.pcie_phy.cd_pcie.clk.attr.add("keep")
|
||||||
platform.add_platform_command("create_clock -name pcie_clk -period 8 [get_nets pcie_clk]")
|
platform.add_platform_command("create_clock -name pcie_clk -period 8 [get_nets pcie_clk]")
|
||||||
platform.add_false_path_constraints(
|
platform.add_false_path_constraints(self.crg.cd_sys.clk, self.pcie_phy.cd_pcie.clk)
|
||||||
self.crg.cd_sys.clk,
|
|
||||||
self.pcie_phy.cd_pcie.clk)
|
|
||||||
self.add_csr("pcie_phy")
|
self.add_csr("pcie_phy")
|
||||||
|
|
||||||
# pcie endpoint
|
# pcie endpoint
|
||||||
|
|
|
||||||
|
|
@ -90,23 +90,29 @@ class BaseSoC(SoCSDRAM):
|
||||||
def __init__(self, sys_clk_freq=int(50e6), **kwargs):
|
def __init__(self, sys_clk_freq=int(50e6), **kwargs):
|
||||||
assert sys_clk_freq == int(50e6)
|
assert sys_clk_freq == int(50e6)
|
||||||
platform = c10lprefkit.Platform()
|
platform = c10lprefkit.Platform()
|
||||||
|
|
||||||
|
# SoCSDRAM ---------------------------------------------------------------------------------
|
||||||
SoCSDRAM.__init__(self, platform, clk_freq=sys_clk_freq,
|
SoCSDRAM.__init__(self, platform, clk_freq=sys_clk_freq,
|
||||||
integrated_rom_size=0x8000,
|
integrated_rom_size=0x8000,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
|
# CRG --------------------------------------------------------------------------------------
|
||||||
self.submodules.crg = _CRG(platform)
|
self.submodules.crg = _CRG(platform)
|
||||||
|
|
||||||
|
# HyperRam ---------------------------------------------------------------------------------
|
||||||
self.submodules.hyperram = HyperRAM(platform.request("hyperram"))
|
self.submodules.hyperram = HyperRAM(platform.request("hyperram"))
|
||||||
self.add_wb_slave(mem_decoder(self.mem_map["hyperram"]), self.hyperram.bus)
|
self.add_wb_slave(mem_decoder(self.mem_map["hyperram"]), self.hyperram.bus)
|
||||||
self.add_memory_region("hyperram", self.mem_map["hyperram"], 8*1024*1024)
|
self.add_memory_region("hyperram", self.mem_map["hyperram"], 8*1024*1024)
|
||||||
|
|
||||||
|
# SDR SDRAM --------------------------------------------------------------------------------
|
||||||
if not self.integrated_main_ram_size:
|
if not self.integrated_main_ram_size:
|
||||||
self.submodules.sdrphy = GENSDRPHY(platform.request("sdram"))
|
self.submodules.sdrphy = GENSDRPHY(platform.request("sdram"))
|
||||||
sdram_module = MT48LC16M16(self.clk_freq, "1:1")
|
sdram_module = MT48LC16M16(self.clk_freq, "1:1")
|
||||||
self.register_sdram(self.sdrphy,
|
self.register_sdram(self.sdrphy,
|
||||||
sdram_module.geom_settings,
|
geom_settings = sdram_module.geom_settings,
|
||||||
sdram_module.timing_settings)
|
timing_settings = sdram_module.timing_settings)
|
||||||
|
|
||||||
|
# EthernetSoC --------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class EthernetSoC(BaseSoC):
|
class EthernetSoC(BaseSoC):
|
||||||
mem_map = {
|
mem_map = {
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,8 @@ class NereidSoC(SoCSDRAM):
|
||||||
|
|
||||||
def __init__(self, platform, with_pcie_uart=True):
|
def __init__(self, platform, with_pcie_uart=True):
|
||||||
sys_clk_freq = int(100e6)
|
sys_clk_freq = int(100e6)
|
||||||
|
|
||||||
|
# SoCSDRAM ---------------------------------------------------------------------------------
|
||||||
SoCSDRAM.__init__(self, platform, sys_clk_freq,
|
SoCSDRAM.__init__(self, platform, sys_clk_freq,
|
||||||
csr_data_width = 32,
|
csr_data_width = 32,
|
||||||
integrated_rom_size = 0x10000,
|
integrated_rom_size = 0x10000,
|
||||||
|
|
@ -75,26 +77,25 @@ class NereidSoC(SoCSDRAM):
|
||||||
self.submodules.xadc = xadc.XADC()
|
self.submodules.xadc = xadc.XADC()
|
||||||
self.add_csr("xadc")
|
self.add_csr("xadc")
|
||||||
|
|
||||||
# SDRAM ------------------------------------------------------------------------------------
|
# DDR3 SDRAM -------------------------------------------------------------------------------
|
||||||
if not self.integrated_main_ram_size:
|
if not self.integrated_main_ram_size:
|
||||||
self.submodules.ddrphy = s7ddrphy.K7DDRPHY(
|
self.submodules.ddrphy = s7ddrphy.K7DDRPHY(platform.request("ddram"),
|
||||||
platform.request("ddram"),
|
memtype = "DDR3",
|
||||||
|
nphases = 4,
|
||||||
sys_clk_freq = sys_clk_freq,
|
sys_clk_freq = sys_clk_freq,
|
||||||
iodelay_clk_freq = 200e6)
|
iodelay_clk_freq = 200e6)
|
||||||
|
self.add_csr("ddrphy")
|
||||||
sdram_module = MT8KTF51264(sys_clk_freq, "1:4", speedgrade="800")
|
sdram_module = MT8KTF51264(sys_clk_freq, "1:4", speedgrade="800")
|
||||||
self.register_sdram(self.ddrphy,
|
self.register_sdram(self.ddrphy,
|
||||||
sdram_module.geom_settings,
|
geom_settings = sdram_module.geom_settings,
|
||||||
sdram_module.timing_settings)
|
timing_settings = sdram_module.timing_settings)
|
||||||
self.add_csr("ddrphy")
|
|
||||||
|
|
||||||
# PCIe -------------------------------------------------------------------------------------
|
# PCIe -------------------------------------------------------------------------------------
|
||||||
# pcie phy
|
# pcie phy
|
||||||
self.submodules.pcie_phy = S7PCIEPHY(platform, platform.request("pcie_x1"), bar0_size=0x20000)
|
self.submodules.pcie_phy = S7PCIEPHY(platform, platform.request("pcie_x1"), bar0_size=0x20000)
|
||||||
self.pcie_phy.cd_pcie.clk.attr.add("keep")
|
self.pcie_phy.cd_pcie.clk.attr.add("keep")
|
||||||
platform.add_platform_command("create_clock -name pcie_clk -period 8 [get_nets pcie_clk]")
|
platform.add_platform_command("create_clock -name pcie_clk -period 8 [get_nets pcie_clk]")
|
||||||
platform.add_false_path_constraints(
|
platform.add_false_path_constraints(self.crg.cd_sys.clk, self.pcie_phy.cd_pcie.clk)
|
||||||
self.crg.cd_sys.clk,
|
|
||||||
self.pcie_phy.cd_pcie.clk)
|
|
||||||
self.add_csr("pcie_phy")
|
self.add_csr("pcie_phy")
|
||||||
|
|
||||||
# pcie endpoint
|
# pcie endpoint
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ class CRG(Module):
|
||||||
|
|
||||||
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_clk200)
|
self.submodules.idelayctrl = S7IDELAYCTRL(self.cd_clk200)
|
||||||
|
|
||||||
# NereidSoC ------------------------------------------------------------------------------------------
|
# TagusSoC -----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class TagusSoC(SoCSDRAM):
|
class TagusSoC(SoCSDRAM):
|
||||||
SoCSDRAM.mem_map["csr"] = 0x00000000
|
SoCSDRAM.mem_map["csr"] = 0x00000000
|
||||||
|
|
@ -57,6 +57,8 @@ class TagusSoC(SoCSDRAM):
|
||||||
|
|
||||||
def __init__(self, platform, with_pcie_uart=True):
|
def __init__(self, platform, with_pcie_uart=True):
|
||||||
sys_clk_freq = int(100e6)
|
sys_clk_freq = int(100e6)
|
||||||
|
|
||||||
|
# SoCSDRAM ---------------------------------------------------------------------------------
|
||||||
SoCSDRAM.__init__(self, platform, sys_clk_freq,
|
SoCSDRAM.__init__(self, platform, sys_clk_freq,
|
||||||
csr_data_width = 32,
|
csr_data_width = 32,
|
||||||
integrated_rom_size = 0x10000,
|
integrated_rom_size = 0x10000,
|
||||||
|
|
@ -77,17 +79,18 @@ class TagusSoC(SoCSDRAM):
|
||||||
self.submodules.xadc = xadc.XADC()
|
self.submodules.xadc = xadc.XADC()
|
||||||
self.add_csr("xadc")
|
self.add_csr("xadc")
|
||||||
|
|
||||||
# SDRAM ------------------------------------------------------------------------------------
|
# DDR3 SDRAM -------------------------------------------------------------------------------
|
||||||
if not self.integrated_main_ram_size:
|
if not self.integrated_main_ram_size:
|
||||||
self.submodules.ddrphy = s7ddrphy.A7DDRPHY(
|
self.submodules.ddrphy = s7ddrphy.A7DDRPHY(platform.request("ddram"),
|
||||||
platform.request("ddram"),
|
memtype = "DDR3",
|
||||||
|
nphases = 4,
|
||||||
sys_clk_freq = sys_clk_freq,
|
sys_clk_freq = sys_clk_freq,
|
||||||
iodelay_clk_freq = 200e6)
|
iodelay_clk_freq = 200e6)
|
||||||
|
self.add_csr("ddrphy")
|
||||||
sdram_module = MT41J128M16(sys_clk_freq, "1:4")
|
sdram_module = MT41J128M16(sys_clk_freq, "1:4")
|
||||||
self.register_sdram(self.ddrphy,
|
self.register_sdram(self.ddrphy,
|
||||||
sdram_module.geom_settings,
|
sdram_module.geom_settings,
|
||||||
sdram_module.timing_settings)
|
sdram_module.timing_settings)
|
||||||
self.add_csr("ddrphy")
|
|
||||||
|
|
||||||
# PCIe -------------------------------------------------------------------------------------
|
# PCIe -------------------------------------------------------------------------------------
|
||||||
# pcie phy
|
# pcie phy
|
||||||
|
|
|
||||||
|
|
@ -88,25 +88,26 @@ class _CRG(Module):
|
||||||
class BaseSoC(SoCSDRAM):
|
class BaseSoC(SoCSDRAM):
|
||||||
def __init__(self, sys_clk_freq=int(75e6), toolchain="diamond", integrated_rom_size=0x8000, **kwargs):
|
def __init__(self, sys_clk_freq=int(75e6), toolchain="diamond", integrated_rom_size=0x8000, **kwargs):
|
||||||
platform = trellisboard.Platform(toolchain=toolchain)
|
platform = trellisboard.Platform(toolchain=toolchain)
|
||||||
|
|
||||||
|
# SoCSDRAM ---------------------------------------------------------------------------------
|
||||||
SoCSDRAM.__init__(self, platform, clk_freq=sys_clk_freq,
|
SoCSDRAM.__init__(self, platform, clk_freq=sys_clk_freq,
|
||||||
integrated_rom_size=integrated_rom_size,
|
integrated_rom_size=integrated_rom_size,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
# crg
|
# CRG --------------------------------------------------------------------------------------
|
||||||
crg = _CRG(platform, sys_clk_freq)
|
self.submodules.crg = _CRG(platform, sys_clk_freq)
|
||||||
self.submodules.crg = crg
|
|
||||||
|
|
||||||
# sdram
|
# DDR3 SDRAM -------------------------------------------------------------------------------
|
||||||
self.submodules.ddrphy = ECP5DDRPHY(
|
self.submodules.ddrphy = ECP5DDRPHY(
|
||||||
platform.request("ddram"),
|
platform.request("ddram"),
|
||||||
sys_clk_freq=sys_clk_freq)
|
sys_clk_freq=sys_clk_freq)
|
||||||
self.add_csr("ddrphy")
|
self.add_csr("ddrphy")
|
||||||
self.add_constant("ECP5DDRPHY", None)
|
self.add_constant("ECP5DDRPHY", None)
|
||||||
self.comb += crg.stop.eq(self.ddrphy.init.stop)
|
self.comb += self.crg.stop.eq(self.ddrphy.init.stop)
|
||||||
sdram_module = MT41J256M16(sys_clk_freq, "1:2")
|
sdram_module = MT41J256M16(sys_clk_freq, "1:2")
|
||||||
self.register_sdram(self.ddrphy,
|
self.register_sdram(self.ddrphy,
|
||||||
sdram_module.geom_settings,
|
geom_settings = sdram_module.geom_settings,
|
||||||
sdram_module.timing_settings)
|
timing_settings = sdram_module.timing_settings)
|
||||||
|
|
||||||
# EthernetSoC --------------------------------------------------------------------------------------
|
# EthernetSoC --------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue