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

[FIRRTL][FIRParser] Add deprecation warning about printf/when-encoding. #6792

Merged
merged 2 commits into from
Apr 30, 2024

Conversation

dtzSiFive
Copy link
Contributor

Only warn once per module to keep it from being entirely overwhelming. (and report how many, in terms of printf's, to convey magnitude)

Split out when-encoding parser behavior to dedicated file, and look for the deprecation diagnostics in tests that use them.

@dtzSiFive
Copy link
Contributor Author

If we know what release we plan to remove it, clarifying that would be an improvement.
I believe Chisel versions themselves no longer using this will make use of firtool with this warning included, but this helps catch anything missed or warn before removing it entirely.

Copy link
Contributor

@fabianschuiki fabianschuiki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Love to see the deprecation warning and that you factored the corresponding tests into a separate file that will be easy to delete once we entirely nuke the printf-encoded verif statements.

Copy link
Member

@uenoku uenoku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dtzSiFive dtzSiFive marked this pull request as draft March 7, 2024 21:28
@dtzSiFive
Copy link
Contributor Author

Marking draft until move off printf-encoded verif is completed.

{
// Gather PrintFOps and then process to avoid walking while mutating.
SmallVector<PrintFOp> buffer;
deferredModule.moduleOp.walk(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This walk seems unnecessary. Should we be collecting printfs during parse in something in the statement parser? I realize this is a pre-existing condition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Inclined to leave as-is for now with plan to phase all of this out soon (and so would rather not thread that through just to remove it).

"module contains ")
<< numVerifPrintfs
<< " printf-encoded verification operation(s), which are deprecated "
"and will be removed in the future";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once per module might be annoying (but do we care since they are going away?) and could be once per circuit.

We might consider having a generic deprecated feature use collector.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea!

Are there other feature we want to deprecate and warn on? Intrinsic modules maybe?

Not sure it's too important to limit the warnings here -- looking forward to dropping all of this "soon", starting with a warning but will promote to an error next, and then we can drop it entirely.

However this is a good idea and I think such a warning infrastructure would be useful generally.

Only warn once per module to keep it from being entirely overwhelming.
(and report how many, in terms of printf's, to convey magnitude)

Split out when-encoding parser behavior to dedicated file,
and look for the deprecation diagnostics in tests that use them.
@dtzSiFive dtzSiFive force-pushed the feature/deprecation-warning-printf-verif-parsing branch from 4353ef7 to 0ffa2ca Compare April 30, 2024 14:34
@dtzSiFive dtzSiFive marked this pull request as ready for review April 30, 2024 15:15
@dtzSiFive dtzSiFive merged commit 38cd3ac into main Apr 30, 2024
4 checks passed
@dtzSiFive dtzSiFive deleted the feature/deprecation-warning-printf-verif-parsing branch April 30, 2024 16:06
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

Successfully merging this pull request may close these issues.

4 participants