object PopCount extends PopCount$Intf
Returns the number of bits set (value is 1 or true) in the input signal.
- Source
- Bitwise.scala
PopCount(Seq(true.B, false.B, true.B, true.B)) // evaluates to 3.U PopCount(Seq(false.B, false.B, true.B, false.B)) // evaluates to 1.U PopCount("b1011".U) // evaluates to 3.U PopCount("b0010".U) // evaluates to 1.U PopCount(myUIntWire) // dynamic count
- Grouped
- Alphabetic
- By Inheritance
- PopCount
- PopCount$Intf
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def _applyImpl(in: Bits)(implicit sourceInfo: SourceInfo): UInt
- Attributes
- protected
- def _applyImpl(in: Iterable[Bool])(implicit sourceInfo: SourceInfo): UInt
- Attributes
- protected
- macro def apply(in: Bits): UInt
- Definition Classes
- PopCount$Intf
- macro def apply(in: Iterable[Bool]): UInt
- Definition Classes
- PopCount$Intf
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def atLeast(n: Int, x: Iterable[Bool])(implicit sourceInfo: SourceInfo): Bool
Implements PopCount(x)>=n with less deep circuitry in case n=0,1,2,x.width-1,x.width
Implements PopCount(x)>=n with less deep circuitry in case n=0,1,2,x.width-1,x.width
- n
Int Static value that PopCount(x) is compared against
- x
Seq/Vec of Bool to PopCount
- returns
true.B when x has n or more bits set
- def atLeast(n: Int, x: UInt)(implicit sourceInfo: SourceInfo): Bool
Implements PopCount(x)>=n with less deep circuitry in case n=0,1,2,x.width-1,x.width
Implements PopCount(x)>=n with less deep circuitry in case n=0,1,2,x.width-1,x.width
- n
Int Static value that PopCount(x) is compared against
- x
UInt to PopCount
- returns
true.B when x has n or more bits set
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def do_apply(in: Bits)(implicit sourceInfo: SourceInfo): UInt
- Definition Classes
- PopCount$Intf
- def do_apply(in: Iterable[Bool])(implicit sourceInfo: SourceInfo): UInt
- Definition Classes
- PopCount$Intf
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equalTo(n: Int, x: Iterable[Bool])(implicit sourceInfo: SourceInfo): Bool
Implements PopCount(x)==n with less deep circuitry in case n=0,1,x.width-1,x.width
Implements PopCount(x)==n with less deep circuitry in case n=0,1,x.width-1,x.width
- n
Int Static value that PopCount(x) is compared against
- x
Seq/Vec of Bool to PopCount
- returns
true.B when x has exactly n bits set
- def equalTo(n: Int, x: UInt)(implicit sourceInfo: SourceInfo): Bool
Implements PopCount(x)==n with less deep circuitry in case n=0,1,x.width-1,x.width
Implements PopCount(x)==n with less deep circuitry in case n=0,1,x.width-1,x.width
- n
Int Static value that PopCount(x) is compared against
- x
UInt to PopCount
- returns
true.B when x has exactly n bits set
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def greaterThan(n: Int, x: Iterable[Bool])(implicit sourceInfo: SourceInfo): Bool
Implements PopCount(x)>n with less deep circuitry in case n=0,1,x.width-1
Implements PopCount(x)>n with less deep circuitry in case n=0,1,x.width-1
- n
Int Static value that PopCount(x) is compared against
- x
Seq/Vec of Bool to PopCount
- returns
true.B when x has more than n bits set
- def greaterThan(n: Int, x: UInt)(implicit sourceInfo: SourceInfo): Bool
Implements PopCount(x)>n with less deep circuitry in case n=0,1,x.width-1
Implements PopCount(x)>n with less deep circuitry in case n=0,1,x.width-1
- n
Int Static value that PopCount(x) is compared against
- x
UInt to PopCount
- returns
true.B when x has more than n bits set
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
This is the documentation for Chisel.
Package structure
The chisel3 package presents the public API of Chisel. It contains the concrete core types
UInt,SInt,Bool,Clock, andReg, the abstract typesBits,Aggregate, andData, and the aggregate typesBundleandVec.The Chisel package is a compatibility layer that attempts to provide chisel2 compatibility in chisel3.
Utility objects and methods are found in the
utilpackage.The
testerspackage defines the basic interface for chisel testers.