back.rtlil: fix guard for division by zero.
Oops... that should be checking the divisor, not the dividend. This was discovered by running the test suite on cxxsim.
This commit is contained in:
parent
d714d78de1
commit
d06add0aab
1 changed files with 1 additions and 1 deletions
|
|
@ -558,7 +558,7 @@ class _RHSValueCompiler(_ValueCompiler):
|
||||||
self.s.rtlil.cell("$mux", ports={
|
self.s.rtlil.cell("$mux", ports={
|
||||||
"\\A": divmod_res,
|
"\\A": divmod_res,
|
||||||
"\\B": self(ast.Const(0, ast.Shape(res_bits, res_sign))),
|
"\\B": self(ast.Const(0, ast.Shape(res_bits, res_sign))),
|
||||||
"\\S": self(lhs == 0),
|
"\\S": self(rhs == 0),
|
||||||
"\\Y": res,
|
"\\Y": res,
|
||||||
}, params={
|
}, params={
|
||||||
"WIDTH": res_bits
|
"WIDTH": res_bits
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue