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 incorrect comment in ScalaDoc #1756

Merged
merged 1 commit into from
Jan 27, 2021
Merged

Fix incorrect comment in ScalaDoc #1756

merged 1 commit into from
Jan 27, 2021

Conversation

jackkoenig
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?
  • [NA] 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

  • documentation

API Impact

No impact

Backend Code Generation Impact

No impact

Desired Merge Strategy

  • Squash

Release Notes

Fix incorrect example in ScalaDoc for width behavior of RegInit

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?

@jackkoenig jackkoenig added this to the 3.2.x milestone Jan 27, 2021
@jackkoenig jackkoenig requested a review from chick January 27, 2021 00:56
Copy link
Contributor

@chick chick left a comment

Choose a reason for hiding this comment

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

I tested it on scastie, seems right now

@@ -127,7 +127,7 @@ object RegNext {
* val x = Wire(UInt())
* val y = Wire(UInt(8.W))
* val r1 = RegInit(x) // width will be inferred
* val r2 = RegInit(y) // width is set to 8
* val r2 = RegInit(y) // width will be inferred
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't it set to 8 eventually? What's the mechanism?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

inference in FIRRTL

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add it as a comment? It may not be obvious that it is inferred, especially if the example code doesn't assign anything else to r2 that could change its width.

Copy link
Contributor

@chick chick Jan 27, 2021

Choose a reason for hiding this comment

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

@edwardcwang Here's the scastie demo. I am not sure of the mechanism, but it confirms, I believe, the correctness of Jack's change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Read the whole ScalaDoc, that’s sort of the point of this whole example: https://www.chisel-lang.org/api/3.4.1/chisel3/RegInit$.html

It’s just that that particular comment is wrong and contradicts the correct info above.

@jackkoenig jackkoenig added the Please Merge Accepted PRs that are ready to be merged. Useful when waiting on CI. label Jan 27, 2021
@mergify mergify bot merged commit d0db0b8 into master Jan 27, 2021
mergify bot pushed a commit that referenced this pull request Jan 27, 2021
mergify bot pushed a commit that referenced this pull request Jan 27, 2021
mergify bot pushed a commit that referenced this pull request Jan 27, 2021
@mergify mergify bot added the Backported This PR has been backported label Jan 27, 2021
@edwardcwang edwardcwang deleted the fix-scaladoc branch January 27, 2021 01:17
mergify bot added a commit that referenced this pull request Jan 27, 2021
(cherry picked from commit d0db0b8)

Co-authored-by: Jack Koenig <[email protected]>
mergify bot added a commit that referenced this pull request Jan 27, 2021
(cherry picked from commit d0db0b8)

Co-authored-by: Jack Koenig <[email protected]>
mergify bot added a commit that referenced this pull request Jan 27, 2021
(cherry picked from commit d0db0b8)

Co-authored-by: Jack Koenig <[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. release issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants