WhenContext

chisel3.WhenContext
final class WhenContext

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.

Attributes

Source
When.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def active: Boolean

Return true if this WhenContext is currently constructing operations.

Return true if this WhenContext is currently constructing operations.

Attributes

Source
When.scala
def elsewhen(elseCond: => Bool)(block: => Any)(implicit sourceInfo: SourceInfo): WhenContext

This block of logic gets executed if above conditions have been false and this condition is true. The lazy argument pattern makes it possible to delay evaluation of cond, emitting the declaration and assignment of the Bool node of the predicate in the correct place.

This block of logic gets executed if above conditions have been false and this condition is true. The lazy argument pattern makes it possible to delay evaluation of cond, emitting the declaration and assignment of the Bool node of the predicate in the correct place.

Attributes

Source
When.scala
def otherwise(block: => Any)(implicit sourceInfo: SourceInfo): Unit

This block of logic gets executed only if the above conditions were all false. No additional logic blocks may be appended past the otherwise. The lazy argument pattern makes it possible to delay evaluation of cond, emitting the declaration and assignment of the Bool node of the predicate in the correct place.

This block of logic gets executed only if the above conditions were all false. No additional logic blocks may be appended past the otherwise. The lazy argument pattern makes it possible to delay evaluation of cond, emitting the declaration and assignment of the Bool node of the predicate in the correct place.

Attributes

Source
When.scala