Skip to content

AsyncSerial.Signature is problematic #11

Open
@zyp

Description

@zyp

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions