summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-03-06 11:53:37 +0100
committerClifford Wolf <clifford@clifford.at>2014-03-06 11:53:37 +0100
commita1bfde8c5ea0d5c9778579bf78165637ac6c9b25 (patch)
tree142aebf2bf592445bc9a3f272f160969fc49230c
parentb1b8fe3a566099e5fd29e6d8c60e8f8b4feb0f34 (diff)
Strictly zero-extend unsigned A-inputs of shift operations
-rw-r--r--kernel/calc.cc4
-rw-r--r--kernel/satgen.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/kernel/calc.cc b/kernel/calc.cc
index a56db93a..749589f2 100644
--- a/kernel/calc.cc
+++ b/kernel/calc.cc
@@ -305,14 +305,14 @@ static RTLIL::Const const_shift(const RTLIL::Const &arg1, const RTLIL::Const &ar
RTLIL::Const RTLIL::const_shl(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool, int result_len)
{
RTLIL::Const arg1_ext = arg1;
- extend(arg1_ext, result_len, signed1);
+ extend_u0(arg1_ext, result_len, signed1);
return const_shift(arg1_ext, arg2, false, -1, result_len);
}
RTLIL::Const RTLIL::const_shr(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool, int result_len)
{
RTLIL::Const arg1_ext = arg1;
- extend(arg1_ext, result_len, signed1);
+ extend_u0(arg1_ext, result_len, signed1);
return const_shift(arg1_ext, arg2, false, +1, result_len);
}
diff --git a/kernel/satgen.h b/kernel/satgen.h
index d9bcb425..3ae9502f 100644
--- a/kernel/satgen.h
+++ b/kernel/satgen.h
@@ -634,7 +634,7 @@ struct SatGen
while (undef_y.size() < undef_a.size())
undef_y.push_back(ez->literal());
while (undef_y.size() > undef_a.size())
- undef_a.push_back(undef_a.back());
+ undef_a.push_back(cell->parameters["\\A_SIGNED"].as_bool() ? undef_a.back() : ez->FALSE);
tmp = undef_a;
for (size_t i = 0; i < b.size(); i++)