From 2c13b701f56298db9ce4c8d41316e03b4567e12b Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 18 Jun 2018 18:01:47 +0200 Subject: [PATCH] soc/integration/cpu_interface: add shadow_base parameter --- litex/soc/integration/cpu_interface.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/litex/soc/integration/cpu_interface.py b/litex/soc/integration/cpu_interface.py index aac73f661..691832663 100644 --- a/litex/soc/integration/cpu_interface.py +++ b/litex/soc/integration/cpu_interface.py @@ -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 \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: