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

Fix naming for RHS of named unapply expressions #3163

Merged
merged 1 commit into from
Apr 6, 2023

Conversation

jackkoenig
Copy link
Contributor

@jackkoenig jackkoenig commented Apr 6, 2023

Previously, the naming plugin would not recurse for the RHS of an unapply, meaning that vals declared in blocks that ultimately return some result that is unapplied into some named Data would not be named.

The actual fix here is like 10 characters, but also see the tests and improvements to docs--the examples I reworked were because either they give bad results with MFC or are optimized in such a way that they don't show the purpose of the example (registers are useful for this)

Also, audit and improve the naming mdocs.

I've marked this for 3.6.x. I think we should get this into 3.6.0, the question is if we should do a 3.6.0-RC4 or if this is fine to sneak in to 3.6.0.

Contributor Checklist

  • Did you add Scaladoc to every public function/method?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you add appropriate documentation in docs/src?
  • Did you state the API impact?
  • Did you specify the code generation impact?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • bug fix
  • documentation

API Impact

No impact

Backend Code Generation Impact

Fixes a bug in the intended behavior of the compiler plugin. I am evaluating the impact on SiFive Verilog. It might be substantial.

Desired Merge Strategy

  • Squash

Release Notes

This results in previously unnamed signals receiving names from the compiler plugin.

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels?
  • Did you mark the proper milestone (Bug fix: 3.5.x or 3.6.x depending on impact, API modification or big change: 5.0.0)?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you do one of the following when ready to merge:
    • Squash: You/ the contributor Enable auto-merge (squash), clean up the commit message, and label with Please Merge.
    • Merge: Ensure that contributor has cleaned up their commit history, then merge with Create a merge commit.

Previously, the naming plugin would not recurse for the RHS of an
unapply, meaning that vals declared in blocks that ultimately return
some result that is unapplied into some named Data would not be named.

Also, audit and improve the naming mdocs.
@jackkoenig jackkoenig added this to the 3.6.x milestone Apr 6, 2023
@jackkoenig
Copy link
Contributor Author

I've reviewed the impact on Verilog in some internal code and from my random sampling, lots of signals are now getting named and overall, the churn isn't too bad. There's a bit of churn because unnamed signals now have lower indices, eg. _T_657 became _T_124. This obviously a good thing because more things are being named which improves overall stability.

@jackkoenig jackkoenig added the Bugfix Fixes a bug, will be included in release notes label Apr 6, 2023
@jackkoenig jackkoenig merged commit 262caa7 into main Apr 6, 2023
@jackkoenig jackkoenig deleted the naming-plugin-recurse branch April 6, 2023 19:05
@mergify mergify bot added the Backported This PR has been backported label Apr 6, 2023
mergify bot pushed a commit that referenced this pull request Apr 6, 2023
Previously, the naming plugin would not recurse for the RHS of an
unapply, meaning that vals declared in blocks that ultimately return
some result that is unapplied into some named Data would not be named.

Also, audit and improve the naming mdocs.

(cherry picked from commit 262caa7)

# Conflicts:
#	docs/src/cookbooks/naming.md
mergify bot added a commit that referenced this pull request Apr 6, 2023
* Fix naming for RHS of named unapply expressions (#3163)

Previously, the naming plugin would not recurse for the RHS of an
unapply, meaning that vals declared in blocks that ultimately return
some result that is unapplied into some named Data would not be named.

Also, audit and improve the naming mdocs.

(cherry picked from commit 262caa7)

# Conflicts:
#	docs/src/cookbooks/naming.md

* Resolve backport conflicts

---------

Co-authored-by: Jack Koenig <[email protected]>
jared-barocsi pushed a commit that referenced this pull request Apr 11, 2023
Previously, the naming plugin would not recurse for the RHS of an
unapply, meaning that vals declared in blocks that ultimately return
some result that is unapplied into some named Data would not be named.

Also, audit and improve the naming mdocs.
azidar pushed a commit that referenced this pull request Apr 11, 2023
Previously, the naming plugin would not recurse for the RHS of an
unapply, meaning that vals declared in blocks that ultimately return
some result that is unapplied into some named Data would not be named.

Also, audit and improve the naming mdocs.
@sequencer sequencer mentioned this pull request Jun 20, 2023
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backported This PR has been backported Bugfix Fixes a bug, will be included in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants