From: Florent Kermarrec Date: Thu, 12 Dec 2019 10:27:56 +0000 (+0100) Subject: soc_core: add sort of CSR regions by origin (allow csr.h/csr.csv to be ordered by... X-Git-Tag: 24jan2021_ls180~812 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b1a1e5e227e6a05f4831e2eb76bebd15f835a955;p=litex.git soc_core: add sort of CSR regions by origin (allow csr.h/csr.csv to be ordered by origin) --- diff --git a/litex/soc/integration/soc_core.py b/litex/soc/integration/soc_core.py index 7f674b51..76da0e48 100644 --- a/litex/soc/integration/soc_core.py +++ b/litex/soc/integration/soc_core.py @@ -487,6 +487,9 @@ class SoCCore(Module): (self.soc_mem_map["csr"] + 0x800*mapaddr), self.csr_data_width, memory) + # Sort CSR regions by origin + self.csr_regions = {k: v for k, v in sorted(self.csr_regions.items(), key=lambda item: item[1].origin)} + # Add CSRs / Config items to constants for name, constant in self.csrbankarray.constants: self.add_constant(name.upper() + "_" + constant.name.upper(),