soc_core/sdram: Don't blow up if _wb_sdram_ifs or _csr_masters are empty

For example a standalone controller with no exposed CSRs (probably not
a very useful configuration but I really don't like python backtraces)

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
Benjamin Herrenschmidt 2019-09-24 08:40:22 +02:00 committed by Florent Kermarrec
parent 742da31bc0
commit 0ea7a1fd05
2 changed files with 4 additions and 2 deletions

View File

@ -541,7 +541,8 @@ class SoCCore(Module):
alignment=self.csr_alignment)
# Add CSRs interconnect
self.submodules.csrcon = csr_bus.InterconnectShared(
if len(self._csr_masters) != 0:
self.submodules.csrcon = csr_bus.InterconnectShared(
self._csr_masters, self.csrbankarray.get_buses())
# Check and add CSRs regions

View File

@ -121,7 +121,8 @@ class SoCSDRAM(SoCCore):
raise FinalizeError("Need to call SoCSDRAM.register_sdram()")
# Arbitrate wishbone interfaces to the DRAM
self.submodules.wb_sdram_con = wishbone.Arbiter(self._wb_sdram_ifs, self._wb_sdram)
if len(self._wb_sdram_ifs) != 0:
self.submodules.wb_sdram_con = wishbone.Arbiter(self._wb_sdram_ifs, self._wb_sdram)
SoCCore.do_finalize(self)