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] Make input probes illegal #6921

Merged
merged 22 commits into from
May 9, 2024

Conversation

dtzSiFive
Copy link
Contributor

Disallow input probes.
cc chipsalliance/firrtl-spec#183 .

Adds verifier for this, and mostly updates tests.

Delete ProbeDCE.

Many passes can (and should) be simplified if they do not need to consider this.

Incomplete list:

  • Inliner
  • LowerXMR (!)
  • Dedup
  • HoistPassthrough

@dtzSiFive
Copy link
Contributor Author

Not sure about this direction (thoroughly ripping this out from all the things), but leaving here for now.

Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

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

I'm generally good with the approach.

test/Dialect/FIRRTL/infer-widths-errors.mlir Outdated Show resolved Hide resolved
@dtzSiFive dtzSiFive marked this pull request as ready for review May 8, 2024 22:43
@dtzSiFive dtzSiFive requested a review from darthscsi as a code owner May 8, 2024 22:43
Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

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

🎯

LGTM

test/Dialect/FIRRTL/errors.mlir Show resolved Hide resolved
// expected-note @below {{width is constrained to be at least 2 here:}}
firrtl.ref.define %inst2_ref, %w2_ref : !firrtl.rwprobe<uint>
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Can this test be rewritten to an output port to still cover the issue that this was added to fix. (Or is this covered by another test?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need multiple drivers for the same static (in the IR, like a specific wire or port). Since probe's must be driven exactly once this is a bit tricky to test.

An input probe driven in different instantiation contexts with different widths is clearest way I know to do this (this is test I had commented out earlier for same "seems like a good thing to have under test still" thinking).
( #6921 (comment) )

I had made a comment previously about instance-choice (if has an output probe of unknown width, in theory the two choices might try to infer to different widths based on their contents), but I'm not sure story there re:unknown widths and interaction with inferences.

So, not sure how to keep this as a test but that would be nice, agreed, thanks!

@dtzSiFive dtzSiFive merged commit d1b4259 into llvm:main May 9, 2024
4 checks passed
@dtzSiFive dtzSiFive deleted the feature/no-input-probes branch May 9, 2024 15:40
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.

2 participants