Why do modulus(%) and compare(===/<=/>=) operators combinations lead to firrtl.FirrtlInternalException? #1998
Answered
by
sequencer
Wolf-Tungsten
asked this question in
Q&A
-
I have a module in which a modulus operator % is combined with a compare operators such as ===/<=/>=. When I tried to generate Verilog code for this module, I got a firrtl.FirrtlInternalException. Here is a trivial module can reproduce this issue: package modulus
import chisel3._
class Modulus extends Module {
val io = IO(new Bundle{
val in1 = Input(SInt(8.W))
val in2 = Input(SInt(8.W))
val out = Output(Bool())
})
io.out := ((io.in1 % io.in2) === 0.S)
}
object Modulus extends App {
val verilogString = (new chisel3.stage.ChiselStage).emitVerilog(new Modulus, Array.concat(args, Array("-td=./verilog-output")))
}
|
Beta Was this translation helpful? Give feedback.
Answered by
sequencer
Jul 1, 2021
Replies: 2 comments 1 reply
-
opps. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
sequencer
-
I'm marking this as answered, and move future discussion to #2012. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
opps.
This should be a bug for
SInt
.