soc/integration: move mem_decoder to soc_core
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 11 Feb 2020 16:19:22 +0000 (17:19 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 11 Feb 2020 16:19:22 +0000 (17:19 +0100)
litex/soc/integration/common.py
litex/soc/integration/soc_core.py

index b43e8dfe3a8228e7f624b4d10240d51609787118..6d6699d3eb71fb0cf5dda1d8488731a037f8eb88 100644 (file)
@@ -12,13 +12,6 @@ from migen import *
 
 # Helpers ----------------------------------------------------------------------------------------
 
-def mem_decoder(address, size=0x10000000):
-    size = 2**log2_int(size, False)
-    assert (address & (size - 1)) == 0
-    address >>= 2 # bytes to words aligned
-    size    >>= 2 # bytes to words aligned
-    return lambda a: (a[log2_int(size):] == (address >> log2_int(size)))
-
 def get_version(with_time=True):
     fmt = "%Y-%m-%d %H:%M:%S" if with_time else "%Y-%m-%d"
     return datetime.datetime.fromtimestamp(time.time()).strftime(fmt)
index 496435c9ec94803e4934ac88966ccbae2735ca3f..b3a103565c7d6f4f17ab184d0da88c16d5d2cebe 100644 (file)
@@ -37,6 +37,15 @@ __all__ = [
     "soc_mini_argdict",
 ]
 
+# Helpers ------------------------------------------------------------------------------------------
+
+def mem_decoder(address, size=0x10000000):
+    size = 2**log2_int(size, False)
+    assert (address & (size - 1)) == 0
+    address >>= 2 # bytes to words aligned
+    size    >>= 2 # bytes to words aligned
+    return lambda a: (a[log2_int(size):] == (address >> log2_int(size)))
+
 # SoCController ------------------------------------------------------------------------------------
 
 class SoCController(Module, AutoCSR):