Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing in dma.py with "ValueError: CSRField "ev_source" name is already used in CSR register" when using multiple slots #41

Open
SOMO-Prevas opened this issue Oct 25, 2021 · 0 comments

Comments

@SOMO-Prevas
Copy link

This seems to be caused by SlotArray not assigning unique names to the slots.
Changing:

        slots = [_Slot(addr_bits, alignment_bits) for i in range(nslots)]
        for n, slot in enumerate(slots):
            setattr(self.submodules, "slot"+str(n), slot)
            setattr(self.ev, "slot"+str(n), slot.ev_source)
        self.ev.finalize()

to:

        slots = [_Slot(addr_bits, alignment_bits) for i in range(nslots)]
        for n, slot in enumerate(slots):
            setattr(slot.ev_source, "name", "slot"+str(n)) # To get unique name for each slot ev_source
            setattr(self.submodules, "slot"+str(n), slot)
            setattr(self.ev, "slot"+str(n), slot.ev_source)
        self.ev.finalize()

Seems to fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant