aboutsummaryrefslogtreecommitdiffstats
path: root/passes/opt/opt_expr.cc
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-08-22 08:37:27 -0700
committerEddie Hung <eddie@fpgeh.com>2019-08-22 08:37:27 -0700
commit6f971470f83b8e4ed29232be4b6cb5da89d50dc0 (patch)
treec93e220a1873571bb84fb43760f4ed98a0e34f81 /passes/opt/opt_expr.cc
parent379f33af5489850ef8e2e58ef12ff5b22da87711 (diff)
downloadyosys-6f971470f83b8e4ed29232be4b6cb5da89d50dc0.tar.gz
yosys-6f971470f83b8e4ed29232be4b6cb5da89d50dc0.tar.bz2
yosys-6f971470f83b8e4ed29232be4b6cb5da89d50dc0.zip
Respect opt_expr -keepdc as per @cliffordwolf
Diffstat (limited to 'passes/opt/opt_expr.cc')
-rw-r--r--passes/opt/opt_expr.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/passes/opt/opt_expr.cc b/passes/opt/opt_expr.cc
index c4da613ab..73f48317a 100644
--- a/passes/opt/opt_expr.cc
+++ b/passes/opt/opt_expr.cc
@@ -748,7 +748,7 @@ void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module, bool cons
if (cell->type.in(ID($shiftx), ID($shift))) {
SigSpec sig_a = assign_map(cell->getPort(ID::A));
int width;
- bool trim_x = true;
+ bool trim_x = cell->type == ID($shiftx) || !keepdc;
bool trim_0 = cell->type == ID($shift);
for (width = GetSize(sig_a); width > 1; width--) {
if ((trim_x && sig_a[width-1] == State::Sx) ||