when
chisel3.when
object when
Attributes
- Source
- When.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
when.type
Members list
Value members
Concrete methods
Create a when condition block, where whether a block of logic is executed or not depends on the conditional.
Create a when condition block, where whether a block of logic is executed or not depends on the conditional.
Value parameters
- block
-
logic that runs only if
condis true - cond
-
condition to execute upon
Attributes
- Example
-
when ( myData === 3.U ) { // Some logic to run when myData equals 3. } .elsewhen ( myData === 1.U ) { // Some logic to run when myData equals 1. } .otherwise { // Some logic to run when myData is neither 3 nor 1. } - Source
- When.scala
Returns the current when condition
Returns the current when condition
This is the conjunction of conditions for all whens going up the call stack
when (a) {
when (b) {
when (c) {
}.otherwise {
when.cond // this is equal to: a && b && !c
}
}
}
Attributes
- Source
- When.scala
In this article