Merge pull request #716 from gsomlo/gls-irq-misc

miscellaneous (mostly cosmetic) soc irq init fixes
This commit is contained in:
enjoy-digital 2020-12-01 08:29:05 +01:00 committed by GitHub
commit 2e7203d930
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 15 deletions

View File

@ -624,7 +624,7 @@ class SoCIRQHandler(SoCLocHandler):
# Check IRQ Number
if n_irqs > 32:
self.logger.error("Unsupported IRQs number: {} supporteds: {:s}".format(
colorer(n, color="red"), colorer("Up to 32", color="green")))
colorer(n_irqs, color="red"), colorer("Up to 32", color="green")))
raise
# Create IRQ Handler
@ -1047,20 +1047,19 @@ class SoC(Module):
raise
# SoC IRQ Interconnect ---------------------------------------------------------------------
if hasattr(self, "cpu"):
if hasattr(self.cpu, "interrupt"):
for name, loc in sorted(self.irq.locs.items()):
if name in self.cpu.interrupts.keys():
continue
if hasattr(self, name):
module = getattr(self, name)
if not hasattr(module, "ev"):
self.logger.error("EventManager {} in {} SubModule.".format(
colorer("not found", color="red"),
colorer(name)))
raise
self.comb += self.cpu.interrupt[loc].eq(module.ev.irq)
self.add_constant(name + "_INTERRUPT", loc)
if hasattr(self, "cpu") and hasattr(self.cpu, "interrupt"):
for name, loc in sorted(self.irq.locs.items()):
if name in self.cpu.interrupts.keys():
continue
if hasattr(self, name):
module = getattr(self, name)
if not hasattr(module, "ev"):
self.logger.error("EventManager {} in {} SubModule.".format(
colorer("not found", color="red"),
colorer(name)))
raise
self.comb += self.cpu.interrupt[loc].eq(module.ev.irq)
self.add_constant(name + "_INTERRUPT", loc)
# SoC build ------------------------------------------------------------------------------------
def build(self, *args, **kwargs):