Experimental macro for naming Chisel hardware values
By default, Chisel uses reflection for naming which only works for public fields of Bundle
and Module classes. Applying this macro annotation to a class or object enables Chisel
to name any hardware values within the annotated class or object.
Annotations
@compileTimeOnly(...)
Example:
import chisel3._
import chisel3.experimental.chiselName
@chiselName
class MyModule extends Module {
val io = IO(new Bundle {
val in = Input(UInt(8.W))
val out = Output(UInt(8.W))
})
def createReg(): Unit = {
// @chiselName allows Chisel to name this Regval myReg = RegInit(io.in)
io.out := myReg
}
createReg()
}
Experimental macro for naming Chisel hardware values
By default, Chisel uses reflection for naming which only works for public fields of
Bundle
andModule
classes. Applying this macro annotation to aclass
orobject
enables Chisel to name any hardware values within the annotatedclass
orobject.