Package

chisel3

core

Permalink

package core

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. core
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. sealed abstract class ActualDirection extends AnyRef

    Permalink

    Resolved directions for both leaf and container nodes, only visible after a node is bound (since higher-level specifications like Input and Output can override directions).

  2. sealed abstract class Aggregate extends Data

    Permalink

    An abstract class for data types that solely consist of (are an aggregate of) other Data objects.

  3. final class Analog extends Element

    Permalink

    Data type for representing bidirectional bitvectors of a given width

    Data type for representing bidirectional bitvectors of a given width

    Analog support is limited to allowing wiring up of Verilog BlackBoxes with bidirectional (inout) pins. There is currently no support for reading or writing of Analog types within Chisel code.

    Given that Analog is bidirectional, it is illegal to assign a direction to any Analog type. It is legal to "flip" the direction (since Analog can be a member of aggregate types) which has no effect.

    Analog types are generally connected using the bidirectional attach mechanism, but also support limited bulkconnect <>. Analog types are only allowed to be bulk connected *once* in a given module. This is to prevent any surprising consequences of last connect semantics.

    Note

    This API is experimental and subject to change

  4. class AutoClonetypeException extends internal.ChiselException

    Permalink
  5. abstract class BaseBlackBox extends BaseModule

    Permalink
  6. abstract class BaseModule extends HasId

    Permalink

    Abstract base class for Modules, an instantiable organizational unit for RTL.

  7. case class Binary(bits: Bits) extends FirrtlFormat with Product with Serializable

    Permalink

    Format bits as Binary

  8. sealed trait Binding extends AnyRef

    Permalink
  9. sealed abstract class BindingDirection extends AnyRef

    Permalink
  10. sealed abstract class Bits extends Element with ToBoolable

    Permalink

    A data type for values represented by a single bitvector.

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

  11. abstract class BlackBox extends BaseBlackBox

    Permalink

    Defines a black box, which is a module that can be referenced from within Chisel, but is not defined in the emitted Verilog.

    Defines a black box, which is a module that can be referenced from within Chisel, but is not defined in the emitted Verilog. Useful for connecting to RTL modules defined outside Chisel.

    Example:
    1. Some design require a differential input clock to clock the all design. With the xilinx FPGA for example, a Verilog template named IBUFDS must be integrated to use differential input:

      IBUFDS #(.DIFF_TERM("TRUE"),
               .IOSTANDARD("DEFAULT")) ibufds (
       .IB(ibufds_IB),
       .I(ibufds_I),
       .O(ibufds_O)
      );

      To instantiate it, a BlackBox can be used like following:

      import chisel3._
      import chisel3.experimental._
      // Example with Xilinx differential buffer IBUFDS
      class IBUFDS extends BlackBox(Map("DIFF_TERM" -> "TRUE", // Verilog parameters
                                        "IOSTANDARD" -> "DEFAULT"
                           )) {
        val io = IO(new Bundle {
          val O = Output(Clock()) // IO names will be the same
          val I = Input(Clock())  // (without 'io_' in prefix)
          val IB = Input(Clock()) //
        })
      }
    Note

    The parameters API is experimental and may change

  12. sealed class Bool extends UInt with Reset

    Permalink

    A data type for booleans, defined as a single bit indicating true or false.

  13. trait BoolFactory extends AnyRef

    Permalink
  14. abstract class Bundle extends Record

    Permalink

    Base class for data types defined as a bundle of other data types.

    Base class for data types defined as a bundle of other data types.

    Usage: extend this class (either as an anonymous or named class) and define members variables of Data subtypes to be elements in the Bundle.

    Example of an anonymous IO bundle

    class MyModule extends Module {
      val io = IO(new Bundle {
        val in = Input(UInt(64.W))
        val out = Output(SInt(128.W))
      })
    }

    Or as a named class

    class Packet extends Bundle {
      val header = UInt(16.W)
      val addr   = UInt(16.W)
      val data   = UInt(32.W)
    }
    class MyModule extends Module {
       val io = IO(new Bundle {
         val inPacket = Input(new Packet)
         val outPacket = Output(new Packet)
       })
       val reg = Reg(new Packet)
       reg <> inPacket
       outPacket <> reg
    }
  15. case class Character(bits: Bits) extends FirrtlFormat with Product with Serializable

    Permalink

    Format bits as Character

  16. case class ChildBinding(parent: Data) extends Binding with Product with Serializable

    Permalink
  17. trait ChiselAnnotation extends AnyRef

    Permalink

    Interface for Annotations in Chisel

    Interface for Annotations in Chisel

    Defines a conversion to a corresponding FIRRTL Annotation

  18. final case class ChiselLegacyAnnotation extends ChiselAnnotation with RunFirrtlTransform with Product with Serializable

    Permalink
  19. sealed class Clock extends Element

    Permalink
  20. trait CompileOptions extends AnyRef

    Permalink
  21. sealed trait ConstrainedBinding extends TopBinding

    Permalink
  22. abstract class Data extends HasId with NamedComponent

    Permalink

    This forms the root of the type system for wire data types.

    This forms the root of the type system for wire data types. The data value must be representable as some number (need not be known at Chisel compile time) of bits, and must have methods to pack / unpack structured data to / from bits.

  23. case class Decimal(bits: Bits) extends FirrtlFormat with Product with Serializable

    Permalink

    Format bits as Decimal

  24. case class DontCareBinding() extends UnconstrainedBinding with Product with Serializable

    Permalink
  25. case class DoubleParam(value: Double) extends Param with Product with Serializable

    Permalink
  26. abstract class Element extends Data

    Permalink

    Element is a leaf data type: it cannot contain other Data objects.

    Element is a leaf data type: it cannot contain other Data objects. Example uses are for representing primitive data types, like integers and bits.

  27. abstract class ExtModule extends BaseBlackBox

    Permalink

    Defines a black box, which is a module that can be referenced from within Chisel, but is not defined in the emitted Verilog.

    Defines a black box, which is a module that can be referenced from within Chisel, but is not defined in the emitted Verilog. Useful for connecting to RTL modules defined outside Chisel.

    A variant of BlackBox, this has a more consistent naming scheme in allowing multiple top-level IO and does not drop the top prefix.

    Example:
    1. Some design require a differential input clock to clock the all design. With the xilinx FPGA for example, a Verilog template named IBUFDS must be integrated to use differential input:

      IBUFDS #(.DIFF_TERM("TRUE"),
               .IOSTANDARD("DEFAULT")) ibufds (
       .IB(ibufds_IB),
       .I(ibufds_I),
       .O(ibufds_O)
      );

      To instantiate it, a BlackBox can be used like following:

      import chisel3._
      import chisel3.experimental._
      // Example with Xilinx differential buffer IBUFDS
      class IBUFDS extends ExtModule(Map("DIFF_TERM" -> "TRUE", // Verilog parameters
                                         "IOSTANDARD" -> "DEFAULT"
                           )) {
        val O = IO(Output(Clock()))
        val I = IO(Input(Clock()))
        val IB = IO(Input(Clock()))
      }
    Note

    The parameters API is experimental and may change

  28. sealed abstract class FirrtlFormat extends Printable

    Permalink

    Superclass for Firrtl format specifiers for Bits

  29. sealed class FixedPoint extends Bits with Num[FixedPoint]

    Permalink

    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.

    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.

  30. case class FullName(data: Data) extends Printable with Product with Serializable

    Permalink

    Put full name within parent namespace (eg.

    Put full name within parent namespace (eg. bundleName.field)

  31. case class Hexadecimal(bits: Bits) extends FirrtlFormat with Product with Serializable

    Permalink

    Format bits as Hexidecimal

  32. trait IgnoreSeqInBundle extends AnyRef

    Permalink

    Mix-in for Bundles that have arbitrary Seqs of Chisel types that aren't involved in hardware construction.

    Mix-in for Bundles that have arbitrary Seqs of Chisel types that aren't involved in hardware construction.

    Used to avoid raising an error/exception when a Seq is a public member of the bundle. This is useful if we those public Seq fields in the Bundle are unrelated to hardware construction.

  33. abstract class ImplicitModule extends UserModule

    Permalink

    Abstract base class for Modules, which behave much like Verilog modules.

    Abstract base class for Modules, which behave much like Verilog modules. These may contain both logic and state which are written in the Module body (constructor).

    Note

    Module instantiations must be wrapped in a Module() call.

  34. case class IntParam(value: BigInt) extends Param with Product with Serializable

    Permalink
  35. abstract class LegacyModule extends ImplicitModule

    Permalink

    Legacy Module class that restricts IOs to just io, clock, and reset, and provides a constructor for threading through explicit clock and reset.

    Legacy Module class that restricts IOs to just io, clock, and reset, and provides a constructor for threading through explicit clock and reset.

    While this class isn't planned to be removed anytime soon (there are benefits to restricting IO), the clock and reset constructors will be phased out. Recommendation is to wrap the module in a withClock/withReset/withClockAndReset block, or directly hook up clock or reset IO pins.

  36. case class LitBinding() extends UnconstrainedBinding with ReadOnlyBinding with Product with Serializable

    Permalink
  37. sealed class Mem[T <: Data] extends MemBase[T]

    Permalink

    A combinational/asynchronous-read, sequential/synchronous-write memory.

    A combinational/asynchronous-read, sequential/synchronous-write memory.

    Writes take effect on the rising clock edge after the request. Reads are combinational (requests will return data on the same cycle). Read-after-write hazards are not an issue.

    Note

    when multiple conflicting writes are performed on a Mem element, the result is undefined (unlike Vec, where the last assignment wins)

  38. sealed abstract class MemBase[T <: Data] extends HasId with NamedComponent

    Permalink
  39. case class MemoryPortBinding(enclosure: UserModule) extends ConstrainedBinding with Product with Serializable

    Permalink
  40. case class Name(data: Data) extends Printable with Product with Serializable

    Permalink

    Put innermost name (eg.

    Put innermost name (eg. field of bundle)

  41. trait Num[T <: Data] extends AnyRef

    Permalink

    Abstract trait defining operations available on numeric-like wire data types.

  42. case class OpBinding(enclosure: UserModule) extends ConstrainedBinding with ReadOnlyBinding with Product with Serializable

    Permalink
  43. case class PString(str: String) extends Printable with Product with Serializable

    Permalink

    Wrapper for printing Scala Strings

  44. sealed abstract class Param extends AnyRef

    Permalink

    Parameters for BlackBoxes

  45. case class PortBinding(enclosure: BaseModule) extends ConstrainedBinding with Product with Serializable

    Permalink
  46. sealed abstract class Printable extends AnyRef

    Permalink

    Superclass of things that can be printed in the resulting circuit

    Superclass of things that can be printed in the resulting circuit

    Usually created using the custom string interpolator p"...". Printable string interpolation is similar to String interpolation in Scala For example:

    printf(p"The value of wire = $wire\n")

    This is equivalent to writing:

    printf(p"The value of wire = %d\n", wire)

    All Chisel data types have a method .toPrintable that gives a default pretty print that can be accessed via p"...". This works even for aggregate types, for example:

    val myVec = VecInit(5.U, 10.U, 13.U)
    printf(p"myVec = $myVec\n")
    // myVec = Vec(5, 10, 13)
    
    val myBundle = Wire(new Bundle {
      val foo = UInt()
      val bar = UInt()
    })
    myBundle.foo := 3.U
    myBundle.bar := 11.U
    printf(p"myBundle = $myBundle\n")
    // myBundle = Bundle(a -> 3, b -> 11)

    Users can override the default behavior of .toPrintable in custom Bundle and Record types.

  47. case class Printables(pables: Iterable[Printable]) extends Printable with Product with Serializable

    Permalink
  48. sealed trait PrivateType extends AnyRef

    Permalink

    Use PrivateObject to force users to specify width and binaryPoint by name

  49. case class RawParam(value: String) extends Param with Product with Serializable

    Permalink

    Unquoted String

  50. sealed trait ReadOnlyBinding extends TopBinding

    Permalink
  51. abstract class Record extends Aggregate

    Permalink

    Base class for Aggregates based on key values pairs of String and Data

    Base class for Aggregates based on key values pairs of String and Data

    Record should only be extended by libraries and fairly sophisticated generators. RTL writers should use Bundle. See Record#elements for an example.

  52. case class RegBinding(enclosure: UserModule) extends ConstrainedBinding with Product with Serializable

    Permalink
  53. sealed trait Reset extends Element with ToBoolable

    Permalink
  54. trait RunFirrtlTransform extends ChiselAnnotation

    Permalink

    Mixin for ChiselAnnotation that instantiates an associated FIRRTL Transform when this Annotation is present during a run of chisel3.Driver.execute.

    Mixin for ChiselAnnotation that instantiates an associated FIRRTL Transform when this Annotation is present during a run of chisel3.Driver.execute. Automatic Transform instantiation is *not* supported when the Circuit and Annotations are serialized before invoking FIRRTL.

  55. sealed class SInt extends Bits with Num[SInt]

    Permalink
  56. trait SIntFactory extends AnyRef

    Permalink
  57. sealed abstract class SpecifiedDirection extends AnyRef

    Permalink

    User-specified directions.

  58. case class StringParam(value: String) extends Param with Product with Serializable

    Permalink
  59. sealed class SyncReadMem[T <: Data] extends MemBase[T]

    Permalink

    A sequential/synchronous-read, sequential/synchronous-write memory.

    A sequential/synchronous-read, sequential/synchronous-write memory.

    Writes take effect on the rising clock edge after the request. Reads return data on the rising edge after the request. Read-after-write behavior (when a read and write to the same address are requested on the same cycle) is undefined.

    Note

    when multiple conflicting writes are performed on a Mem element, the result is undefined (unlike Vec, where the last assignment wins)

  60. sealed trait TopBinding extends Binding

    Permalink
  61. sealed class UInt extends Bits with Num[UInt]

    Permalink

    A data type for unsigned integers, represented as a binary bitvector.

    A data type for unsigned integers, represented as a binary bitvector. Defines arithmetic operations between other integer types.

  62. trait UIntFactory extends AnyRef

    Permalink
  63. sealed trait UnconstrainedBinding extends TopBinding

    Permalink
  64. abstract class UserModule extends BaseModule

    Permalink

    Abstract base class for Modules that contain Chisel RTL.

  65. sealed class Vec[T <: Data] extends Aggregate with VecLike[T]

    Permalink

    A vector (array) of Data elements.

    A vector (array) of Data elements. Provides hardware versions of various collection transformation functions found in software array implementations.

    Careful consideration should be given over the use of Vec vs Seq or some other Scala collection. In general Vec only needs to be used when there is a need to express the hardware collection in a Reg or IO Bundle or when access to elements of the array is indexed via a hardware signal.

    Example of indexing into a Vec using a hardware address and where the Vec is defined in an IO Bundle

    val io = IO(new Bundle {
      val in = Input(Vec(20, UInt(16.W)))
      val addr = UInt(5.W)
      val out = Output(UInt(16.W))
    })
    io.out := io.in(io.addr)
    T

    type of elements

    Note

    • when multiple conflicting assignments are performed on a Vec element, the last one takes effect (unlike Mem, where the result is undefined)
    • Vecs, unlike classes in Scala's collection library, are propagated intact to FIRRTL as a vector type, which may make debugging easier
  66. trait VecFactory extends AnyRef

    Permalink
  67. trait VecLike[T <: Data] extends IndexedSeq[T] with HasId

    Permalink

    A trait for Vecs containing common hardware generators for collection operations.

  68. final class WhenContext extends AnyRef

    Permalink

    A WhenContext may represent a when, and elsewhen, or an otherwise.

    A WhenContext may represent a when, and elsewhen, or an otherwise. Since FIRRTL does not have an "elsif" statement, alternatives must be mapped to nested if-else statements inside the alternatives of the preceeding condition. In order to emit proper FIRRTL, it is necessary to keep track of the depth of nesting of the FIRRTL whens. Due to the "thin frontend" nature of Chisel3, it is not possible to know if a when or elsewhen has a succeeding elsewhen or otherwise; therefore, this information is added by preprocessing the command queue.

  69. case class WireBinding(enclosure: UserModule) extends ConstrainedBinding with Product with Serializable

    Permalink
  70. trait WireFactory extends AnyRef

    Permalink
  71. implicit class fromBigIntToLiteral extends AnyRef

    Permalink

    These implicit classes allow one to convert scala.Int|scala.BigInt to Chisel.UInt|Chisel.SInt by calling .asUInt|.asSInt on them, respectively.

    These implicit classes allow one to convert scala.Int|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.

    Implementation note: the empty parameter list (like U()) is necessary to prevent interpreting calls that have a non-Width parameter as a chained apply, otherwise things like 0.asUInt(16) (instead of 16.W) compile without error and produce undesired results.

  72. implicit class fromBooleanToLiteral extends AnyRef

    Permalink
  73. implicit class fromDoubleToLiteral extends AnyRef

    Permalink
  74. implicit class fromIntToBinaryPoint extends AnyRef

    Permalink
  75. implicit class fromIntToLiteral extends fromBigIntToLiteral

    Permalink
  76. implicit class fromIntToWidth extends AnyRef

    Permalink
  77. implicit class fromLongToLiteral extends fromBigIntToLiteral

    Permalink
  78. implicit class fromStringToLiteral extends AnyRef

    Permalink

Value Members

  1. object ActualDirection

    Permalink
  2. object Analog

    Permalink

    Object that provides factory methods for Analog objects

    Object that provides factory methods for Analog objects

    Note

    This API is experimental and subject to change

  3. object BiConnect

    Permalink

    BiConnect.connect executes a bidirectional connection element-wise.

    BiConnect.connect executes a bidirectional connection element-wise.

    Note that the arguments are left and right (not source and sink) so the intent is for the operation to be commutative.

    The connect operation will recurse down the left Data (with the right Data). An exception will be thrown if a movement through the left cannot be matched in the right (or if the right side has extra fields).

    See elemConnect for details on how the root connections are issued.

  4. object Binding

    Permalink
  5. object BindingDirection

    Permalink
  6. object Bits extends UIntFactory

    Permalink
  7. object Bool extends BoolFactory

    Permalink
  8. object ChiselAnnotation

    Permalink
  9. object Clock

    Permalink
  10. object CompileOptions

    Permalink
  11. object DataMirror

    Permalink

    Experimental hardware construction reflection API

  12. object DontCare extends Element

    Permalink

    RHS (source) for Invalidate API.

    RHS (source) for Invalidate API. Causes connection logic to emit a DefInvalid when connected to an output port (or wire).

  13. object ExplicitCompileOptions

    Permalink
  14. object FirrtlFormat

    Permalink
  15. object FixedPoint

    Permalink

    Factory and convenience methods for the FixedPoint class IMPORTANT: The API provided here is experimental and may change in the future.

  16. object Flipped

    Permalink
  17. object Input

    Permalink

    Input, Output, and Flipped are used to define the directions of Module IOs.

    Input, Output, and Flipped are used to define the directions of Module IOs.

    Note that they currently clone their source argument, including its bindings.

    Thus, an error will be thrown if these are used on bound Data

  18. object Mem

    Permalink
  19. object Module

    Permalink
  20. object MonoConnect

    Permalink

    MonoConnect.connect executes a mono-directional connection element-wise.

    MonoConnect.connect executes a mono-directional connection element-wise.

    Note that this isn't commutative. There is an explicit source and sink already determined before this function is called.

    The connect operation will recurse down the left Data (with the right Data). An exception will be thrown if a movement through the left cannot be matched in the right. The right side is allowed to have extra Record fields. Vecs must still be exactly the same size.

    See elemConnect for details on how the root connections are issued.

    Note that a valid sink must be writable so, one of these must hold: - Is an internal writable node (Reg or Wire) - Is an output of the current module - Is an input of a submodule of the current module

    Note that a valid source must be readable so, one of these must hold: - Is an internal readable node (Reg, Wire, Op) - Is a literal - Is a port of the current module or submodule of the current module

  21. object Mux

    Permalink
  22. object Output

    Permalink
  23. object Percent extends Printable with Product with Serializable

    Permalink

    Represents escaped percents

  24. object Printable

    Permalink
  25. object Reg

    Permalink
  26. object RegInit

    Permalink
  27. object RegNext

    Permalink
  28. object SInt extends SIntFactory

    Permalink
  29. object SpecifiedDirection

    Permalink
  30. object SyncReadMem

    Permalink
  31. object UInt extends UIntFactory

    Permalink
  32. object Vec extends VecFactory

    Permalink
  33. object VecInit

    Permalink
  34. object Wire extends WireFactory

    Permalink
  35. object WireInit

    Permalink
  36. object annotate

    Permalink
  37. object assert

    Permalink
  38. object attach

    Permalink
  39. object chiselTypeOf

    Permalink

    Returns the chisel type of a hardware object, allowing other hardware to be constructed from it.

  40. object debug

    Permalink
  41. object dontTouch

    Permalink

    Marks that a signal should not be removed by Chisel and Firrtl optimization passes

    Marks that a signal should not be removed by Chisel and Firrtl optimization passes

    Example:
    1. class MyModule extends Module {
        val io = IO(new Bundle {
          val a = Input(UInt(32.W))
          val b = Output(UInt(32.W))
        })
        io.b := io.a
        val dead = io.a +% 1.U // normally dead would be pruned by DCE
        dontTouch(dead) // Marking it as such will preserve it
      }
    Note

    Calling this on Data creates an annotation that Chisel emits to a separate annotations file. This file must be passed to FIRRTL independently of the .fir file. The execute methods in chisel3.Driver will pass the annotations to FIRRTL automatically.

  42. object printf

    Permalink

    Prints a message in simulation

    Prints a message in simulation

    See apply methods for use

  43. object requireIsChiselType

    Permalink

    Requires that a node is a chisel type (not hardware, "unbound")

  44. object requireIsHardware

    Permalink

    Requires that a node is hardware ("bound")

  45. object stop

    Permalink
  46. object when

    Permalink
  47. object withClock

    Permalink
  48. object withClockAndReset

    Permalink
  49. object withReset

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped