From: Clifford Wolf Date: Sun, 7 Jul 2013 10:59:00 +0000 (+0200) Subject: Fixed handling of $eq and $ne in opt_const X-Git-Tag: yosys-0.2.0~546 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0c0197cf45ae5ca0f40cfeb34d289acc9bca5b7e;p=yosys.git Fixed handling of $eq and $ne in opt_const --- diff --git a/passes/opt/opt_const.cc b/passes/opt/opt_const.cc index 149bd97d5..4223ebe3b 100644 --- a/passes/opt/opt_const.cc +++ b/passes/opt/opt_const.cc @@ -148,8 +148,8 @@ void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module, bool cons { if (cell->parameters["\\A_WIDTH"].as_int() != cell->parameters["\\B_WIDTH"].as_int()) { int width = std::max(cell->parameters["\\A_WIDTH"].as_int(), cell->parameters["\\B_WIDTH"].as_int()); - cell->connections["\\A"].extend(width, cell->parameters["\\A_SIGNED"].as_bool()); - cell->connections["\\B"].extend(width, cell->parameters["\\B_SIGNED"].as_bool()); + cell->connections["\\A"].extend(width, cell->parameters["\\A_SIGNED"].as_bool() && cell->parameters["\\B_SIGNED"].as_bool()); + cell->connections["\\B"].extend(width, cell->parameters["\\A_SIGNED"].as_bool() && cell->parameters["\\B_SIGNED"].as_bool()); cell->parameters["\\A_WIDTH"] = width; cell->parameters["\\B_WIDTH"] = width; }