Class/Object

chisel3.core

Bits

Related Docs: object Bits | package core

Permalink

sealed abstract class Bits extends Element

A data type for values represented by a single bitvector. Provides basic bitwise operations.

Linear Supertypes
Element, Data, HasId, InstanceId, AnyRef, Any
Known Subclasses
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Bits
  2. Element
  3. Data
  4. HasId
  5. InstanceId
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def do_<<(that: UInt)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bits

    Permalink
  2. abstract def do_<<(that: Int)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bits

    Permalink
  3. abstract def do_<<(that: BigInt)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bits

    Permalink
  4. abstract def do_>>(that: UInt)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bits

    Permalink
  5. abstract def do_>>(that: Int)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bits

    Permalink
  6. abstract def do_>>(that: BigInt)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bits

    Permalink
  7. abstract def do_asSInt(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): SInt

    Permalink
  8. abstract def do_asUInt(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): UInt

    Permalink
    Definition Classes
    Data
  9. abstract def do_unary_~(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bits

    Permalink

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final macro def ##(that: Bits): UInt

    Permalink

    Returns this wire concatenated with other, where this wire forms the most significant part and other forms the least significant part.

    Returns this wire concatenated with other, where this wire forms the most significant part and other forms the least significant part.

    The width of the output is sum of the inputs.

  3. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def :=(that: Data)(implicit sourceInfo: SourceInfo, connectionCompileOptions: CompileOptions): Unit

    Permalink
    Definition Classes
    Data
  5. final macro def <<(that: UInt): Bits

    Permalink

    Returns this wire dynamically left shifted by the specified amount, inserting zeros into the least significant bits.

    Returns this wire dynamically left shifted by the specified amount, inserting zeros into the least significant bits.

    The width of the output is pow(2, width(other)) larger than the input.

  6. final macro def <<(that: Int): Bits

    Permalink

    Returns this wire statically left shifted by the specified amount, inserting zeros into the least significant bits.

    Returns this wire statically left shifted by the specified amount, inserting zeros into the least significant bits.

    The width of the output is other larger than the input.

  7. final macro def <<(that: BigInt): Bits

    Permalink

    Shift left operation

  8. final def <>(that: Data)(implicit sourceInfo: SourceInfo, connectionCompileOptions: CompileOptions): Unit

    Permalink
    Definition Classes
    Data
  9. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. final macro def >>(that: UInt): Bits

    Permalink

    Returns this wire dynamically right shifted by the specified amount, inserting zeros into the most significant bits.

    Returns this wire dynamically right shifted by the specified amount, inserting zeros into the most significant bits.

    The width of the output is the same as the input.

  11. final macro def >>(that: Int): Bits

    Permalink

    Returns this wire statically right shifted by the specified amount, inserting zeros into the most significant bits.

    Returns this wire statically right shifted by the specified amount, inserting zeros into the most significant bits.

    The width of the output is the same as the input.

  12. final macro def >>(that: BigInt): Bits

    Permalink

    Shift right operation

  13. final macro def apply(x: BigInt, y: BigInt): UInt

    Permalink
  14. final macro def apply(x: Int, y: Int): UInt

    Permalink

    Returns a subset of bits on this wire from hi to lo (inclusive), statically addressed.

    Returns a subset of bits on this wire from hi to lo (inclusive), statically addressed.

    Example:
    1. myBits = 0x5 = 0b101
      myBits(1,0) => 0b01  // extracts the two least significant bits
  15. final macro def apply(x: UInt): Bool

    Permalink

    Returns the specified bit on this wire as a Bool, dynamically addressed.

  16. final macro def apply(x: Int): Bool

    Permalink

    Returns the specified bit on this wire as a Bool, statically addressed.

    Returns the specified bit on this wire as a Bool, statically addressed.

    Note

    convenience method allowing direct use of Ints without implicits

  17. final macro def apply(x: BigInt): Bool

    Permalink

    Returns the specified bit on this wire as a Bool, statically addressed.

  18. final macro def asFixedPoint(that: BinaryPoint): FixedPoint

    Permalink

    Reinterpret cast as a FixedPoint.

    Reinterpret cast as a FixedPoint.

    Note

    value not guaranteed to be preserved: for example, an UInt of width 3 and value 7 (0b111) would become a FixedInt with value -1, the interpretation of the number is also affected by the specified binary point. Caution advised

  19. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  20. final macro def asSInt(): SInt

    Permalink

    Reinterpret cast to a SInt.

    Reinterpret cast to a SInt.

    Note

    value not guaranteed to be preserved: for example, an UInt of width 3 and value 7 (0b111) would become a SInt with value -1

  21. macro def asTypeOf[T <: Data](that: T): T

    Permalink

    Does a reinterpret cast of the bits in this node into the format that provides.

    Does a reinterpret cast of the bits in this node into the format that provides. Returns a new Wire of that type. Does not modify existing nodes.

    x.asTypeOf(that) performs the inverse operation of x = that.toBits.

    Definition Classes
    Data
    Note

    that should have known widths

    ,

    bit widths are NOT checked, may pad or drop bits from input

  22. final macro def asUInt(): UInt

    Permalink

    Reinterpret cast to UInt.

    Reinterpret cast to UInt.

    Definition Classes
    Data
    Note

    Aggregates are recursively packed with the first element appearing in the least-significant bits of the result.

    ,

    value not guaranteed to be preserved: for example, a SInt of width 3 and value -1 (0b111) would become an UInt with value 7

  23. def chiselCloneType(implicit compileOptions: CompileOptions): Bits.this.type

    Permalink

    chiselCloneType is called at the top-level of a clone chain.

    chiselCloneType is called at the top-level of a clone chain. It calls the client's cloneType() method to construct a basic copy of the object being cloned, then performs any fixups required to reconstruct the appropriate core state of the cloned object.

    returns

    a copy of the object with appropriate core state.

    Definition Classes
    Data
  24. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. def cloneType: Bits.this.type

    Permalink

    cloneType must be defined for any Chisel object extending Data.

    cloneType must be defined for any Chisel object extending Data. It is responsible for constructing a basic copy of the object being cloned. If cloneType needs to recursively clone elements of an object, it should call the cloneType methods on those elements.

    returns

    a copy of the object.

    Definition Classes
    BitsData
  26. def dir: Direction

    Permalink

    Return the binding for some bits.

    Return the binding for some bits.

    Definition Classes
    Element
  27. def do_##(that: Bits)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): UInt

    Permalink
  28. final def do_apply(x: BigInt, y: BigInt)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): UInt

    Permalink
  29. final def do_apply(x: Int, y: Int)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): UInt

    Permalink
  30. final def do_apply(x: UInt)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool

    Permalink
  31. final def do_apply(x: Int)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool

    Permalink
  32. final def do_apply(x: BigInt)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool

    Permalink
  33. def do_asBits(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bits

    Permalink
  34. def do_asFixedPoint(that: BinaryPoint)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): FixedPoint

    Permalink
  35. def do_asTypeOf[T <: Data](that: T)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): T

    Permalink
    Definition Classes
    Data
  36. def do_head(n: Int)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): UInt

    Permalink
  37. def do_pad(that: Int)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bits.this.type

    Permalink
  38. def do_tail(n: Int)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): UInt

    Permalink
  39. def do_toBool(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool

    Permalink
  40. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  41. def equals(that: Any): Boolean

    Permalink
    Definition Classes
    HasId → AnyRef → Any
  42. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  43. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  44. final def getWidth: Int

    Permalink

    Returns the width, in bits, if currently known.

    Returns the width, in bits, if currently known.

    Definition Classes
    Data
    Exceptions thrown

    java.util.NoSuchElementException if the width is not known.

  45. def hashCode(): Int

    Permalink
    Definition Classes
    HasId → AnyRef → Any
  46. final macro def head(n: Int): UInt

    Permalink
  47. def instanceName: String

    Permalink
    Definition Classes
    HasId → InstanceId
  48. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  49. def isLit(): Boolean

    Permalink
    Definition Classes
    Data
  50. final def isWidthKnown: Boolean

    Permalink

    Returns whether the width is currently known.

    Returns whether the width is currently known.

    Definition Classes
    Data
  51. val litArg: Option[LitArg]

    Permalink
    Definition Classes
    BitsData
  52. def litValue(): BigInt

    Permalink
    Definition Classes
    Data
  53. def name: String

    Permalink
    Definition Classes
    Element
  54. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  55. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  56. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  57. final macro def pad(that: Int): Bits.this.type

    Permalink

    Returns this wire zero padded up to the specified width.

    Returns this wire zero padded up to the specified width.

    Note

    for SInts only, this does sign extension

  58. def parentModName: String

    Permalink
    Definition Classes
    HasId → InstanceId
  59. def parentPathName: String

    Permalink
    Definition Classes
    HasId → InstanceId
  60. def pathName: String

    Permalink
    Definition Classes
    HasId → InstanceId
  61. def suggestName(name: ⇒ String): Bits.this.type

    Permalink
    Definition Classes
    HasId
  62. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  63. final macro def tail(n: Int): UInt

    Permalink
  64. final macro def toBool(): Bool

    Permalink
  65. def toBools(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Seq[Bool]

    Permalink
  66. final macro def toBools(): Seq[Bool]

    Permalink

    Returns the contents of this wire as a Vec of Bools.

  67. final def toPrintable: Printable

    Permalink

    Default print as Decimal

    Default print as Decimal

    Definition Classes
    BitsData
  68. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  69. final macro def unary_~(): Bits

    Permalink

    Returns this wire bitwise-inverted.

  70. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  71. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  72. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  73. def widthKnown: Boolean

    Permalink
    Definition Classes
    Element
  74. final def widthOption: Option[Int]

    Permalink

    Returns Some(width) if the width is known, else None.

    Returns Some(width) if the width is known, else None.

    Definition Classes
    Data

Deprecated Value Members

  1. final macro def asBits(): Bits

    Permalink

    Reinterpret cast to Bits.

    Reinterpret cast to Bits.

    Annotations
    @deprecated
    Deprecated

    (Since version chisel3) Use asUInt, which does the same thing but returns a more concrete type

  2. def toBits(implicit compileOptions: CompileOptions): UInt

    Permalink

    Packs the value of this object as plain Bits.

    Packs the value of this object as plain Bits.

    This performs the inverse operation of fromBits(Bits).

    Definition Classes
    Data
    Annotations
    @deprecated
    Deprecated

    (Since version chisel3) Best alternative, .asUInt()

  3. final def toSInt(implicit compileOptions: CompileOptions): SInt

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version chisel3) Use asSInt, which makes the reinterpret cast more explicit

  4. final def toUInt(implicit compileOptions: CompileOptions): UInt

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version chisel3) Use asUInt, which makes the reinterpret cast more explicit

Inherited from Element

Inherited from Data

Inherited from HasId

Inherited from InstanceId

Inherited from AnyRef

Inherited from Any

Ungrouped