I want to define some constants in Chisel and have them produce an effect similar to macro expansion in C, replacing them at compile time where they are used. Should I use val or def for this purpose?
// which one should I use?
def DATA_WIDTH = 32
val DATA_WIDTH = 32
val reg = Reg(Vec(CPUConfig.DATA_WIDTH, UInt(CPUConfig.DATA_WIDTH.W)))
Can someone explain this to me?