From 5d6c851f3267d38eee7f71a2f79f67908772a2dc Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 15 Nov 2020 22:03:23 +0800 Subject: [PATCH] try to fix issue with unnamed sources --- litex/soc/interconnect/csr_eventmanager.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/litex/soc/interconnect/csr_eventmanager.py b/litex/soc/interconnect/csr_eventmanager.py index cd6e39df6..43c57c2f5 100644 --- a/litex/soc/interconnect/csr_eventmanager.py +++ b/litex/soc/interconnect/csr_eventmanager.py @@ -219,10 +219,14 @@ class EventManager(Module, AutoCSR): self.enable = CSRStorage(n, description=desc, fields=fields) for i, source in enumerate(sources): + if source.name == None: + src_name = "event{}".format(i) + else: + src_name = source.name self.comb += [ - getattr(self.status.fields, source.name).eq(source.status), - getattr(self.pending.fields, source.name).eq(source.pending), - If(self.pending.re & getattr(self.pending.fields, source.name), source.clear.eq(1)), + getattr(self.status.fields, src_name).eq(source.status), + getattr(self.pending.fields, src_name).eq(source.pending), + If(self.pending.re & getattr(self.pending.fields, src_name), source.clear.eq(1)), ] irqs = [self.pending.status[i] & self.enable.storage[i] for i in range(n)]