From b1a1e5e227e6a05f4831e2eb76bebd15f835a955 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 12 Dec 2019 11:27:56 +0100 Subject: [PATCH] soc_core: add sort of CSR regions by origin (allow csr.h/csr.csv to be ordered by origin) --- litex/soc/integration/soc_core.py | 3 +++ 1 file changed, 3 insertions(+) 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(), -- 2.30.2