soc/interconnect/stream_sim: Move to compat to prevent since no longer really used or recommended on new designs.

This commit is contained in:
Florent Kermarrec 2021-03-24 17:56:21 +01:00
parent bc8974dad1
commit 9eb318e86a
3 changed files with 36 additions and 1 deletions

View File

@ -43,8 +43,20 @@ def add_compat(location):
from litex.compat import soc_sdram from litex.compat import soc_sdram
return getattr(soc_sdram, name) return getattr(soc_sdram, name)
sys.modules["litex.soc.integration.soc_sdram"] = compat_soc_sdram() sys.modules["litex.soc.integration.soc_sdram"] = compat_soc_sdram()
# Interconnect.
if location == "litex.soc.interconnect":
class compat_stream_sim:
noticed = False
def __getattr__(self, name):
if not self.noticed:
compat_notice("stream_sim", date="2020-03-24", info="Code will not be replaced, copy it in your project to continue using it.")
self.noticed = True
from litex.compat import stream_sim
return getattr(stream_sim, name)
sys.modules["litex.soc.interconnect.stream_sim"] = compat_stream_sim()
# Cores. # Cores.
elif location == "litex.soc.cores": if location == "litex.soc.cores":
class compat_up5kspram: class compat_up5kspram:
noticed = False noticed = False
def __getattr__(self, name): def __getattr__(self, name):

View File

@ -1,3 +1,8 @@
####################################################################################################
# DISCLAIMER: Provides retro-compatibility layer for stream_sim based designs.
# Will soon no longer work, please don't use in new designs.
####################################################################################################
# #
# This file is part of LiteX. # This file is part of LiteX.
# #
@ -15,6 +20,21 @@ from litex.soc.interconnect import stream
# TODO: clean up code below # TODO: clean up code below
# XXX # XXX
__all__ = [
"print_with_prefix",
"seed_to_data",
"split_bytes",
"merge_bytes",
"get_field_data",
"comp",
"check",
"randn",
"Packet",
"PacketStreamer",
"PacketLogger",
"Randomizer"
]
def print_with_prefix(s, prefix=""): def print_with_prefix(s, prefix=""):
if not isinstance(s, str): if not isinstance(s, str):
s = s.__repr__() s = s.__repr__()

View File

@ -0,0 +1,3 @@
import sys
from litex.compat import add_compat
add_compat(__name__)