from nmigen.lib.cdc import ResetSynchronizer
from nmigen_soc import wishbone, memory
from nmigen_soc.memory import MemoryMap
+from nmigen.utils import log2_int
from nmigen_stdio.serial import AsyncSerial
+
+# HyperRAM
from nmigen_boards.resources.memory import HyperRAMResource
+from lambdasoc.periph.hyperram import HyperRAM
from lambdasoc.periph.intc import GenericInterruptController
from lambdasoc.periph.sram import SRAMPeripheral
from soc.bus.wb_downconvert import WishboneDownConvert
from soc.bus.syscon import MicrowattSYSCON
+# DDR3
from gram.common import (PhySettings, get_cl_cw, get_sys_latency,
get_sys_phases,)
-from nmigen.utils import log2_int
from gram.core import gramCore
from gram.phy.ecp5ddrphy import ECP5DDRPHY
from gram.phy.fakephy import FakePHY, SDRAM_VERBOSE_STD, SDRAM_VERBOSE_DBG
from gram.modules import MT41K256M16, MT41K64M16
from gram.frontend.wishbone import gramWishbone
+# Board (and simulation) platforms
from nmigen_boards.versa_ecp5 import VersaECP5Platform
from nmigen_boards.ulx3s import ULX3S_85F_Platform
from nmigen_boards.arty_a7 import ArtyA7_100Platform
from nmigen_boards.test.blinky import Blinky
-
-from crg import ECPIX5CRG
from icarusversa import IcarusVersaPlatform
+# Clock-Reset Generator (works for all ECP5 platforms)
+from crg import ECPIX5CRG
import sys
import os
firmware=None,
spi0_addr, spi0_cfg_addr,
hyperram_addr=None,
- hyperram_pinset=None,
+ hyperram_pins=None,
clk_freq=50e6,
add_cpu=True):
self._decoder.add(self.spi0.cfg_bus, addr=spi0_cfg_addr)
# HyperRAM modules *plural*. Assumes using a Quad PMOD by Piotr
- # Esden, sold by 1bitsquared
+ # Esden, sold by 1bitsquared, only doing one CS_N enable at the
+ # moment
self.memory_map = self._decoder.bus.memory_map
dir={"dq":"io", "cs_n":"o", "clk":"o"},
xdr={"dq": 1, "cs_n": 1, "clk": 0})
- # Get HyperRAM pinsets, there are multiple of these!
- hyperram_pinset = None
+ # Get HyperRAM pins
+ hyperram_pins = None
if platform is not None and fpga in ['versa_ecp5']:
hyperram_ios = HyperRAMResources(cs_n="B1",
dq="D0 D1 D2 D3 D4 D7 D6 D7",
rwds="B2", rst_n="B3", clk_p="B4",
attrs=IOStandard("LVCMOS33"))
self.platform.add_extension(hyperram_ios)
- hyperram_pinset = self.platform.request("hyperram")
+ hyperram_pins = self.platform.request("hyperram")
# set up the SOC
soc = DDR3SoC(fpga=fpga, dram_cls=dram_cls,
ddr_pins=ddr_pins,
uart_pins=uart_pins,
spi_0_pins=spi_0_pins,
- hyperram_pinset=hyperram_pinset,
+ hyperram_pins=hyperram_pins,
firmware=firmware,
clk_freq=clk_freq,
add_cpu=True)