aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/consteval.h
diff options
context:
space:
mode:
authorAhmed Irfan <ahmedirfan1983@gmail.com>2014-01-14 11:25:06 +0100
committerAhmed Irfan <ahmedirfan1983@gmail.com>2014-01-14 11:25:06 +0100
commit1091c24d0028850699ba209469f03b28ebc66e10 (patch)
treedfdf036678958312ac003e4047cea70fa74e1fa7 /kernel/consteval.h
parent09f16c9d0c1f0b8aec4a376449c831fa98a4e985 (diff)
parentb4ce7fee06d14d2b767ad81968b5047766d4da84 (diff)
downloadyosys-1091c24d0028850699ba209469f03b28ebc66e10.tar.gz
yosys-1091c24d0028850699ba209469f03b28ebc66e10.tar.bz2
yosys-1091c24d0028850699ba209469f03b28ebc66e10.zip
Merge branch 'master' of https://github.com/ahmedirfan1983/yosys into btor
Diffstat (limited to 'kernel/consteval.h')
-rw-r--r--kernel/consteval.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/consteval.h b/kernel/consteval.h
index a424007ef..10116ccfe 100644
--- a/kernel/consteval.h
+++ b/kernel/consteval.h
@@ -110,6 +110,7 @@ struct ConstEval
if (cell->type == "$mux" || cell->type == "$pmux" || cell->type == "$safe_pmux" || cell->type == "$_MUX_")
{
std::vector<RTLIL::SigSpec> y_candidates;
+ int count_maybe_set_s_bits = 0;
int count_set_s_bits = 0;
for (int i = 0; i < sig_s.width; i++)
@@ -120,16 +121,17 @@ struct ConstEval
if (s_bit == RTLIL::State::Sx || s_bit == RTLIL::State::S1)
y_candidates.push_back(b_slice);
+ if (s_bit == RTLIL::State::S1 || s_bit == RTLIL::State::Sx)
+ count_maybe_set_s_bits++;
+
if (s_bit == RTLIL::State::S1)
count_set_s_bits++;
}
- if (cell->type == "$safe_pmux" && count_set_s_bits > 1) {
+ if (cell->type == "$safe_pmux" && count_set_s_bits > 1)
y_candidates.clear();
- count_set_s_bits = 0;
- }
- if (count_set_s_bits == 0)
+ if ((cell->type == "$safe_pmux" && count_maybe_set_s_bits > 1) || count_set_s_bits == 0)
y_candidates.push_back(sig_a);
std::vector<RTLIL::Const> y_values;