cpuif: add memories to csr.h
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Mon, 11 Nov 2013 15:53:00 +0000 (16:53 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Mon, 11 Nov 2013 15:53:00 +0000 (16:53 +0100)
misoclib/cpuif.py

index 5c30289c1bd4e55377571ebb68c3c9673cf7c95c..0dcdfc16dd7e52b48d157ead842ae9ef653aedbf 100644 (file)
@@ -54,6 +54,10 @@ def get_csr_header(csr_base, bank_array, interrupt_map):
                        pass
                else:
                        r += "#define "+name.upper()+"_INTERRUPT "+str(interrupt_nr)+"\n"
+       for name, memory, mapaddr, mmap in bank_array.srams:
+               mem_base = csr_base + 0x800*mapaddr
+               fullname = name + "_" + memory.name_override
+               r += "#define "+fullname.upper()+"_BASE "+hex(mem_base)+"\n"
        r += "\n#endif\n"
        return r