from nmigen import (Module, Elaboratable, DomainRenamer, Record,
Signal, Cat, Const, ClockSignal, ResetSignal)
+from nmigen.build.dsl import Attrs
from nmigen.cli import verilog
from nmigen.lib.cdc import ResetSynchronizer
from nmigen_soc import wishbone, memory
print (fname)
self.uart.add_verilog_source(fname, platform)
- # add Tercel verilog source. assumes a directory
- # structure where ls2 has been checked out in a common
- # subdirectory as https://git.libre-soc.org/git/microwatt.git
- raptor_tercel = "../../microwatt/tercel"
- pth = os.path.split(__file__)[0]
- pth = os.path.join(pth, raptor_tercel)
- fname = os.path.abspath(pth)
- print (fname)
- self.spi0.add_verilog_source(fname, platform)
+ if hasattr(self, "spi0"):
+ # add Tercel verilog source. assumes a directory
+ # structure where ls2 has been checked out in a common
+ # subdirectory as https://git.libre-soc.org/git/microwatt.git
+ raptor_tercel = "../../microwatt/tercel"
+ pth = os.path.split(__file__)[0]
+ pth = os.path.join(pth, raptor_tercel)
+ fname = os.path.abspath(pth)
+ print (fname)
+ self.spi0.add_verilog_source(fname, platform)
# add the main core
pth = os.path.split(__file__)[0]
# 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", ck_p="B4",
- attrs=IOStandard("LVCMOS33"))
- self.platform.add_extension(hyperram_ios)
- hyperram_pins = self.platform.request("hyperram")
+ hyperram_ios = HyperRAMResource(0, cs_n="B13",
+ dq="E14 C10 B10 E12 D12 A9 D11 D14",
+ rwds="C14", rst_n="E13", ck_p="D13",
+ attrs=Attrs(IOSTANDARD="LVCMOS33"))
+ platform.add_resources(hyperram_ios)
+ hyperram_pins = platform.request("hyperram")
else:
hyperram_pins = HyperRAMPads()