Skip to content

[core] Use DataProduct for FixedIO*Module#5354

Draft
seldridge wants to merge 2 commits into
mainfrom
dev/seldridge/FixedIO-domain-ready
Draft

[core] Use DataProduct for FixedIO*Module#5354
seldridge wants to merge 2 commits into
mainfrom
dev/seldridge/FixedIO-domain-ready

Conversation

@seldridge
Copy link
Copy Markdown
Member

Relax the types that are supported by the FixedIO* family of modules.
Previously, these routed all IO through a single A <: Data. Change this
so that this is now any A with a type class implementation of
DataProduct.

This is primarily motivated by the desire to add domain information to the
FixedIO* family of modules. Whole types must be single-domain and
domain types must be separate ports. This, together, means that it was
previously impossible to add any domain information to any FixedIO*
module except through domain inference in a FIRRTL compiler.

This requires special handling in both Scala 2 and Scala 3 for D/I
support. In order to test this, extend the existing Scala 2-only test to
stress tuples and sequences of Data and move it into the common testing
area so that it is run by both Scala versions.

Note: this currently produces default, sub-optimal names for things that
are tuples. This can be fixed in the future by allowing suggestName to
work on the tuples. However, this requires deeper changes and this is
better factored into a later commit.

Assisted-by: pi.dev:claude-opus-4-7

Release Notes

Support any type that has a DataProduct implementation in the FixedIO*
family of modules. This is both more flexible and will enable domain
information to be added to this module family.

Relax the types that are supported by the `FixedIO*` family of modules.
Previously, these routed all IO through a single `A <: Data`.  Change this
so that this is now any `A` with a type class implementation of
`DataProduct`.

This is primarily motivated by the desire to add domain information to the
`FixedIO*` family of modules.  Whole types must be single-domain and
domain types must be separate ports.  This, together, means that it was
previously impossible to add any domain information to any `FixedIO*`
module except through domain inference in a FIRRTL compiler.

This requires special handling in both Scala 2 and Scala 3 for D/I
support.  In order to test this, extend the existing Scala 2-only test to
stress tuples and sequences of Data and move it into the common testing
area so that it is run by both Scala versions.

Note: this currently produces default, sub-optimal names for things that
are tuples.  This can be fixed in the future by allowing `suggestName` to
work on the tuples.  However, this requires deeper changes and this is
better factored into a later commit.

Assisted-by: pi.dev:claude-opus-4-7
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
@seldridge seldridge added the Feature New feature, will be included in release notes label May 15, 2026
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
@seldridge
Copy link
Copy Markdown
Member Author

This is still not exactly the right shape. It's not really using DataProduct here for reasons that data product provides a recursive walk of the elements and this really doesn't want that. It wants to just walk up until it finds a Data and then creates that as a port.

This is somewhat hard to untangle and I'd like to get some input from @jackkoenig once he has a chance to look at / think about this. I wouldn't look too deeply at the code just now other than at the tests (as this is very much LLM-generated at this point with very minimal review 😬).

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

Labels

Feature New feature, will be included in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant