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

Barrel Shifter/Rotater for Vec #2518

Merged
merged 5 commits into from May 15, 2022

Conversation

ZenithalHourlyRate
Copy link
Contributor

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

  • new feature/API

API Impact

This does not affect the current API.

This adds BarrelShifter API for Vec. This reduces latency when shifting a whole UInt by byte/word instead of by bits. (e.g. aes32esi needs to select one byte among four bytes. This is used in chipsalliance/rocket-chip#2950)

Backend Code Generation Impact

Does this change any generated Verilog? No

Desired Merge Strategy

  • Rebase

Release Notes

  • Shift/Rotate for Vec is more efficiently now via experimental BarrelShifter API

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 mark as Please Merge?

@CLAassistant
Copy link

CLAassistant commented May 7, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@sequencer sequencer left a comment

Choose a reason for hiding this comment

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

LGTM with some nitpicks on documentation and API decision.
I have been looking forward to a configurable Barrel Shifter implementation to have a fine granular control to dynamic shifting. Thanks @ZenithalHourlyRate

@ekiwi
Copy link
Contributor

ekiwi commented May 7, 2022

I like it, but I am wondering if this should be part of a new chisel3.std package? Since it is a useful functionality to have, but not necessarily part of the core language?

@sequencer
Copy link
Member

@ekiwi Agree, I also want this to live in the chisel3.std(I may also wanna move more utils to that package.)

@ZenithalHourlyRate
Copy link
Contributor Author

Fixed format issue

@sequencer
Copy link
Member

@ZenithalHourlyRate I just helped you fix the build.sc and rebased it to master, you may need to tune the build.sbt to make CI happy.

@ZenithalHourlyRate
Copy link
Contributor Author

@ekiwi Where should I put the test, in integration-tests/src/test/scala/chiselTests/std/ or stdlib/test/scala/chisel3/std ?

@ZenithalHourlyRate
Copy link
Contributor Author

I tried to put the test in stdlib/test/scala/chisel3/std following #2441, this time both compile and test work for mill

mill chisel3\[_\].stdlib.compile
mill chisel3\[_\].stdlib.test

but for sbt, when I

sbt ++2.13.6 standardLibrary/compile
sbt ++2.13.6 standardLibrary/test

sbt would complain that not found: object chiseltest, it seems that the dependency is missing, but I can find it in build.sbt https://github.com/chipsalliance/chisel3/blob/4a78369a67ad0adfb5e8721f59e6b0b84e690e68/build.sbt#L253

I do not know how to fix this sbt issue. Is there any suggestion on this?

@ZenithalHourlyRate
Copy link
Contributor Author

This time all compile and test worked for sbt and mill

sbt ++2.13.6 standardLibrary/compile
sbt ++2.13.6 standardLibrary/test
mill chisel3\[_\].stdlib.compile
mill chisel3\[_\].stdlib.test

Test is in stdlib/src/test now

Copy link
Member

@sequencer sequencer left a comment

Choose a reason for hiding this comment

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

Small nitpick. Generally LGTM.

@sequencer
Copy link
Member

:shipit: with squash and not backport, if any concerns, we can revert it.

@sequencer sequencer added the Squash and merge These commits don't matter, squash and merge label May 15, 2022
@ekiwi ekiwi added this to the 3.6.0 milestone May 15, 2022
@ekiwi ekiwi added the Please Merge Accepted PRs that are ready to be merged. Useful when waiting on CI. label May 15, 2022
@mergify mergify bot merged commit 6d4e6ed into chipsalliance:master May 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Please Merge Accepted PRs that are ready to be merged. Useful when waiting on CI. Squash and merge These commits don't matter, squash and merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants