diff --git a/litex/compat/__init__.py b/litex/compat/__init__.py index 72357f3eb..4b27b1506 100644 --- a/litex/compat/__init__.py +++ b/litex/compat/__init__.py @@ -43,8 +43,20 @@ def add_compat(location): from litex.compat import soc_sdram return getattr(soc_sdram, name) 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. - elif location == "litex.soc.cores": + if location == "litex.soc.cores": class compat_up5kspram: noticed = False def __getattr__(self, name): diff --git a/litex/soc/interconnect/stream_sim.py b/litex/compat/stream_sim.py similarity index 89% rename from litex/soc/interconnect/stream_sim.py rename to litex/compat/stream_sim.py index 76499708b..f3028efb3 100644 --- a/litex/soc/interconnect/stream_sim.py +++ b/litex/compat/stream_sim.py @@ -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. # @@ -15,6 +20,21 @@ from litex.soc.interconnect import stream # TODO: clean up code below # 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=""): if not isinstance(s, str): s = s.__repr__() diff --git a/litex/soc/interconnect/__init__.py b/litex/soc/interconnect/__init__.py index e69de29bb..1660b4cf5 100644 --- a/litex/soc/interconnect/__init__.py +++ b/litex/soc/interconnect/__init__.py @@ -0,0 +1,3 @@ +import sys +from litex.compat import add_compat +add_compat(__name__)