soc/doc: remove soc.get_csr_regions support.

Now that SoC documentation is integrated in LiteX, this is no longer needed.
This commit is contained in:
Florent Kermarrec 2020-03-04 16:27:11 +01:00
parent 6893222cf1
commit 4f935714de
2 changed files with 13 additions and 18 deletions

View File

@ -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])

View File

@ -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 = []