chisel6.4.0 < Back


# Packages

-  package root
  Definition Classes
    root
-  package chisel3

  This package contains the main chisel3 API.

  This package contains the main chisel3 API.

  Definition Classes
    root
-  package aop
  Definition Classes
    chisel3
-  package choice

  This package contains Chisel language definitions for describing configuration options and their accepted values.

  This package contains Chisel language definitions for describing configuration options and their accepted values.

  Definition Classes
    chisel3
-  package connectable
  Definition Classes
    chisel3
-  package experimental

  Package for experimental features, which may have their API changed, be removed, etc.

  Package for experimental features, which may have their API changed, be removed, etc.

  Because its contents won't necessarily have the same level of stability and support as non-experimental, you must explicitly import this package to use its contents.

  Definition Classes
    chisel3
-  package interface
  Definition Classes
    chisel3
-  package ltl
  Definition Classes
    chisel3
-  package naming
  Definition Classes
    chisel3
-  package probe
  Definition Classes
    chisel3
-  package properties

  The properties package includes functionality related to non-hardware data.

  The properties package includes functionality related to non-hardware data.

  This entire package is currently very experimental, so expect some rough edges and rapid API evolution.

  Definition Classes
    chisel3
-  package reflect
  Definition Classes
    chisel3
-  package simulator
  Definition Classes
    chisel3
-  package stage
  Definition Classes
    chisel3
-  package std
  Definition Classes
    chisel3
-  package testers

  The testers package provides the basic interface for chisel testers.

  The testers package provides the basic interface for chisel testers.

  Definition Classes
    chisel3
-  package util

  The util package provides extensions to core chisel for common hardware components and utility functions

  The util package provides extensions to core chisel for common hardware components and utility functions

  Definition Classes
    chisel3
- ActualDirection
- Aggregate
- AliasedAggregateFieldException
- AsyncReset
- AutoClonetypeException
- BiConnectException
- Binary
- BindingException
- Bits
- Bits
- BlackBox
- Bool
- Bool
- BoolFactory
- BuildInfo
- Bundle
- Character
- ChiselEnum
- ChiselException
- Clock
- Const
- Data
- Decimal
- Disable
- DontCare
- Element
- EnumType
- ExpectedAnnotatableException
- ExpectedChiselTypeException
- ExpectedHardwareException
- FirrtlFormat
- FixedIOBaseModule
- FixedIOExtModule
- FixedIORawModule
- FlatIO
- Flipped
- FullName
- HasTarget
- Hexadecimal
- IO
- IgnoreSeqInBundle
- ImplicitClock
- ImplicitReset
- Input
- InstanceId
- InternalErrorException
- KnownWidth
- Mem
- MemBase
- MixedDirectionAggregateException
- Module
- ModuleAspect
- MonoConnectException
- Mux
- Name
- Num
- NumObject
- Output
- PString
- Percent
- Printable
- PrintableHelper
- Printables
- RawModule
- RebindingException
- Record
- Reg
- RegInit
- RegNext
- RequireAsyncReset
- RequireSyncReset
- Reset
- ResetType
- SInt
- SInt
- SIntFactory
- SourceInfoDoc
- SpecifiedDirection
- SyncReadMem
- UInt
- UInt
- UIntFactory
- UnknownWidth
- Vec
- Vec
- VecFactory
- VecInit
- VecLike
- VerifPrintMacrosDoc
- VerificationStatement
- WhenContext
- Width
- Wire
- WireDefault
- WireFactory
- WireInit
- assert
- assume
- chiselTypeOf
- cover
- dontTouch
- emitVerilog
- fromBigIntToLiteral
- fromBooleanToLiteral
- fromIntToLiteral
- fromIntToWidth
- fromLongToLiteral
- fromStringToLiteral
- getVerilogString
- layer
- printf
- stop
- suppressEnumCastWarning
- when
- withClock
- withClockAndReset
- withDisable
- withReset
- withoutIO

o

chisel3

# WireDefault

###

#### object WireDefault extends WireDefaultImpl

Utility for constructing hardware wires with a default connection

The two forms of `WireDefault` differ in how the type and width of the resulting Wire are specified.

#### Single Argument

The single argument form uses the argument to specify both the type and default connection. For non-literal Bits, the width of the Wire will be inferred. For literal Bits and all non-Bits arguments, the type will be copied from the argument. See the following examples for more details:

1. Literal Bits initializer: width will be set to match

    val w1 = WireDefault(1.U) // width will be inferred to be 1
    val w2 = WireDefault(1.U(8.W)) // width is set to 8

2. Non-Literal Element initializer - width will be inferred

    val x = Wire(UInt())
    val y = Wire(UInt(8.W))
    val w1 = WireDefault(x) // width will be inferred
    val w2 = WireDefault(y) // width will be inferred

3. Aggregate initializer - width will be set to match the aggregate

    class MyBundle {
      val unknown = UInt()
      val known   = UInt(8.W)
    }
    val w1 = Wire(new MyBundle)
    val w2 = WireDefault(w1)
    // Width of w2.unknown is inferred
    // Width of w2.known is set to 8

#### Double Argument

The double argument form allows the type of the Wire and the default connection to be specified independently.

The width inference semantics for `WireDefault` with two arguments match those of Wire. The first argument to `WireDefault` is the type template which defines the width of the `Wire` in exactly the same way as the only argument to Wire.

More explicitly, you can reason about `WireDefault` with multiple arguments as if it were defined as:

    def WireDefault[T <: Data](t: T, init: T): T = {
      val x = Wire(t)
      x := init
      x
    }

Source
  Data.scala

Linear Supertypes
WireDefaultImpl, AnyRef, Any

Ordering

1. Alphabetic
2. By Inheritance

Inherited

1. WireDefault
2. WireDefaultImpl
3. AnyRef
4. Any

1. Hide All
2. Show All

Visibility

1. Public
2. Protected

### Value Members

1.  final def !=(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
2.  final def ##: Int
   Definition Classes
     AnyRef → Any
3.  final def ==(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
4.  def apply[T <: Data](init: T)(implicit sourceInfo: SourceInfo): T

   Construct a Wire with a default connection

   Construct a Wire with a default connection

   init

     The hardware value that will serve as a type template and default value

   Definition Classes
     WireDefaultImpl
5.  def apply[T <: Data](t: T, init: T)(implicit sourceInfo: SourceInfo): T

   Construct a Wire with a type template and a default connection

   Construct a Wire with a type template and a default connection

   t

     The type template used to construct this Wire

   init

     The hardware value that will serve as the default value

   Definition Classes
     WireDefaultImpl
6.  def apply[T <: Data](t: T, init: DontCare.type)(implicit sourceInfo: SourceInfo): T

   Construct a Wire with a type template and a chisel3.DontCare default

   Construct a Wire with a type template and a chisel3.DontCare default

   t

     The type template used to construct this Wire

   init

     The default connection to this Wire, can only be DontCare

   Definition Classes
     WireDefaultImpl
   Note

     This is really just a specialized form of `apply[T <: Data](t: T, init: T): T` with DontCare as `init`

7.  final def asInstanceOf[T0]: T0
   Definition Classes
     Any
8.  def clone(): AnyRef
   Attributes
     protected[lang]
   Definition Classes
     AnyRef
   Annotations
     @throws(classOf[java.lang.CloneNotSupportedException]) @native()
9.  final def eq(arg0: AnyRef): Boolean
   Definition Classes
     AnyRef
10.  def equals(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef → Any
11.  def finalize(): Unit
    Attributes
      protected[lang]
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.Throwable])
12.  final def getClass(): Class[_ <: AnyRef]
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
13.  def hashCode(): Int
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
14.  final def isInstanceOf[T0]: Boolean
    Definition Classes
      Any
15.  final def ne(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
16.  final def notify(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
17.  final def notifyAll(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
18.  final def synchronized[T0](arg0: => T0): T0
    Definition Classes
      AnyRef
19.  def toString(): String
    Definition Classes
      AnyRef → Any
20.  final def wait(): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.InterruptedException])
21.  final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.InterruptedException])
22.  final def wait(arg0: Long): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.InterruptedException]) @native()

### Inherited from WireDefaultImpl

### Inherited from AnyRef

### Inherited from Any

### Ungrouped