cores/ram: Switch to LiteXModule.

This commit is contained in:
Florent Kermarrec 2023-07-17 09:12:25 +02:00
parent b35c6580e8
commit 028f7eb72f
4 changed files with 19 additions and 5 deletions

View file

@ -7,6 +7,9 @@
# SPDX-License-Identifier: BSD-2-Clause
from migen import *
from litex.gen import *
from litex.soc.interconnect import wishbone
kB = 1024
@ -22,7 +25,7 @@ of 4 SPRAMs for this, so the only other valid config is using all 4 SPRAMs by de
"""
class Up5kSPRAM(Module):
class Up5kSPRAM(LiteXModule):
def __init__(self, width=32, size=64*kB):
self.bus = wishbone.Interface(width)

View file

@ -8,6 +8,9 @@
# SPDX-License-Identifier: BSD-2-Clause
from migen import *
from litex.gen import *
from litex.soc.interconnect import wishbone
kB = 1024
@ -48,7 +51,7 @@ def initval_parameters(contents, width):
return parameters
class NXLRAM(Module):
class NXLRAM(LiteXModule):
def __init__(self, width=32, size=128*kB, init=[]):
self.bus = wishbone.Interface(width)
assert width in [32, 64]

View file

@ -1,8 +1,16 @@
#
# This file is part of LiteX.
#
# Copyright (c) 2022 Antmicro <www.antmicro.com>
# SPDX-License-Identifier: BSD-2-Clause
from migen import *
from litex.gen import *
from litex.soc.interconnect.stream import SyncFIFO
class FIFOSyncMacro(Module, Record):
class FIFOSyncMacro(LiteXModule, Record):
"""FIFOSyncMacro
Provides an equivalent of Xilinx' FIFO_SYNC_MACRO which is a unimacro dedicated for 7 series
@ -86,7 +94,7 @@ class FIFOSyncMacro(Module, Record):
self.fifo_depth = fifo_depth = (int)(fifo_size * 1024 / macro_data_width)
self.submodules.fifo = fifo = ResetInserter()(SyncFIFO([("data", data_width)], fifo_depth))
self.fifo = fifo = ResetInserter()(SyncFIFO([("data", data_width)], fifo_depth))
self.comb += [
fifo.reset.eq(self.reset),

View file

@ -19,7 +19,7 @@ from litex.soc.interconnect.csr import *
# Ultrascale + HBM2 IP Wrapper ---------------------------------------------------------------------
class USPHBM2(Module, AutoCSR):
class USPHBM2(LiteXModule):
"""Xilinx Virtex US+ High Bandwidth Memory 2 IP wrapper"""
def __init__(self, platform, hbm_ip_name="hbm_0"):
self.platform = platform