soc/cpuif: fix get_csr_header when obj is Memory (thanks ccube)
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Fri, 3 Apr 2015 09:14:28 +0000 (11:14 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Fri, 3 Apr 2015 09:14:28 +0000 (11:14 +0200)
misoclib/soc/cpuif.py

index 7bbe5ad1a7e89a355bb6c1d9f57eb57d382a9e39..be58bd8de1d798c00f422f1e775fc436f6d91b9a 100644 (file)
@@ -72,7 +72,7 @@ def get_csr_header(regions, interrupt_map):
        r = "#ifndef __GENERATED_CSR_H\n#define __GENERATED_CSR_H\n#include <hw/common.h>\n"
        for name, origin, busword, obj in regions:
                if isinstance(obj, Memory):
-                       fullname = name + "_" + memory.name_override
+                       fullname = name + "_" + obj.name_override
                        r += "#define CSR_"+fullname.upper()+"_BASE "+hex(origin)+"\n"
                else:
                        r += "\n/* "+name+" */\n"