Instantiate

chisel3.experimental.hierarchy.Instantiate
object Instantiate

Create an Instance of a Module

Acts as a nicer API wrapping Definition and Instance. Used in a similar way to traditional module instantiation using Module(...).

val inst0: Instance[MyModule] = Instantiate(new MyModule(arg1, arg2))

// Note that you cannot pass arguments by name (this will not compile)
val inst1 = Instantiate(new OtherModule(n = 3))

// Instead, only pass arguments positionally
val inst2 = Instantiate(new OtherModule(3))

==Limitations==

  • The caching does not work for Modules that are inner classes. This is due to the fact that the WeakTypeTags for instances will be different and thus will not hit in the cache.
  • Passing parameters by name to module constructors is not supported.
  • User-defined types that wrap up Data will use the default Data equality and hashCode implementations which use referential equality, thus will not hit in the cache.

Attributes

Source
Instantiate.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Inherited methods

def _definition[K, A <: BaseModule](args: K, f: K => A, tt: AnyRef): Definition[A]

Internal method for creating a Definition from extracted arguments This is not part of the public API, do not call directly!

Internal method for creating a Definition from extracted arguments This is not part of the public API, do not call directly!

Attributes

Inherited from:
InstantiateIntf (hidden)
Source
InstantiateIntf.scala
def _instance[K, A <: BaseModule](args: K, f: K => A, tt: AnyRef)(using sourceInfo: SourceInfo): Instance[A]

Attributes

Inherited from:
InstantiateIntf (hidden)
Source
InstantiateIntf.scala
inline def apply[A <: BaseModule](inline con: A)(using sourceInfo: SourceInfo): Instance[A]

Create an Instance of a Module

Create an Instance of a Module

This is similar to Module(...) except that it returns an Instance[_] object.

Value parameters

con

module construction, must be actual call to constructor (new MyModule(...))

Attributes

Returns

constructed module Instance

Inherited from:
InstantiateIntf (hidden)
Source
InstantiateIntf.scala
inline def definition[A <: BaseModule](inline con: A): Definition[A]

Attributes

Inherited from:
InstantiateIntf (hidden)
Source
InstantiateIntf.scala