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

SeqUtils asUInt endian-ness: hi/lo instead of right/left #1647

Merged
merged 2 commits into from
Nov 2, 2020
Merged

SeqUtils asUInt endian-ness: hi/lo instead of right/left #1647

merged 2 commits into from
Nov 2, 2020

Conversation

ingallsj
Copy link
Contributor

@ingallsj ingallsj commented Oct 30, 2020

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

  • backend code generation

API Impact

this changes the Chisel Naming from #1448 to notate endianness as "hi/lo" instead of "right/left", because Scala and Verilog use opposite endianness in lists/arrays

Backend Code Generation Impact

With #1448, this Chisel

val out2 = Seq(signalname(0), signalname(1)).asUInt
val out4 = Seq(signalname(0), signalname(1), signalname(2), signalname(3)).asUInt

would generate this Verilog:

wire [1:0] out2 = {signalname_right, signalname_left};
wire [3:0] out4 = {signalname_right_right, signalname_right_left, signalname_left_right, signalname_left_left};

This looks backwards to me when reading the Verilog: the rights and lefts are reversed. So instead, with this change:

wire [1:0] out2 = {signalname_hi, signalname_lo};
wire [3:0] out4 = {signalname_hi_hi, signalname_hi_lo, signalname_lo_hi, signalname_lo_lo};

Desired Merge Strategy

  • Squash: The PR will be squashed and merged (choose this if you have no preference.)

Release Notes

Verilog generation: asUInt endianness "hi/lo" instead of "right/left"

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels?
  • Did you mark the proper milestone (3.2.x, 3.3.x, 3.4.0, 3.5.0) ?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you mark as Please Merge?

@ingallsj ingallsj requested a review from a team as a code owner October 30, 2020 20:58
@ingallsj ingallsj requested review from jackkoenig and removed request for a team October 30, 2020 20:58
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.

Looks better to me.

@jackkoenig jackkoenig added this to the 3.4.x milestone Nov 2, 2020
@jackkoenig jackkoenig added the Please Merge Accepted PRs that are ready to be merged. Useful when waiting on CI. label Nov 2, 2020
@mergify mergify bot merged commit 7053848 into chipsalliance:master Nov 2, 2020
mergify bot pushed a commit that referenced this pull request Nov 2, 2020
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 7053848)
@mergify mergify bot added the Backported This PR has been backported label Nov 2, 2020
mergify bot added a commit that referenced this pull request Nov 2, 2020
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 7053848)

Co-authored-by: John Ingalls <[email protected]>
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 Please Merge Accepted PRs that are ready to be merged. Useful when waiting on CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants