object CarrySaveAdder
Carry-save adder circuit generation functions. Constructs a tree to reduce an arbitrary number of input terms to two terms.
Example resulting circuit topology if applied to 8 4-bit-wide terms, a...h:
Rank 1: create groups of 3 terms, reducing each group to 2 terms; i,j,k,l,g,h GROUP0 GROUP1 GROUP2 aaaa dddd gggg bbbb eeee hhhh cccc ffff _____+ _____+ _____+ iiii kkkk gggg jjjj. llll. hhhh Rank 2: create groups of 3 terms, reducing each group to 2 terms: m,n,o,p GROUP0 GROUP1 iiii llll. jjjj. gggg kkkk hhhh ______+ ______+ mmmmm ooooo nnnn. pppp. Rank 3: create groups of 3 terms, reducing each group to 2 terms: q,r,p GROUP0 GROUP1 mmmmm pppp. nnnn. ooooo ______+ ______+ qqqqq pppp. rrrrr. Rank 4: reduce last group of 3 terms to 2 terms: s,t qqqqq rrrrr. pppp. ______+ ssssss tttt..
Every . is an empty spot introduced by the topology, constant zero in the carry LSB. If the input has single-bit terms, insert those there. In the example tree above, there are six spots where we can insert a single-bit term: j,l,n,p,r,t
Future improvement suggestion (not implemented yet):
- Add support for negative weights at arbitrary bit positions; required to support subtraction.
- The circuitry then returns two UInt hardware terms; final addition includes a signed constant offset.
- Source
- CircuitMath.scala
- Alphabetic
- By Inheritance
- CarrySaveAdder
- 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 apply(terms: Seq[UInt], bit: Bool, moreBits: Bool*)(implicit sourceInfo: SourceInfo): UInt
Adds the arbitrary-length sequence of UInts in an area- and timing-efficient way, by using a Carry-Save Adder tree.
Adds the arbitrary-length sequence of UInts in an area- and timing-efficient way, by using a Carry-Save Adder tree. The elements from the bits parameter are inserted in the holes at the LSB positions in the tree, without adding logic depth. If more bits are offered than holes are available, elaboration fails.
- def apply(terms: Seq[UInt], bit: Bool)(implicit sourceInfo: SourceInfo): UInt
Adds the arbitrary-length sequence of UInts in an area- and timing-efficient way, by using a Carry-Save Adder tree.
Adds the arbitrary-length sequence of UInts in an area- and timing-efficient way, by using a Carry-Save Adder tree. Inserts an additional bit in the LSB bit position, without adding logic depth. If less than three terms are provided, there is no hole for the addtional bit, and elaboration fails.
- def apply(firstTerm: UInt, moreTerms: UInt*)(implicit sourceInfo: SourceInfo): UInt
Adds an arbitrary number of UInts in an area- and timing-efficient way, by using a Carry-Save Adder tree.
- def apply(terms: Seq[UInt])(implicit sourceInfo: SourceInfo): UInt
Adds the arbitrary-length sequence of UInts in an area- and timing-efficient way, by using a Carry-Save Adder tree.
- def apply(terms: Seq[UInt], bits: Seq[Bool])(implicit sourceInfo: SourceInfo): UInt
Adds an arbitrary-length sequence of UInts in an area- and timing-efficient way, by using a Carry-Save Adder tree.
Adds an arbitrary-length sequence of UInts in an area- and timing-efficient way, by using a Carry-Save Adder tree. The elements from the bits parameter are inserted in the holes at the LSB positions in the tree, without adding logic depth. If more bits are offered than holes are available, elaboration fails.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- 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 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()
- def sumCarry(terms: Seq[UInt], bit: Bool, moreBits: Bool*)(implicit sourceInfo: SourceInfo): (UInt, UInt)
Adds the arbitrary-length sequence of UInts in an area- and timing-efficient way, by using a Carry-Save Adder tree.
Adds the arbitrary-length sequence of UInts in an area- and timing-efficient way, by using a Carry-Save Adder tree. The elements from the bits parameter are inserted in the holes at the LSB positions in the tree, without adding logic depth. If more bits are offered than holes are available, elaboration fails. Returns the sum in redundant format as sum/carry tuple.
- def sumCarry(terms: Seq[UInt], bit: Bool)(implicit sourceInfo: SourceInfo): (UInt, UInt)
Adds the arbitrary-length sequence of UInts in an area- and timing-efficient way, by using a Carry-Save Adder tree.
Adds the arbitrary-length sequence of UInts in an area- and timing-efficient way, by using a Carry-Save Adder tree. Inserts an additional bit in the LSB bit position, without adding logic depth. If less than three terms are provided, there is no hole for the addtional bit, and elaboration fails. Returns the sum in redundant format as sum/carry tuple.
- def sumCarry(firstTerm: UInt, moreTerms: UInt*)(implicit sourceInfo: SourceInfo): (UInt, UInt)
Adds an arbitrary number of UInts in an area- and timing-efficient way, by using a Carry-Save Adder tree.
Adds an arbitrary number of UInts in an area- and timing-efficient way, by using a Carry-Save Adder tree. Returns the sum in redundant format as sum/carry tuple.
- def sumCarry(terms: Seq[UInt])(implicit sourceInfo: SourceInfo): (UInt, UInt)
Adds the arbitrary-length sequence of UInts in an area- and timing-efficient way, by using a Carry-Save Adder tree.
Adds the arbitrary-length sequence of UInts in an area- and timing-efficient way, by using a Carry-Save Adder tree. Returns the sum in redundant format as sum/carry tuple.
- def sumCarry(terms: Seq[UInt], bits: Seq[Bool])(implicit sourceInfo: SourceInfo): (UInt, UInt)
Adds the arbitrary-length sequence of UInts in an area- and timing-efficient way, by using a Carry-Save Adder tree.
Adds the arbitrary-length sequence of UInts in an area- and timing-efficient way, by using a Carry-Save Adder tree. The elements from the bits parameter are inserted in the holes at the LSB positions in the tree, without adding logic depth. If more bits are offered than holes are available, elaboration fails. Returns the sum in redundant format as sum/carry tuple.
- 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.