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

Infrastructural support for disconnected intermediate ports #279

Open
ducky64 opened this issue Aug 9, 2023 · 0 comments
Open

Infrastructural support for disconnected intermediate ports #279

ducky64 opened this issue Aug 9, 2023 · 0 comments

Comments

@ducky64
Copy link
Collaborator

ducky64 commented Aug 9, 2023

Currently, non-connected intermediate ports (ports which are part of inner connections, as opposed to leaf ports which have no inner connections e.g. a pin on a footprint) require generators to handle the not-connected case. This results in a lot of boilerplate.

The generators are necessary since:

  • A disconnected port has no parameters and no upstream link
  • If a bridge and link is generated, it requires parameters from the disconnected port - this causes a bunch of assertions to fail with missing parameters
    • So to avoid creating these in the first place, a generator gates the connection based on whether the external port is connected
  • This is (probably?) less of an issue in the direct-export case (in the IR, distinct from the export construct in the frontend)

Potential solutions:

  • Some idea of dummy / nop port.
    • A variation of this exists for inside-facing-out not-connected (e.g. unused SDO port on a SPI peripheral like OLEDs, even though the port is structurally required as part of the SPI bundle).
    • A dummy link (or rather, its parameters) would be defined and made available to the compiler.
      • Specifics (mechanism, IR structure, syntax) TBD
    • When the compiler detects a disconnected port, it fills out the CONNECTED_LINK parameters with the dummy link parameters above.
    • Upside: ensures everything has valid CONNECTED_LINK parameters
    • Downside: the idea of a dummy link as a stand-in for a disconnected port may be odd if people inspect the IR
    • Downside: this requires all link parameters to have a valid nop value
    • This behavior may be non-intuitive for library writers, though it shouldn't affect system designers much
  • Some kind of syntactic sugar for propagating non-connected ports
    • Ideally it would avoid the generator infrastructure altogether to reduce complexity
  • Something else?

These are some (probably) bad solutions:

  • Status quo: live with the boilerplate =(
  • Move link and bridge inference to the backend
    • Major downside is that connect bugs get even harder to trace. Now (with incremental connect building), the connect statement that connects incompatible ports will stack trace out. This would delay it until compilation, and would not be able to provide a statement-level stack trace.
  • Some kind of link / bridge pruning in the backend. This is just going to be a mess.
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