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

AsyncSerial.Signature is problematic #11

Open
zyp opened this issue Dec 13, 2023 · 1 comment
Open

AsyncSerial.Signature is problematic #11

zyp opened this issue Dec 13, 2023 · 1 comment
Labels

Comments

@zyp
Copy link
Contributor

zyp commented Dec 13, 2023

I was reading through the code and noticed that AsyncSerial.Signature contains AsyncSerialRX.Signature and AsyncSerialTX.Signature, and all three of them contains a member named divisor.

Furthermore, AsyncSerial assigns to the inner two:

        m.d.comb += [
            self.rx.divisor.eq(self.divisor),
            self.tx.divisor.eq(self.divisor),
        ]

This implies that they are effectively outputs, despite having a signature denoting them as inputs. I believe this will cause a driver conflict error if you attempt using wiring.connect() on either of the three interfaces.

This is not an immediate problem to me, as I only caught this on a read-through, but it seems like an anti-pattern that deserves some attention.

@whitequark whitequark added the bug label Dec 14, 2023
@whitequark
Copy link
Member

I agree.

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