Package

chisel3

core

Permalink

package core

Linear Supertypes
AnyRef, Any
Content Hierarchy Learn more about scaladoc diagrams
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 Aggregate extends Data

    Permalink

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

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

  3. abstract class BaseBlackBox extends BaseModule

    Permalink
  4. abstract class BaseModule extends HasId

    Permalink

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

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

    Permalink

    Format bits as Binary

  6. sealed trait Binder[Out <: Binding] extends (UnboundBinding) ⇒ Out

    Permalink

    A Binder is a function from UnboundBinding to some Binding.

    A Binder is a function from UnboundBinding to some Binding.

    These are used exclusively by Binding.bind and sealed in order to keep all of them in one place. There are two flavors of Binders: Non-terminal (returns another UnboundBinding): These are used to reformat an UnboundBinding (like setting direction) before it is terminally bound. Terminal (returns any other Binding): Due to the nature of Bindings, once a Data is bound to anything but an UnboundBinding, it is forever locked to being that type (as it now represents something in the hardware graph).

    Note that some Binders require extra arguments to be constructed, like the enclosing Module.

  7. sealed trait Binding extends AnyRef

    Permalink
  8. sealed abstract class Bits extends Element

    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.

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

  10. sealed class Bool extends UInt

    Permalink

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

  11. trait BoolFactory extends AnyRef

    Permalink
  12. 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
    }
  13. case class Character(bits: Bits) extends FirrtlFormat with Product with Serializable

    Permalink

    Format bits as Character

  14. case class ChiselAnnotation(component: InstanceId, transformClass: Class[_ <: Transform], value: String) extends Product with Serializable

    Permalink

    This is a stand-in for the firrtl.Annotations.Annotation because at the time this annotation is created the component cannot be resolved, into a targetString.

    This is a stand-in for the firrtl.Annotations.Annotation because at the time this annotation is created the component cannot be resolved, into a targetString. Resolution can only happen after the circuit is elaborated

    component

    A chisel thingy to be annotated, could be module, wire, reg, etc.

    transformClass

    A fully-qualified class name of the transformation pass

    value

    A string value to be used by the transformation pass

  15. sealed class Clock extends Element

    Permalink
  16. trait CompileOptions extends AnyRef

    Permalink
  17. sealed trait ConstrainedBinding extends Binding

    Permalink
  18. abstract class Data extends HasId

    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.

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

    Permalink

    Format bits as Decimal

  20. sealed abstract class Direction extends AnyRef

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

    Permalink
  22. 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.

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

  24. sealed abstract class FirrtlFormat extends Printable

    Permalink

    Superclass for Firrtl format specifiers for Bits

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

  26. 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)

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

    Permalink

    Format bits as Hexidecimal

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

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

    Permalink
  30. 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.

  31. case class LitBinding() extends SynthesizableBinding with UnconstrainedBinding with UndirectionedBinding with Product with Serializable

    Permalink
  32. 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)

  33. sealed abstract class MemBase[T <: Data] extends HasId

    Permalink
  34. case class MemoryPortBinder(enclosure: UserModule) extends Binder[MemoryPortBinding] with Product with Serializable

    Permalink
  35. case class MemoryPortBinding(enclosure: UserModule) extends SynthesizableBinding with ConstrainedBinding with UndirectionedBinding with Product with Serializable

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

    Permalink

    Put innermost name (eg.

    Put innermost name (eg. field of bundle)

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

    Permalink

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

  38. case class OpBinder(enclosure: UserModule) extends Binder[OpBinding] with Product with Serializable

    Permalink
  39. case class OpBinding(enclosure: UserModule) extends SynthesizableBinding with ConstrainedBinding with UndirectionedBinding with Product with Serializable

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

    Permalink

    Wrapper for printing Scala Strings

  41. sealed abstract class Param extends AnyRef

    Permalink

    Parameters for BlackBoxes

  42. case class PortBinder(enclosure: BaseModule) extends Binder[PortBinding] with Product with Serializable

    Permalink
  43. case class PortBinding(enclosure: BaseModule, direction: Option[Direction]) extends SynthesizableBinding with ConstrainedBinding with Product with Serializable

    Permalink
  44. 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"..." TODO Add support for names of Modules Currently impossible because unpack is called before the name is selected Could be implemented by adding a new format specifier to Firrtl (eg. %m) TODO Should we provide more functions like map and mkPrintable?

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

    Permalink
  46. sealed trait PrivateType extends AnyRef

    Permalink

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

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

    Permalink

    Unquoted String

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

  49. case class RegBinder(enclosure: UserModule) extends Binder[RegBinding] with Product with Serializable

    Permalink
  50. case class RegBinding(enclosure: UserModule) extends SynthesizableBinding with ConstrainedBinding with UndirectionedBinding with Product with Serializable

    Permalink
  51. sealed class SInt extends Bits with Num[SInt]

    Permalink
  52. trait SIntFactory extends AnyRef

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

    Permalink
  54. 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)

  55. sealed trait SynthesizableBinding extends Binding

    Permalink
  56. 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.

  57. trait UIntFactory extends AnyRef

    Permalink
  58. case class UnboundBinding(direction: Option[Direction]) extends Binding with UnconstrainedBinding with Product with Serializable

    Permalink
  59. sealed trait UnconstrainedBinding extends Binding

    Permalink
  60. sealed trait UndirectionedBinding extends Binding

    Permalink
  61. abstract class UserModule extends BaseModule

    Permalink

    Abstract base class for Modules that contain Chisel RTL.

  62. 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
  63. trait VecLike[T <: Data] extends IndexedSeq[T] with HasId

    Permalink

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

  64. final class WhenContext extends AnyRef

    Permalink

    Internal mechanism for generating a when.

    Internal mechanism for generating a when. Because of the way FIRRTL commands are emitted, generating a FIRRTL elsewhen or nested whens inside elses would be difficult. Instead, this keeps track of the negative of the previous conditions, so when an elsewhen or otherwise is used, it checks that both the condition is true and all the previous conditions have been false.

  65. case class WireBinder(enclosure: UserModule) extends Binder[WireBinding] with Product with Serializable

    Permalink
  66. case class WireBinding(enclosure: UserModule) extends SynthesizableBinding with ConstrainedBinding with UndirectionedBinding with Product with Serializable

    Permalink
  67. 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.

  68. implicit class fromBooleanToLiteral extends AnyRef

    Permalink
  69. implicit class fromDoubleToLiteral extends AnyRef

    Permalink
  70. implicit class fromIntToBinaryPoint extends AnyRef

    Permalink
  71. implicit class fromIntToLiteral extends fromBigIntToLiteral

    Permalink
  72. implicit class fromIntToWidth extends AnyRef

    Permalink
  73. implicit class fromLongToLiteral extends fromBigIntToLiteral

    Permalink
  74. implicit class fromStringToLiteral extends AnyRef

    Permalink

Value Members

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

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

  3. object Binding

    Permalink

    The purpose of a Binding is to indicate what type of hardware 'entity' a specific Data's leaf Elements is actually bound to.

    The purpose of a Binding is to indicate what type of hardware 'entity' a specific Data's leaf Elements is actually bound to. All Data starts as being Unbound (and the whole point of cloneType is to return an unbound version). Then, specific API calls take a Data, and return a bound version (either by binding the original model or cloneType then binding the clone). For example, Reg[T<:Data](...) returns a T bound to RegBinding.

    It is considered invariant that all Elements of a single Data are bound to the same concrete type of Binding.

    These bindings can be checked (e.g. checkSynthesizable) to make sure certain operations are valid. For example, arithemetic operations or connections can only be executed between synthesizable nodes. These checks are to avoid undefined reference errors.

    Bindings can carry information about the particular element in the graph it represents like: - For ports (and unbound), the 'direction' - For (relevant) synthesizable nodes, the enclosing Module

    TODO(twigg): Enrich the bindings to carry more information like the hosting module (when applicable), direction (when applicable), literal info (when applicable). Can ensure applicable data only stored on relevant nodes. e.g. literal info on LitBinding, direction info on UnboundBinding and PortBinding, etc.

    TODO(twigg): Currently, bindings only apply at the Element level and an Aggregate is considered bound via its elements. May be appropriate to allow Aggregates to be bound along with the Elements. However, certain literal and port direction information doesn't quite make sense in aggregates. This would elegantly handle the empty Vec or Record problem though.

    TODO(twigg): Binding is currently done via allElements. It may be more elegant if this was instead done as a more explicit tree walk as that allows for better errors.

  4. object Bits extends UIntFactory

    Permalink
  5. object Bool extends BoolFactory

    Permalink
  6. object Clock

    Permalink
  7. object CompileOptions

    Permalink
  8. object Data

    Permalink
  9. object DataMirror

    Permalink
  10. object Direction

    Permalink
  11. object ExplicitCompileOptions

    Permalink
  12. object FirrtlFormat

    Permalink
  13. object FixedPoint

    Permalink

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

  14. object Flipped

    Permalink
  15. object FlippedBinder extends Binder[UnboundBinding] with Product with Serializable

    Permalink
  16. 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

  17. object InputBinder extends Binder[UnboundBinding] with Product with Serializable

    Permalink
  18. object LitBinder extends Binder[LitBinding] with Product with Serializable

    Permalink
  19. object Mem

    Permalink
  20. object Module

    Permalink
  21. 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

  22. object Mux

    Permalink
  23. object NoDirectionBinder extends Binder[UnboundBinding] with Product with Serializable

    Permalink
  24. object Output

    Permalink
  25. object OutputBinder extends Binder[UnboundBinding] with Product with Serializable

    Permalink
  26. object Percent extends Printable with Product with Serializable

    Permalink

    Represents escaped percents

  27. object Printable

    Permalink
  28. object Reg

    Permalink
  29. object RegInit

    Permalink
  30. object RegNext

    Permalink
  31. object SInt extends SIntFactory

    Permalink
  32. object SyncReadMem

    Permalink
  33. object SynthesizableBinding

    Permalink
  34. object UInt extends UIntFactory

    Permalink
  35. object Vec

    Permalink
  36. object Wire

    Permalink
  37. object assert

    Permalink
  38. object attach

    Permalink
  39. object printf

    Permalink
  40. object stop

    Permalink
  41. object when

    Permalink
  42. object withClock

    Permalink
  43. object withClockAndReset

    Permalink
  44. object withReset

    Permalink

Deprecated Value Members

  1. object debug

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version chisel3) debug doesn't do anything in Chisel3 as no pruning happens in the frontend

Inherited from AnyRef

Inherited from Any

Ungrouped