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

Driving different bits of multibit signal from different clock domains results in driver-driver conflict #648

Closed
bl0x opened this issue Dec 9, 2021 · 3 comments
Labels

Comments

@bl0x
Copy link
Contributor

bl0x commented Dec 9, 2021

Minimal code:

from nmigen import *
from nmigen.cli import main

class MultibitDriverConflict(Elaboratable):
    def elaborate(self, platform):
        a = Signal(2)
        m = Module()
        m.domains += [ ClockDomain("c1"), ClockDomain("c2") ]
        m.d.c1 += a[0].eq(1)
        m.d.c2 += a[1].eq(1)
        return m

if __name__ == "__main__":
    test = MultibitDriverConflict()
    main(test)

Output:

$ python driver-driver-multibit-signal.py generate -t v
nmigen.hdl.dsl.SyntaxError: Driver-driver conflict: trying to drive (sig a) from d.c2, but it is already driven from d.c1

One would expect that the bits of Signal a can be driven independently.

@bl0x
Copy link
Contributor Author

bl0x commented Dec 9, 2021

It is fine, if I declare a like so:

a = [Signal() for _ in range(2)]

@whitequark
Copy link
Member

Yes, this is expected; see this section of the manual.

@bl0x
Copy link
Contributor Author

bl0x commented Dec 10, 2021

Ah, yes. I get it: one signal, one domain. I still tend to think about single bits as independent individuals.

Thanks for pointing to the manual. This can be closed.

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

No branches or pull requests

2 participants