Packages

c

chisel3

fromBigIntToLiteral

implicit class fromBigIntToLiteral extends AnyRef

These implicit classes allow one to convert scala.Int or scala.BigInt to Chisel.UInt|Chisel.SInt by calling .asUInt|.asSInt on them, respectively. The versions .asUInt(width)|.asSInt(width) are also available to explicitly mark a width for the new literal.

Also provides .asBool to scala.Boolean and .asUInt to String

Note that, for stylistic reasons, one should avoid extracting immediately after this call using apply, ie. 0.asUInt(1)(0) due to potential for confusion (the 1 is a bit length and the 0 is a bit extraction position). Prefer storing the result and then extracting from it.

Source
package.scala
Linear Supertypes
AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. fromBigIntToLiteral
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new fromBigIntToLiteral(bigint: BigInt)

Value Members

  1. def B: Bool

    Int to Bool conversion, allowing compact syntax like 1.B and 0.B

  2. def S(width: Width): SInt

    Int to SInt conversion with specified width, recommended style for constants.

  3. def S: SInt

    Int to SInt conversion, recommended style for constants.

  4. def U(width: Width): UInt

    Int to UInt conversion with specified width, recommended style for constants.

  5. def U: UInt

    Int to UInt conversion, recommended style for constants.

  6. def asSInt(width: Width): SInt

    Int to SInt conversion with specified width, recommended style for variables.

  7. def asSInt: SInt

    Int to SInt conversion, recommended style for variables.

  8. def asUInt(width: Width): UInt

    Int to UInt conversion with specified width, recommended style for variables.

  9. def asUInt: UInt

    Int to UInt conversion, recommended style for variables.