Allow LiteX builder to be used without LiteDRAM.
authorTim 'mithro' Ansell <me@mith.ro>
Mon, 30 Dec 2019 18:24:26 +0000 (19:24 +0100)
committerTim 'mithro' Ansell <me@mith.ro>
Mon, 30 Dec 2019 18:24:26 +0000 (19:24 +0100)
litex/soc/integration/builder.py

index 4b4eca60423c34afaaf3be6e43e00b7b2c5e6ace..665528a80ecd4d6db33b46bb7219e463819bad65 100644 (file)
@@ -14,9 +14,16 @@ import struct
 import shutil
 
 from litex.build.tools import write_to_file
-from litex.soc.integration import cpu_interface, soc_core, soc_sdram
+from litex.soc.integration import cpu_interface, soc_core
+
+try:
+    from litex.soc.integration import soc_sdram
+    from litedram.init import get_sdram_phy_c_header
+except ImportError:
+    class soc_sdram:
+        class SoCSDRAM:
+            pass
 
-from litedram.init import get_sdram_phy_c_header
 
 __all__ = ["soc_software_packages", "soc_directory",
            "Builder", "builder_args", "builder_argdict"]