Closed YongkangLi closed 3 years ago
There's a minor bug in the implementation of switch
that assumes you're doing a wildcard import import chisel3.util._
. You should be able to workaround by using the wildcard, or you can import SwitchContext
directly, import chisel3.util.SwitchContext
. This is dumb and an easy fix though so I'll have a PR shortly.
Thanks for explanation and help. It seems that this was a stupid question. Oops!
It seems that this was a stupid question. Oops!
Not at all, SwitchContext
is supposed to be hidden from you, this is our mistake 😉
When I was doing the Mux4, I wanted to use switch-is. But an error occurred during compilation. I know that the referential solution uses two Mux2. I just want to figure out what is wrong doing so. PS: the error message is as follows.
[error] .../chisel-tutorial/src/main/scala/problems/Mux4.scala:38:19: not found: type SwitchContext
[error] switch (io.sel) { [error] ^ [error] one error found