summaryrefslogtreecommitdiff
path: root/kernel/calc.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-09-02 17:48:41 +0200
committerClifford Wolf <clifford@clifford.at>2014-09-02 17:48:41 +0200
commitc38283dbd033ba95554600bbaa850de707ab2a78 (patch)
tree26c4d56235b59a023c3cfdd6023014cc322c7509 /kernel/calc.cc
parentacd7a99aef0f698580dc6a6d202a79f36fdf5360 (diff)
Small bug fixes in $not, $neg, and $shiftx models
Diffstat (limited to 'kernel/calc.cc')
-rw-r--r--kernel/calc.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/calc.cc b/kernel/calc.cc
index 7bfdb895..4048e4a1 100644
--- a/kernel/calc.cc
+++ b/kernel/calc.cc
@@ -591,10 +591,9 @@ RTLIL::Const RTLIL::const_bu0(const RTLIL::Const &arg1, const RTLIL::Const&, boo
RTLIL::Const RTLIL::const_neg(const RTLIL::Const &arg1, const RTLIL::Const&, bool signed1, bool, int result_len)
{
RTLIL::Const arg1_ext = arg1;
- extend(arg1_ext, result_len, signed1);
-
RTLIL::Const zero(RTLIL::State::S0, 1);
- return RTLIL::const_sub(zero, arg1_ext, false, signed1, result_len);
+
+ return RTLIL::const_sub(zero, arg1_ext, true, signed1, result_len);
}
YOSYS_NAMESPACE_END