layer

chisel3.layer
object layer

This object contains Chisel language features for creating layers. Layers are collections of hardware that are not always present in the circuit. Layers are intended to be used to hold verification or debug code.

Attributes

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

Members list

Type members

Classlikes

object ABI

Enumeration of different application binary interfaces (ABIs) for how to enable layers. These are implementations of the FIRRTL ABI Specification.

Enumeration of different application binary interfaces (ABIs) for how to enable layers. These are implementations of the FIRRTL ABI Specification.

Attributes

Source
Layer.scala
Supertypes
class Object
trait Matchable
class Any
Self type
ABI.type

Attributes

Companion
trait
Source
Layer.scala
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait BlockReturnHandler[A]

A type class that describes how to post-process the return value from a layer block.

A type class that describes how to post-process the return value from a layer block.

Attributes

Companion
object
Source
Layer.scala
Supertypes
class Object
trait Matchable
class Any
final case class CustomOutputDir(path: Path) extends OutputDirBehavior

Attributes

Source
Layer.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case object DefaultOutputDir extends OutputDirBehavior

Attributes

Source
Layer.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
case class ExpectedNotElideBlocks(message: String) extends ChiselException

Attributes

Source
Layer.scala
Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
abstract class Layer(val config: LayerConfig)(implicit _parent: Layer, _sourceInfo: SourceInfo)

A layer declaration.

A layer declaration.

Value parameters

_parent

the parent layer, if any

convention

how this layer should be lowered

outputDirBehavior

an optional user-provided output directory for this layer

Attributes

Companion
object
Source
Layer.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Temporal
object Assert
object Assume
object Cover
object Verification
Self type
Singleton
object Layer

Attributes

Companion
class
Source
Layer.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Layer.type
object LayerConfig

Attributes

Companion
trait
Source
Layer.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait LayerConfig

Attributes

Companion
object
Source
Layer.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Extract
object Inline
case object NoOutputDir extends OutputDirBehavior

Attributes

Source
Layer.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
sealed trait OutputDirBehavior

Attributes

Source
Layer.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Deprecated classlikes

object Convention

Enumerations of different optional layer conventions. A layer convention says how a given layer should be lowered to Verilog.

Enumerations of different optional layer conventions. A layer convention says how a given layer should be lowered to Verilog.

Attributes

Deprecated
[Since version Chisel 7.0.0] `Convention` is being removed in favor of `LayerConfig`
Source
Layer.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Convention.type

Value members

Concrete methods

def addLayer(layer: Layer): Option[Unit]

Add a layer and all of its parents to the Builder. This lets the Chisel know that this layer should be emitted into FIRRTL text.

Add a layer and all of its parents to the Builder. This lets the Chisel know that this layer should be emitted into FIRRTL text.

This API can be used to guarantee that a design will always have certain layers defined. By default, layers are only included in the FIRRTL text if they have layer block users.

Attributes

Source
Layer.scala
def block[A](layer: Layer, skipIfAlreadyInBlock: Boolean = ..., skipIfLayersEnabled: Boolean = ...)(thunk: => A)(implicit tc: BlockReturnHandler[A] = ..., sourceInfo: SourceInfo): tc.R

Create a new layer block. This is hardware that will be enabled collectively when the layer is enabled.

Create a new layer block. This is hardware that will be enabled collectively when the layer is enabled.

This function automatically creates parent layers as the layer of the current layerblock is an ancestor of the desired layer. The ancestor may be the current layer which causes no layer block to be created. (This is not a proper ancestor requirement.)

By default, the return of the layer block will be either a subtype of Data or Unit, depending on the thunk provided. If the thunk (the hardware that should be constructed inside the layer block) returns a Data, then this will either return a Wire of layer-colored Probe type if a layer block was created or the underlying Data if no layer block was created. If the thunk returns anything else, this will return Unit. This is controlled by the implicit argument tc and may be customized by advanced users to do other things.

Value parameters

layer

the layer this block is associated with

skipIfAlreadyInBlock

if true, then this will not create a layer if this block is already inside another layerblock

skipIfLayersEnabled

if true, then this will not create a layer if any layers have been enabled for the current module block if already inside a layer block

sourceInfo

a source locator

thunk

the Chisel code that goes into the layer block

Attributes

Returns

either a subtype of Data or Unit depending on the thunk return type

Throws
java.lang.IllegalArgumentException

if the layer of the currnet layerblock is not an ancestor of the desired layer

Source
Layer.scala
def elideBlocks[A](thunk: => A): A

API that will cause any calls to block in the thunk to not create new layer blocks.

API that will cause any calls to block in the thunk to not create new layer blocks.

This is an advanced, library-writer's API that is not intended for broad use. You may consider using this if you are writing an API which automatically puts code into layer blocks and you want to provide a way for a user to completely opt out of this.

Value parameters

thunk

the Chisel code that should not go into a layer block

Attributes

Source
Layer.scala
final def enable(layer: Layer): Unit

Call this function from within a Module body to enable this layer globally for that module.

Call this function from within a Module body to enable this layer globally for that module.

Attributes

Source
Layer.scala
def requireNotElideBlocksContext(msg: String = ...): Unit

Throw exception if elideBlocks is active.

Throw exception if elideBlocks is active.

Value parameters

msg

when non-empty, prefixes (with ": ") message used in thrown exception.

Attributes

Source
Layer.scala