I am using multiple clock in chisel.
In chisel3, I write following codes.
withClockAndReset(A_clk, A_rst) {
val data_a = RegInit(0.U(4.W))
}
withClockAndReset(B_clk, B_rst) {
val data_b = RegInit(0.U(4.W))
}
data_b := data_a
data_a := io.data
The compiler reported that the variable data_a could not be found. The variable data_a is defined inside withClockAndReset, and I can't use this variable outside.
What can I do?