aboutsummaryrefslogtreecommitdiffstats
path: root/passes/opt/opt_expr.cc
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2020-05-08 11:07:44 -0700
committerEddie Hung <eddie@fpgeh.com>2020-05-08 11:07:44 -0700
commit17f4e06247b608034f730efe6391fd5fe250bd79 (patch)
treee579d40437eb1e78aa01f7ca3bfbe66fc5eaf9ca /passes/opt/opt_expr.cc
parent495acf981547850ac7ad5b765dd215b0c33d59ac (diff)
downloadyosys-17f4e06247b608034f730efe6391fd5fe250bd79.tar.gz
yosys-17f4e06247b608034f730efe6391fd5fe250bd79.tar.bz2
yosys-17f4e06247b608034f730efe6391fd5fe250bd79.zip
opt_expr: restore consume_x; use for coarse grained too
Diffstat (limited to 'passes/opt/opt_expr.cc')
-rw-r--r--passes/opt/opt_expr.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/passes/opt/opt_expr.cc b/passes/opt/opt_expr.cc
index d895fc691..60221f32d 100644
--- a/passes/opt/opt_expr.cc
+++ b/passes/opt/opt_expr.cc
@@ -543,13 +543,13 @@ void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module, bool cons
}
}
- if (detect_const_and && (found_zero || found_inv || (!keepdc && found_undef))) {
+ if (detect_const_and && (found_zero || found_inv || (!keepdc && found_undef && consume_x))) {
cover("opt.opt_expr.const_and");
replace_cell(assign_map, module, cell, "const_and", ID::Y, RTLIL::State::S0);
goto next_cell;
}
- if (detect_const_or && (found_one || found_inv || (!keepdc && found_undef))) {
+ if (detect_const_or && (found_one || found_inv || (!keepdc && found_undef && consume_x))) {
cover("opt.opt_expr.const_or");
replace_cell(assign_map, module, cell, "const_or", ID::Y, RTLIL::State::S1);
goto next_cell;
@@ -927,7 +927,7 @@ skip_fine_alu:
if (input.match("**")) ACTION_DO_Y(x);
if (input.match("1*")) ACTION_DO_Y(x);
if (input.match("*1")) ACTION_DO_Y(x);
- if (!keepdc) {
+ if (consume_x) {
if (input.match(" *")) ACTION_DO_Y(0);
if (input.match("* ")) ACTION_DO_Y(0);
}
@@ -946,7 +946,7 @@ skip_fine_alu:
if (input.match("**")) ACTION_DO_Y(x);
if (input.match("0*")) ACTION_DO_Y(x);
if (input.match("*0")) ACTION_DO_Y(x);
- if (!keepdc) {
+ if (consume_x) {
if (input.match(" *")) ACTION_DO_Y(1);
if (input.match("* ")) ACTION_DO_Y(1);
}
@@ -963,7 +963,7 @@ skip_fine_alu:
if (input.match("01")) ACTION_DO_Y(1);
if (input.match("10")) ACTION_DO_Y(1);
if (input.match("11")) ACTION_DO_Y(0);
- if (!keepdc) {
+ if (consume_x) {
if (input.match(" *")) ACTION_DO_Y(0);
if (input.match("* ")) ACTION_DO_Y(0);
}
@@ -1149,7 +1149,7 @@ skip_fine_alu:
goto next_cell;
}
- if (!keepdc)
+ if (!keepdc && consume_x)
{
bool identity_wrt_a = false;
bool identity_wrt_b = false;