From: Florent Kermarrec Date: Wed, 4 Mar 2020 15:27:11 +0000 (+0100) Subject: soc/doc: remove soc.get_csr_regions support. X-Git-Tag: 24jan2021_ls180~600 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4f935714de39d65d586b8b01efae322b04bd3db1;p=litex.git soc/doc: remove soc.get_csr_regions support. Now that SoC documentation is integrated in LiteX, this is no longer needed. --- diff --git a/litex/soc/doc/__init__.py b/litex/soc/doc/__init__.py index 2a1274bf..09949544 100644 --- a/litex/soc/doc/__init__.py +++ b/litex/soc/doc/__init__.py @@ -80,26 +80,18 @@ def generate_docs(soc, base_dir, project_name="LiteX SoC Project", # DocumentedCSRs. documented_regions = [] seen_modules = set() - regions = [] - - # Previously, litex contained a function to gather csr regions. - if hasattr(soc, "get_csr_regions"): - regions = soc.get_csr_regions() - else: - # Now we just access the regions directly. - for region_name, region in soc.csr_regions.items(): - regions.append((region_name, region.origin, - region.busword, region.obj)) - - for csr_region in regions: + for name, region in soc.csr.regions.items(): module = None - if hasattr(soc, csr_region[0]): - module = getattr(soc, csr_region[0]) + if hasattr(soc, name): + module = getattr(soc, name) seen_modules.add(module) submodules = gather_submodules(module) - documented_region = DocumentedCSRRegion( - csr_region, module, submodules, csr_data_width=soc.csr_data_width) + name = name, + region = region, + module = module, + submodules = submodules, + csr_data_width = soc.csr.data_width) if documented_region.name in interrupts: documented_region.document_interrupt( soc, submodules, interrupts[documented_region.name]) diff --git a/litex/soc/doc/csr.py b/litex/soc/doc/csr.py index 7ef61887..ffaecda5 100644 --- a/litex/soc/doc/csr.py +++ b/litex/soc/doc/csr.py @@ -51,8 +51,11 @@ class DocumentedCSR: f.description = self.trim(f.description) class DocumentedCSRRegion: - def __init__(self, csr_region, module=None, submodules=[], csr_data_width=8): - (self.name, self.origin, self.busword, self.raw_csrs) = csr_region + def __init__(self, name, region, module=None, submodules=[], csr_data_width=8): + self.name = name + self.origin = region.origin + self.busword = region.busword + self.raw_csrs = region.obj self.current_address = self.origin self.sections = [] self.csrs = []