-
Notifications
You must be signed in to change notification settings - Fork 572
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
Add field grouping ScalaDoc for ArbiterIO #2208
Conversation
@@ -13,6 +13,7 @@ import chisel3.internal.naming.chiselName // can't use chisel3_ version because | |||
* | |||
* @param gen data type | |||
* @param n number of inputs | |||
* @group Define IO bundle definition for an Arbiter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @group Define IO bundle definition for an Arbiter | |
* @group Define IO bundle definition for an Arbiter |
I think you want @groupdesc
here, and I think the @groupdesc
should go into Aggregate.scala
... if that is a thing that works? So that every subclass of Bundle can by convention refer to the same group?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add field grouping ScalaDoc for ArbiterIO
Okay @jackkoenig thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you want
@groupdesc
here, and I think the@groupdesc
should go intoAggregate.scala
... if that is a thing that works? So that every subclass of Bundle can by convention refer to the same group?
Yes that's right. So I will send it into aggregate.scala, but I wish ask if that means all subclasses of Bundle will have the same description?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think the groupdesc
could describe just fields with the same function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I will send it into aggregate.scala, but I wish ask if that means all subclasses of Bundle will have the same description?
Right, in that case the description would need to be something very generic like "The actual hardware fields of the Bundle". Keep in mind this is still opt-in for the user, they would need to manually add the @group Signals
to each-and-every one of their val
in their own Bundle
subclass... which you can see is very verbose in the ArbiterIO example. I do not know a better way :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay thank you @mwachs5, I will do just that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @mwachs5 please I keep seeing Some test were not successful, is there a way I can solve it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one of the errors I'm seeing is
[error] ^
[error] /home/runner/work/chisel3/chisel3/src/main/scala/chisel3/util/Arbiter.scala:34:3: expected class or object definition
[error] val out = Decoupled(gen)
[error] ^
[error] /home/runner/work/chisel3/chisel3/src/main/scala/chisel3/util/Arbiter.scala:35:3: expected class or object definition
[error] val chosen = Output(UInt(log2Ceil(n).W))
[error] ^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I put def there instead of val?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I should have removed
val in = Flipped(Vec(n, Decoupled(gen)))
val out = Decoupled(gen)
val chosen = Output(UInt(log2Ceil(n).W))
after adding
/**
*... unchanged
*/
class ArbiterIO[T <: Data](private val gen: T, val n: Int) extends Bundle {
// See github.com/freechipsproject/chisel3/issues/765 for why gen is a private val and proposed replacement APIs.
/* Input data, one per potential sender
* @group Signals
*/
val in = Flipped(Vec(n, Decoupled(gen)))
/* Output data after arbitration
* @group Signals
*/
val out = Decoupled(gen)
/* One-Hot vector indicating which output was chosen
* @group Signals
*/
val chosen = Output(UInt(log2Ceil(n).W))
}
So I hope it works now
@@ -98,6 +99,7 @@ class LockingArbiter[T <: Data](gen: T, n: Int, count: Int, needsLock: Option[T | |||
* arb.io.in(0) <> producer0.io.out | |||
* arb.io.in(1) <> producer1.io.out | |||
* consumer.io.in <> arb.io.out | |||
* @group Define |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @group Define | |
* @group Signals |
Thoughts @jackkoenig , @azidar on what this should be called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, this suggestion isn't quite right... let me give a clearer one...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The right way to add grouping to the scaladoc to something that extends Bundle
is like this (I think!)
/**
*... unchanged
*/
class ArbiterIO[T <: Data](private val gen: T, val n: Int) extends Bundle {
// See github.com/freechipsproject/chisel3/issues/765 for why gen is a private val and proposed replacement APIs.
/* Input data, one per potential sender
* @group Signals
*/
val in = Flipped(Vec(n, Decoupled(gen)))
/* Output data after arbitration
* @group Signals
*/
val out = Decoupled(gen)
/* One-Hot vector indicating which output was chosen
* @group Signals
*/
val chosen = Output(UInt(log2Ceil(n).W))
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but oof this is quite verbose in the code!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably call it Ports
or IOs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The right way to add grouping to the scaladoc to something that
extends Bundle
is like this (I think!)/** *... unchanged */ class ArbiterIO[T <: Data](private val gen: T, val n: Int) extends Bundle { // See github.com/freechipsproject/chisel3/issues/765 for why gen is a private val and proposed replacement APIs. /* Input data, one per potential sender * @group Signals */ val in = Flipped(Vec(n, Decoupled(gen))) /* Output data after arbitration * @group Signals */ val out = Decoupled(gen) /* One-Hot vector indicating which output was chosen * @group Signals */ val chosen = Output(UInt(log2Ceil(n).W)) }
Okay @mwachs5, thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that means I have I to remove the other groupings I did.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the other groupings just won't do anything, since they aren't specifically on any members (val
, def
) of the class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, there was a blackout in my area.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no worries
changed group name Co-authored-by: Megan Wachs <megan@sifive.com>
Can you make the title of this PR a little more precise? Maybe something like "Add field grouping ScalaDoc for ArbiterIO". |
Were you able to build the API docs (different than the website Cookbooks/Explanation docs) by running |
Co-authored-by: Megan Wachs <megan@sifive.com>
Hello @mwachs5, I'm finding difficulties doing it. Should I type it in terminal, and should I replace file in file->open with the file name? |
Please where are the HTML files located? |
Hello @mwachs5, I opened it on my web browser, I was looking in the wrong place. |
But the information here is different than that on the main API website |
The main API website would have the 3.4.4 docs at this time, while if you build from master I would expect some differences. But, do you see any new grouping when you look at |
|
It looks like it has generic groupings for all the subclasses |
I don't understand why the groupings we did is not showing on my local api web page. |
I changed the group in Arbiter to groupdesc and it showed on the web page under Arbiter but nothing changed on ArbiterIO. |
Hello @mwachs5, @jackkoenig, Please I'm stuck and have tried out several ways to make the grouping show on my local api webpage but its not visible. |
It does the same on the main api web site too. |
Hello @mwachs5 I wish to do groupings for subclasses of Bundle first which are: ArbiterIO, DecoupledIO, IrrevocableIO, PipeIO, QueueIO, ReadyValidIO, Valid, PRNGIO |
In the place of
Its rather showing:
on the master branch for QueuIO.scala |
I don't know if its the master branch or the 3.4.x that is outdated? |
Master branch is newer and you should always work from the master branch. What happens is that once this PR is merged, depending on what We could also just decide not to backport and have this be a feature when we release 3.5, then we will mark with the 3.5.0 milesone instead of 3.4 In the particular example of th Queue, someone recently added the new |
Okay @mwachs5, thank you for the clarification. |
Co-authored-by: Megan Wachs <megan@sifive.com>
Co-authored-by: Megan Wachs <megan@sifive.com>
Hello @mwachs5, Thanks for the review and corrections I committed the suggestions. |
Co-authored-by: Megan Wachs <megan@sifive.com>
Hi @mwachs5, I went through it to check of syntax or ScalaDoc errors, and I think including your commit suggestions is no longer different from that on the master branch. |
* Update Arbiter.scala * Update src/main/scala/chisel3/util/Arbiter.scala changed group name Co-authored-by: Megan Wachs <megan@sifive.com> * minor changes on grouping ArbiterIO * removed unmatched closing brace * Remove groupdesc from Arbiter.scala * Added groupdesc to Aggregate.scala * Update Arbiter.scala * Update core/src/main/scala/chisel3/Aggregate.scala Co-authored-by: Megan Wachs <megan@sifive.com> * Update Arbiter.scala * Update src/main/scala/chisel3/util/Arbiter.scala Added suugestions. Co-authored-by: Megan Wachs <megan@sifive.com> * added suggestions from review * added suggestions from review * Resolved conflicts * update Arbiter.scala * Update core/src/main/scala/chisel3/Aggregate.scala deleted groudesc for ArbiterIO Co-authored-by: Megan Wachs <megan@sifive.com> * Update Scaladoc syntax * removed some lines * Better documentation * Removed @param and @gen * Update core/src/main/scala/chisel3/Aggregate.scala Co-authored-by: Megan Wachs <megan@sifive.com> * Update src/main/scala/chisel3/util/Arbiter.scala Co-authored-by: Megan Wachs <megan@sifive.com> * Added groupdesc to ArbiterIO * Update src/main/scala/chisel3/util/Arbiter.scala Co-authored-by: Megan Wachs <megan@sifive.com> * Update core/src/main/scala/chisel3/Aggregate.scala Co-authored-by: Megan Wachs <megan@sifive.com> * Update Arbiter.scala * Update src/main/scala/chisel3/util/Arbiter.scala Co-authored-by: Megan Wachs <megan@sifive.com> * Update Arbiter.scala Co-authored-by: Megan Wachs <megan@sifive.com> (cherry picked from commit 6145512)
* Update Arbiter.scala * Update src/main/scala/chisel3/util/Arbiter.scala changed group name Co-authored-by: Megan Wachs <megan@sifive.com> * minor changes on grouping ArbiterIO * removed unmatched closing brace * Remove groupdesc from Arbiter.scala * Added groupdesc to Aggregate.scala * Update Arbiter.scala * Update core/src/main/scala/chisel3/Aggregate.scala Co-authored-by: Megan Wachs <megan@sifive.com> * Update Arbiter.scala * Update src/main/scala/chisel3/util/Arbiter.scala Added suugestions. Co-authored-by: Megan Wachs <megan@sifive.com> * added suggestions from review * added suggestions from review * Resolved conflicts * update Arbiter.scala * Update core/src/main/scala/chisel3/Aggregate.scala deleted groudesc for ArbiterIO Co-authored-by: Megan Wachs <megan@sifive.com> * Update Scaladoc syntax * removed some lines * Better documentation * Removed @param and @gen * Update core/src/main/scala/chisel3/Aggregate.scala Co-authored-by: Megan Wachs <megan@sifive.com> * Update src/main/scala/chisel3/util/Arbiter.scala Co-authored-by: Megan Wachs <megan@sifive.com> * Added groupdesc to ArbiterIO * Update src/main/scala/chisel3/util/Arbiter.scala Co-authored-by: Megan Wachs <megan@sifive.com> * Update core/src/main/scala/chisel3/Aggregate.scala Co-authored-by: Megan Wachs <megan@sifive.com> * Update Arbiter.scala * Update src/main/scala/chisel3/util/Arbiter.scala Co-authored-by: Megan Wachs <megan@sifive.com> * Update Arbiter.scala Co-authored-by: Megan Wachs <megan@sifive.com> (cherry picked from commit 6145512) Co-authored-by: Abongwa Bonalais <81782853+Burnleydev1@users.noreply.github.com>
Contributor Checklist
docs/src
?Type of Improvement
Documentation
API Impact
Unknown Impact
Backend Code Generation Impact
No impact
Desired Merge Strategy
Squash
Release Notes
Improved documentation for ArbiterIO
Reviewer Checklist (only modified by reviewer)
3.3.x
, [small] API extension:3.4.x
, API modification or big change:3.5.0
)?Please Merge
?