soc/integration/cpu_interface: add shadow_base parameter
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 18 Jun 2018 16:01:47 +0000 (18:01 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 18 Jun 2018 16:01:47 +0000 (18:01 +0200)
litex/soc/integration/cpu_interface.py

index aac73f6612f148acf6fd478bc60cf7313e8c64ab..691832663700573d4c6cb677c3b38df52bda2d71 100644 (file)
@@ -125,11 +125,13 @@ def _get_rw_functions_c(reg_name, reg_base, nwords, busword, read_only, with_acc
     return r
 
 
-def get_csr_header(regions, constants, with_access_functions=True):
+def get_csr_header(regions, constants, with_access_functions=True, with_shadow_base=True, shadow_base=0x80000000):
     r = "#ifndef __GENERATED_CSR_H\n#define __GENERATED_CSR_H\n"
     if with_access_functions:
         r += "#include <hw/common.h>\n"
     for name, origin, busword, obj in regions:
+        if not with_shadow_base:
+            origin &= (~shadow_base)
         if isinstance(obj, Memory):
             r += "#define CSR_"+name.upper()+"_BASE "+hex(origin)+"\n"
         else: