soc: cosmetic: reduce horizontal indentation in IRQ init.

This commit is contained in:
Gabriel Somlo 2020-11-30 16:28:40 -05:00
parent 9af56cf247
commit 5cc3db0176
1 changed files with 13 additions and 14 deletions

View File

@ -1047,20 +1047,19 @@ class SoC(Module):
raise raise
# SoC IRQ Interconnect --------------------------------------------------------------------- # SoC IRQ Interconnect ---------------------------------------------------------------------
if hasattr(self, "cpu"): if hasattr(self, "cpu") and hasattr(self.cpu, "interrupt"):
if hasattr(self.cpu, "interrupt"): for name, loc in sorted(self.irq.locs.items()):
for name, loc in sorted(self.irq.locs.items()): if name in self.cpu.interrupts.keys():
if name in self.cpu.interrupts.keys(): continue
continue if hasattr(self, name):
if hasattr(self, name): module = getattr(self, name)
module = getattr(self, name) if not hasattr(module, "ev"):
if not hasattr(module, "ev"): self.logger.error("EventManager {} in {} SubModule.".format(
self.logger.error("EventManager {} in {} SubModule.".format( colorer("not found", color="red"),
colorer("not found", color="red"), colorer(name)))
colorer(name))) raise
raise self.comb += self.cpu.interrupt[loc].eq(module.ev.irq)
self.comb += self.cpu.interrupt[loc].eq(module.ev.irq) self.add_constant(name + "_INTERRUPT", loc)
self.add_constant(name + "_INTERRUPT", loc)
# SoC build ------------------------------------------------------------------------------------ # SoC build ------------------------------------------------------------------------------------
def build(self, *args, **kwargs): def build(self, *args, **kwargs):