Skip to content

Commit

Permalink
interconnect/csr_bus: Fix build with custom get_csrs/get_constants fr…
Browse files Browse the repository at this point in the history
…om cores.
  • Loading branch information
enjoy-digital committed Oct 21, 2022
1 parent d30f780 commit 76d3a77
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions litex/soc/interconnect/csr_bus.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ def scan(self, ifargs, ifkwargs):
# ---------------------
csrs = []
if hasattr(obj, "get_csrs"):
csrs = obj.get_csrs(sort=True)
if "sort" in obj.get_csrs.__code__.co_varnames:
csrs = obj.get_csrs(sort=True)

# Collect CSR Memories.
# ---------------------
Expand All @@ -252,8 +253,9 @@ def scan(self, ifargs, ifkwargs):
# Collect CSR Constants.
# ----------------------
if hasattr(obj, "get_constants"):
for constant in obj.get_constants(sort=True):
self.constants.append((name, constant))
if "sort" in obj.get_constants.__code__.co_varnames:
for constant in obj.get_constants(sort=True):
self.constants.append((name, constant))

# Create CSRBank with CSRs found.
# -------------------------------
Expand Down

0 comments on commit 76d3a77

Please sign in to comment.