Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/main/scala-2/chisel3/BitsIntf.scala
Original file line number Diff line number Diff line change
Expand Up @@ -900,5 +900,5 @@ private[chisel3] trait BoolIntf extends ToBoolable { self: Bool =>
def implies(that: Bool): Bool = macro SourceInfoTransform.thatArg

/** @group SourceInfoTransformMacro */
def do_implies(that: Bool)(implicit sourceInfo: SourceInfo): Bool = (!this) | that
def do_implies(that: Bool)(implicit sourceInfo: SourceInfo): Bool = _impl_implies(that)
}
7 changes: 7 additions & 0 deletions core/src/main/scala-3/chisel3/BitsIntf.scala
Original file line number Diff line number Diff line change
Expand Up @@ -597,4 +597,11 @@ private[chisel3] trait BoolIntf extends ToBoolable { self: Bool =>
def asClock(using SourceInfo): Clock = _asClockImpl

def asAsyncReset(using SourceInfo): AsyncReset = _asAsyncResetImpl

/** Logical implication
*
* @param that a boolean signal
* @return [[!this || that]]
*/
def implies(that: Bool)(using SourceInfo): Bool = _impl_implies(that)
}
2 changes: 2 additions & 0 deletions core/src/main/scala/chisel3/Bits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,8 @@ sealed class Bool() extends UInt(1.W) with BoolIntf with Reset {
protected def _asAsyncResetImpl(implicit sourceInfo: SourceInfo): AsyncReset =
pushOp(DefPrim(sourceInfo, AsyncReset(), AsAsyncResetOp, ref))

protected def _impl_implies(that: Bool)(implicit sourceInfo: SourceInfo): Bool = (!this) | that

override protected def _fromUInt(that: UInt)(implicit sourceInfo: SourceInfo): this.type = {
_resizeToWidth(that, this.widthOption, true)(identity).asBool.asInstanceOf[this.type]
}
Expand Down