chipsalliance / chipsalliance/rocket-chip

Possible comment error in MixedNode class (Node.scala)

Open
#2,744 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Scala
Stars
3.9k
Forks
1.3k
Avg merge
5d 13m
Merged PRs (30d)
1

Description

I found inconformity in the comments of the following code section located in the defition of MixedNode class of Node.scala: https://github.com/chipsalliance/rocket-chip/blob/46c88b71056581a6bf2a0c4febd5ec3d768c6c59/src/main/scala/diplomacy/Nodes.scala#L1033
`protected[diplomacy] lazy val (oPortMapping: Seq[(Int, Int)], iPortMapping: Seq[(Int, Int)], oStar: Int, iStar: Int)`
the fuction of this method is `Resolve all the star operators into concrete indicies.` But the comment of this method indicates `[[oStar]]: the value to return for this node N for any N :*= foo or N :*=* foo :*= bar` which N is on the lhs of the expression.
However, there are also comments in the place where oStars is caculated, indicating `For a given node N...
// Number of foo :=* N
// + Number of bar :=* foo :*=* N`, Now N is on the rhs of the expression.
I think the rhs version is correct, but I am not sure for this. Can anyone clarify this for me, whether it is an error, or it indicates something I dont know.
Thanks.
@richardxia @sequencer @mwachs5 @aswaterman

Contributor guide

Open the contributing guide

Research direction

Start at src/main/scala/diplomacy/Nodes.scala around line 1033 and read the MixedNode oStar/iStar comments alongside the comments at the oStar calculation. Trace the shown operator expressions to determine which lhs/rhs wording is correct; done means clarifying the semantics and updating any inconsistent comment.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.