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

Make PriorityMux stack safe #2854

Merged
merged 1 commit into from
Nov 19, 2022
Merged

Make PriorityMux stack safe #2854

merged 1 commit into from
Nov 19, 2022

Conversation

jackkoenig
Copy link
Contributor

It used to be implemented with recursion, now it's implemented with a stack safe reverse and foldLeft.

Also there were no tests for PriorityMux so I added one which helps prove the change is functionally correct.

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

  • performance improvement

API Impact

No impact

Backend Code Generation Impact

No impact

Desired Merge Strategy

  • Squash

Release Notes

PriorityMux is now stack-safe and will not require users to increase their JVM's stack size when called with large inputs.

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels?
  • Did you mark the proper milestone (Bug fix: 3.4.x, [small] API extension: 3.5.x, API modification or big change: 3.6.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.

@jackkoenig jackkoenig added this to the 3.5.x milestone Nov 18, 2022
Comment on lines 1 to +4
// SPDX-License-Identifier: Apache-2.0

package chiselTests.util

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this change is unrelated but I opened this file to copy it for making the PriorityMuxSpec and noticed the license comment was in the wrong spot.

It used to be implemented with recursion, now it's implemented with a
stack safe reverse and foldLeft.

Also there were no tests for PriorityMux so I added one which helps
prove the change is functionally correct.
@jackkoenig jackkoenig force-pushed the stack-safe-prioritymux branch from 64be121 to 4e7eac7 Compare November 18, 2022 23:59
Copy link
Member

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

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

Curious what code triggered this…

@jackkoenig jackkoenig merged commit 269ce47 into master Nov 19, 2022
@jackkoenig jackkoenig deleted the stack-safe-prioritymux branch November 19, 2022 01:01
mergify bot pushed a commit that referenced this pull request Nov 19, 2022
It used to be implemented with recursion, now it's implemented with a
stack safe reverse and foldLeft.

Also there were no tests for PriorityMux so I added one which helps
prove the change is functionally correct.

(cherry picked from commit 269ce47)

# Conflicts:
#	src/test/scala/chiselTests/util/PipeSpec.scala
@mergify mergify bot added the Backported This PR has been backported label Nov 19, 2022
mergify bot added a commit that referenced this pull request Dec 7, 2022
* Make PriorityMux stack safe (#2854)

It used to be implemented with recursion, now it's implemented with a
stack safe reverse and foldLeft.

Also there were no tests for PriorityMux so I added one which helps
prove the change is functionally correct.

(cherry picked from commit 269ce47)

# Conflicts:
#	src/test/scala/chiselTests/util/PipeSpec.scala

* Resolve backport conflicts

Co-authored-by: Jack Koenig <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants