soc/integration/soc_core: add csr_map_update function

This commit is contained in:
Florent Kermarrec 2018-11-21 08:39:52 +01:00
parent ab799f7bd7
commit 1fe7d09fb5
1 changed files with 13 additions and 1 deletions

View File

@ -10,7 +10,14 @@ from litex.soc.interconnect.csr import *
from litex.soc.interconnect import wishbone, csr_bus, wishbone2csr
__all__ = ["mem_decoder", "get_mem_data", "SoCCore", "soc_core_args", "soc_core_argdict"]
__all__ = [
"mem_decoder",
"get_mem_data",
"csr_map_update",
"SoCCore",
"soc_core_args",
"soc_core_argdict"
]
def version(with_time=True):
@ -61,6 +68,11 @@ class ReadOnlyDict(dict):
del __readonly__
def csr_map_update(csr_map, csr_peripherals):
csr_map.update(dict((n, v)
for v, n in enumerate(csr_peripherals, start=max(csr_map.values()) + 1)))
class SoCController(Module, AutoCSR):
def __init__(self):
self._reset = CSR()