Class/Object

chisel3.core

FixedPoint

Related Docs: object FixedPoint | package core

Permalink

sealed class FixedPoint extends Bits with Num[FixedPoint]

A sealed class representing a fixed point number that has a bit width and a binary point The width and binary point may be inferred.

IMPORTANT: The API provided here is experimental and may change in the future.

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

Value Members

  1. final macro def !=(that: FixedPoint): Bool

    Permalink
  2. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  3. 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.

    Definition Classes
    Bits
  4. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  5. final macro def %(that: FixedPoint): FixedPoint

    Permalink
    Definition Classes
    Num
  6. final macro def &(that: FixedPoint): FixedPoint

    Permalink
  7. final macro def *(that: SInt): FixedPoint

    Permalink
  8. final macro def *(that: UInt): FixedPoint

    Permalink
  9. final macro def *(that: FixedPoint): FixedPoint

    Permalink

    Outputs the product of this and b.

    Outputs the product of this and b. The resulting width is the sum of the operands.

    Definition Classes
    Num
    Note

    can generate a single-cycle multiplier, which can result in significant cycle time and area costs

  10. final macro def +(that: FixedPoint): FixedPoint

    Permalink

    Outputs the sum of this and b.

    Outputs the sum of this and b. The resulting width is the max of the operands plus 1 (should not overflow).

    Definition Classes
    Num
  11. final macro def +%(that: FixedPoint): FixedPoint

    Permalink

    add (no growth) operator

  12. final macro def +&(that: FixedPoint): FixedPoint

    Permalink

    add (width +1) operator

  13. final macro def -(that: FixedPoint): FixedPoint

    Permalink

    Outputs the difference of this and b.

    Outputs the difference of this and b. The resulting width is the max of the operands plus 1 (should not overflow).

    Definition Classes
    Num
  14. final macro def -%(that: FixedPoint): FixedPoint

    Permalink

    subtract (no growth) operator

  15. final macro def -&(that: FixedPoint): FixedPoint

    Permalink

    subtract (width +1) operator

  16. final macro def /(that: FixedPoint): FixedPoint

    Permalink

    Outputs the quotient of this and b.

    Outputs the quotient of this and b.

    TODO: full rules

    Definition Classes
    Num
  17. final def :=(that: Data)(implicit sourceInfo: SourceInfo, connectionCompileOptions: CompileOptions): Unit

    Permalink
    Definition Classes
    Data
  18. final macro def <(that: FixedPoint): Bool

    Permalink

    Outputs true if this < b.

    Outputs true if this < b.

    Definition Classes
    Num
  19. 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.

    Definition Classes
    Bits
  20. 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.

    Definition Classes
    Bits
  21. final macro def <<(that: BigInt): Bits

    Permalink

    Shift left operation

    Shift left operation

    Definition Classes
    Bits
  22. final macro def <=(that: FixedPoint): Bool

    Permalink

    Outputs true if this <= b.

    Outputs true if this <= b.

    Definition Classes
    Num
  23. final def <>(that: Data)(implicit sourceInfo: SourceInfo, connectionCompileOptions: CompileOptions): Unit

    Permalink
    Definition Classes
    Data
  24. final macro def =/=(that: FixedPoint): Bool

    Permalink
  25. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  26. final macro def ===(that: FixedPoint): Bool

    Permalink
  27. final macro def >(that: FixedPoint): Bool

    Permalink

    Outputs true if this > b.

    Outputs true if this > b.

    Definition Classes
    Num
  28. final macro def >=(that: FixedPoint): Bool

    Permalink

    Outputs true if this >= b.

    Outputs true if this >= b.

    Definition Classes
    Num
  29. 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.

    Definition Classes
    Bits
  30. 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.

    Definition Classes
    Bits
  31. final macro def >>(that: BigInt): Bits

    Permalink

    Shift right operation

    Shift right operation

    Definition Classes
    Bits
  32. final macro def ^(that: FixedPoint): FixedPoint

    Permalink
  33. final macro def abs(): FixedPoint

    Permalink

    Outputs the absolute value of this.

    Outputs the absolute value of this. The resulting width is the unchanged

    Definition Classes
    Num
  34. final macro def apply(x: BigInt, y: BigInt): UInt

    Permalink
    Definition Classes
    Bits
  35. 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.

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

    Permalink

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

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

    Definition Classes
    Bits
  37. 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.

    Definition Classes
    Bits
    Note

    convenience method allowing direct use of Ints without implicits

  38. final macro def apply(x: BigInt): 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.

    Definition Classes
    Bits
  39. final macro def asFixedPoint(that: BinaryPoint): FixedPoint

    Permalink

    Reinterpret cast as a FixedPoint.

    Reinterpret cast as a FixedPoint.

    Definition Classes
    Bits
    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

  40. final def asInstanceOf[T0]: T0

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

    Permalink

    Reinterpret cast to a SInt.

    Reinterpret cast to a SInt.

    Definition Classes
    Bits
    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

  42. 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

  43. 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

  44. val binaryPoint: BinaryPoint

    Permalink

    the position of the binary point with respect to the right most bit of the width currently this should be positive but it is hoped to soon support negative points and thus use this field as a simple exponent

  45. def chiselCloneType(implicit compileOptions: CompileOptions): FixedPoint.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
  46. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. def cloneType: FixedPoint.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
  48. def connect(that: Data)(implicit sourceInfo: SourceInfo, connectCompileOptions: CompileOptions): Unit

    Permalink
    Definition Classes
    FixedPointData
  49. def dir: Direction

    Permalink

    Return the binding for some bits.

    Return the binding for some bits.

    Definition Classes
    Element
  50. def do_!=(that: FixedPoint)(implicit sourceInfo: SourceInfo): Bool

    Permalink
  51. def do_##(that: Bits)(implicit sourceInfo: SourceInfo): UInt

    Permalink
    Definition Classes
    Bits
  52. def do_%(that: FixedPoint)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
    Definition Classes
    FixedPointNum
  53. def do_&(that: FixedPoint)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
  54. def do_*(that: SInt)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
  55. def do_*(that: UInt)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
  56. def do_*(that: FixedPoint)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
    Definition Classes
    FixedPointNum
  57. def do_+(that: FixedPoint)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink

    add (default - no growth) operator

    add (default - no growth) operator

    Definition Classes
    FixedPointNum
  58. def do_+%(that: FixedPoint)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
  59. def do_+&(that: FixedPoint)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
  60. def do_-(that: FixedPoint)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink

    subtract (default - no growth) operator

    subtract (default - no growth) operator

    Definition Classes
    FixedPointNum
  61. def do_-%(that: FixedPoint)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
  62. def do_-&(that: FixedPoint)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
  63. def do_/(that: FixedPoint)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
    Definition Classes
    FixedPointNum
  64. def do_<(that: FixedPoint)(implicit sourceInfo: SourceInfo): Bool

    Permalink
    Definition Classes
    FixedPointNum
  65. def do_<<(that: UInt)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
    Definition Classes
    FixedPointBits
  66. def do_<<(that: BigInt)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
    Definition Classes
    FixedPointBits
  67. def do_<<(that: Int)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
    Definition Classes
    FixedPointBits
  68. def do_<=(that: FixedPoint)(implicit sourceInfo: SourceInfo): Bool

    Permalink
    Definition Classes
    FixedPointNum
  69. def do_=/=(that: FixedPoint)(implicit sourceInfo: SourceInfo): Bool

    Permalink
  70. def do_===(that: FixedPoint)(implicit sourceInfo: SourceInfo): Bool

    Permalink
  71. def do_>(that: FixedPoint)(implicit sourceInfo: SourceInfo): Bool

    Permalink
    Definition Classes
    FixedPointNum
  72. def do_>=(that: FixedPoint)(implicit sourceInfo: SourceInfo): Bool

    Permalink
    Definition Classes
    FixedPointNum
  73. def do_>>(that: UInt)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
    Definition Classes
    FixedPointBits
  74. def do_>>(that: BigInt)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
    Definition Classes
    FixedPointBits
  75. def do_>>(that: Int)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
    Definition Classes
    FixedPointBits
  76. def do_^(that: FixedPoint)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
  77. def do_abs(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
    Definition Classes
    FixedPointNum
  78. final def do_apply(x: BigInt, y: BigInt)(implicit sourceInfo: SourceInfo): UInt

    Permalink
    Definition Classes
    Bits
  79. final def do_apply(x: Int, y: Int)(implicit sourceInfo: SourceInfo): UInt

    Permalink
    Definition Classes
    Bits
  80. final def do_apply(x: UInt)(implicit sourceInfo: SourceInfo): Bool

    Permalink
    Definition Classes
    Bits
  81. final def do_apply(x: Int)(implicit sourceInfo: SourceInfo): Bool

    Permalink
    Definition Classes
    Bits
  82. final def do_apply(x: BigInt)(implicit sourceInfo: SourceInfo): Bool

    Permalink
    Definition Classes
    Bits
  83. def do_asBits(implicit sourceInfo: SourceInfo): Bits

    Permalink
    Definition Classes
    Bits
  84. def do_asFixedPoint(binaryPoint: BinaryPoint)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
    Definition Classes
    FixedPointBits
  85. def do_asSInt(implicit sourceInfo: SourceInfo): SInt

    Permalink
    Definition Classes
    FixedPointBits
  86. def do_asTypeOf[T <: Data](that: T)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): T

    Permalink
    Definition Classes
    Data
  87. def do_asUInt(implicit sourceInfo: SourceInfo): UInt

    Permalink
    Definition Classes
    FixedPointData
  88. def do_head(n: Int)(implicit sourceInfo: SourceInfo): UInt

    Permalink
    Definition Classes
    Bits
  89. def do_max(that: FixedPoint)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
    Definition Classes
    Num
  90. def do_min(that: FixedPoint)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
    Definition Classes
    Num
  91. def do_pad(that: Int)(implicit sourceInfo: SourceInfo): FixedPoint.this.type

    Permalink
    Definition Classes
    Bits
  92. def do_setBinaryPoint(that: Int)(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
  93. def do_tail(n: Int)(implicit sourceInfo: SourceInfo): UInt

    Permalink
    Definition Classes
    Bits
  94. def do_toBool(implicit sourceInfo: SourceInfo): Bool

    Permalink
    Definition Classes
    Bits
  95. def do_unary_~(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink

    Returns this wire bitwise-inverted.

    Returns this wire bitwise-inverted.

    Definition Classes
    FixedPointBits
  96. def do_|(that: FixedPoint)(implicit sourceInfo: SourceInfo): FixedPoint

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

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  100. def fromBits(that: Bits)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): FixedPoint.this.type

    Permalink

    Creates an new instance of this type, unpacking the input Bits into structured data.

    Creates an new instance of this type, unpacking the input Bits into structured data.

    This performs the inverse operation of toBits.

    Definition Classes
    Data
    Note

    what fromBits assigs to must have known widths

    ,

    does NOT check bit widths, may drop bits during assignment

    ,

    does NOT assign to the object this is called on, instead creates and returns a NEW object (useful in a clone-and-assign scenario)

  101. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  102. 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.

  103. def hashCode(): Int

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

    Permalink
    Definition Classes
    Bits
  105. def instanceName: String

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

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

    Permalink
    Definition Classes
    Data
  108. final def isWidthKnown: Boolean

    Permalink

    Returns whether the width is currently known.

    Returns whether the width is currently known.

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

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

    Permalink
    Definition Classes
    Data
  111. final macro def max(that: FixedPoint): FixedPoint

    Permalink

    Outputs the maximum of this and b.

    Outputs the maximum of this and b. The resulting width is the max of the operands.

    Definition Classes
    Num
  112. final macro def min(that: FixedPoint): FixedPoint

    Permalink

    Outputs the minimum of this and b.

    Outputs the minimum of this and b. The resulting width is the max of the operands.

    Definition Classes
    Num
  113. def name: String

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

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

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

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

    Permalink

    Returns this wire zero padded up to the specified width.

    Returns this wire zero padded up to the specified width.

    Definition Classes
    Bits
    Note

    for SInts only, this does sign extension

  118. def parentModName: String

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

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

    Permalink
    Definition Classes
    HasId → InstanceId
  121. final macro def setBinaryPoint(that: Int): FixedPoint

    Permalink
  122. def suggestName(name: ⇒ String): FixedPoint.this.type

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

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

    Permalink
    Definition Classes
    Bits
  125. final macro def toBool(): Bool

    Permalink
    Definition Classes
    Bits
  126. def toBools(implicit sourceInfo: SourceInfo): Seq[Bool]

    Permalink
    Definition Classes
    Bits
  127. final macro def toBools(): Seq[Bool]

    Permalink

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

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

    Definition Classes
    Bits
  128. final def toPrintable: Printable

    Permalink

    Default print as Decimal

    Default print as Decimal

    Definition Classes
    BitsData
  129. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  130. def unary_-(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
  131. final macro def unary_-(): FixedPoint

    Permalink
  132. def unary_-%(implicit sourceInfo: SourceInfo): FixedPoint

    Permalink
  133. final macro def unary_-%(): FixedPoint

    Permalink
  134. final macro def unary_~(): Bits

    Permalink

    Returns this wire bitwise-inverted.

    Returns this wire bitwise-inverted.

    Definition Classes
    Bits
  135. final def wait(): Unit

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

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

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

    Permalink
    Definition Classes
    Element
  139. 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
  140. final macro def |(that: FixedPoint): FixedPoint

    Permalink

Deprecated Value Members

  1. final macro def asBits(): Bits

    Permalink

    Reinterpret cast to Bits.

    Reinterpret cast to Bits.

    Definition Classes
    Bits
    Annotations
    @deprecated
    Deprecated

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

  2. def toBits(): 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(): SInt

    Permalink
    Definition Classes
    Bits
    Annotations
    @deprecated
    Deprecated

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

  4. final def toUInt(): UInt

    Permalink
    Definition Classes
    Bits
    Annotations
    @deprecated
    Deprecated

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

Inherited from Num[FixedPoint]

Inherited from Bits

Inherited from Element

Inherited from Data

Inherited from HasId

Inherited from InstanceId

Inherited from AnyRef

Inherited from Any

Ungrouped