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

Stream compatatibility checks #15

Merged
merged 31 commits into from
Sep 9, 2024
Merged

Conversation

ccromjongh
Copy link
Member

@ccromjongh ccromjongh commented Sep 3, 2024

This PR adds support for compatibility checking of streams.

There are three types of checks:

  1. Parameter checks (n, d, c)
  2. Basic data & user type checks (number of bits equal?)
  3. Advanced data & user type checks (do the classes match?)

One can select the strictness of the check through an implicit parameter of type CompatCheck. The strict check is default and checks if both streams use the same data-type. The weaker check (called Parameter) only checks the bit width of the used data-types.
One can select if errors should be thrown on incompatible streams or to print warnings (useful if checking all the issues in a design since execution stops at exceptions) by an implicit parameter of type CompatCheckResult.

The connection function := is now defined in the PhysicalStreamBase class and calls the correct data connection methods through matching and upcasting the arguments. This has the advantage that := can now use default arguments as there are no overloaded methods anymore.

:@= is the meta-connect function that only connects the meta signals of two streams and checks the parameter compatibility.
:~= is a shorthand for using := in an environment where implicit val errorReporting: CompatCheck.Value = CompatCheck.Params. I.e.: quick weak connect function.

Two examples/tests were updated because they had incompatible streams.

@ccromjongh ccromjongh added the enhancement New feature or request label Sep 3, 2024
@ccromjongh ccromjongh self-assigned this Sep 3, 2024
Multiple overloaded methods cannot define default arguments, however.
This has the issue that type parameters are not checked.
@ccromjongh ccromjongh marked this pull request as ready for review September 9, 2024 14:32
@ccromjongh ccromjongh merged commit 916efb8 into main Sep 9, 2024
1 check passed
@ccromjongh ccromjongh deleted the feature/stream-compat-check branch September 9, 2024 14:35
@ccromjongh ccromjongh mentioned this pull request Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant