-
Notifications
You must be signed in to change notification settings - Fork 615
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
asBools, asBool, and chained apply on asBools #950
Conversation
@@ -78,6 +78,15 @@ abstract class Element extends Data { | |||
*/ | |||
private[chisel3] sealed trait ToBoolable extends Element { | |||
|
|||
/** Casts this $coll to a [[Bool]] |
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.
Is $coll
meant to be substituted?
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.
@seldridge added this when he improved the ScalaDoc, I just copied it from toBool
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.
Generally LGTM
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.
lgtm
width match { | ||
case KnownWidth(1) => this(0) | ||
case _ => throwException(s"can't covert UInt<$width> to Bool") | ||
case _ => throwException(s"can't covert ${this.getClass.getSimpleName}$width to Bool") |
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.
Perhaps a future todo: add a function to render a data type as a string. This looks like it's asking for something at a higher level of abstraction and more general that should exist, but doesn't.
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.
Agreed, I think a way to render unbound types as well as bound values in a more useful way would be very valuable. The whole UInt@4fd5e7a
is pretty worthless most of the time
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.
Created a tracking issue for that in #953
retest this please |
The expanded version substituted in by the macro was misspelled, renamed from toBools -> do_toBools as expected by the macro
Related issue:
Type of change: other enhancement
Impact: API modification
Development Phase: implementation
Release Notes
.asBools