chipsalliance / chipsalliance/rocket-chip
why sinkCard is caculated this way?
- Dominant language
- Scala
- Stars
- 3.9k
- Forks
- 1.3k
- Avg merge
- 5d 13m
- Merged PRs (30d)
- 1
Description
https://github.com/chipsalliance/rocket-chip/blob/46c88b71056581a6bf2a0c4febd5ec3d768c6c59/src/main/scala/diplomacy/Nodes.scala#L951
I feel confused about why the sinkCard(and also sourceCard) is caculated like this?
From the definition inside the BaseNode base class, the sinkCard of one node means How many times is this node used as a sink. So, IMHO the sinkCard of a mixnode shoud be the number of connections in which this mixnode is placed at the LHS of the bind operator(BIND_ONCE and BIND_QUERY), but here it is computed as `oBindings.count(_._3 == BIND_QUERY) + iBindings.count(_._3 == BIND_STAR)` I think it should be `iBindings.count(_._3 == BIND_QUERY) + iBindings.count(_._3 == BIND_STAR)`, I have no idea why it has anything to do with the oBindings, I think oBindings is for the outward side of this mixnode, then this mixnode should be treated as sourceNode.
Can anyone clarify me this? Maybe I misunderstand the meaning of the sinkCard???? Feel very confused!
@hcook @aswaterman @richardxia @sequencer
Contributor guide
Research direction
Start with src/main/scala/diplomacy/Nodes.scala around line 951, then read BaseNode and the definitions of iBindings, oBindings, sinkCard, sourceCard, and the bind operators. Trace how the binding directions are represented and compare that with the issue's proposed formula. Done means documenting the intended semantics and, if the formula is wrong, identifying the corresponding test or correction needed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100