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] Input probe support. #6121

Merged
merged 15 commits into from
Oct 2, 2023
Merged

Conversation

dtzSiFive
Copy link
Contributor

@dtzSiFive dtzSiFive commented Sep 13, 2023

Add and enable support for input probes.

Per spec, all uses (XMR read/force/release) of a probe must resolve to below the point of use in the hierarchy.
With this PR this is now supported in majority of cases.

The main exception to full support, with test demonstrating, is "n-turns" where a module uses an input probe (that resolves below that point) by sending it out and it comes back in equivalently driven in all instantiation contexts.

In this PR:

  • Input probes enabled in parser
  • Pass added to run after "de-squiggling" to drop all input probes, diagnosing when this is not possible (illegal input).
  • Test cases involving input probes from spec now work.

@dtzSiFive dtzSiFive added the FIRRTL Involving the `firrtl` dialect label Sep 13, 2023
@dtzSiFive dtzSiFive force-pushed the feature/input-probes branch 2 times, most recently from 5c603e2 to 9d1a22d Compare September 22, 2023 15:20
@dtzSiFive dtzSiFive marked this pull request as ready for review September 22, 2023 15:20
// and ensure they work before allowing them from user input.
if (hasInputRef(port.type, port.isOutput()))
return emitError(std::get<1>(portAndLoc),
"input probes not yet supported");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Locally, some time ago, added verifier that rejected input probes on public modules. Other than test churn, I'm not sure why that wasn't landed. Should go revive, suspect it was just unreachable and so not worth the change.

@dtzSiFive dtzSiFive force-pushed the feature/input-probes branch 4 times, most recently from 3b4a6a6 to 5c9329f Compare September 28, 2023 16:08
Copy link
Contributor

@prithayan prithayan left a comment

Choose a reason for hiding this comment

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

Overall looks good. The program slicing framework is very nice, seems like it can be useful for other cases too.

lib/Dialect/FIRRTL/Transforms/ProbeDCE.cpp Show resolved Hide resolved
lib/Dialect/FIRRTL/Transforms/ProbeDCE.cpp Outdated Show resolved Hide resolved
@dtzSiFive
Copy link
Contributor Author

Thanks!!

@dtzSiFive dtzSiFive merged commit 391db0c into llvm:main Oct 2, 2023
5 checks passed
@dtzSiFive dtzSiFive deleted the feature/input-probes branch October 2, 2023 15:58
mikeurbach pushed a commit that referenced this pull request Oct 2, 2023
Add and enable support for input probes.

Per spec, all uses (XMR read/force/release) of a probe must resolve to below the point of use in the hierarchy.
With this PR this is now supported in majority of cases.

The main exception to full support, with test demonstrating, is "n-turns" where a module uses an input probe (that resolves below that point) by sending it out and it comes back in equivalently driven in all instantiation contexts.

In this PR:

* Input probes enabled in parser
* Pass added to run after "de-squiggling" to drop all input probes, diagnosing when this is not possible (illegal input).
* Test cases involving input probes from spec now work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FIRRTL Involving the `firrtl` dialect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants