Fixed a bug in opt_const when optimizing 1-bit compares with constants
authorClifford Wolf <clifford@clifford.at>
Sat, 13 Apr 2013 19:18:24 +0000 (21:18 +0200)
committerClifford Wolf <clifford@clifford.at>
Sat, 13 Apr 2013 19:18:24 +0000 (21:18 +0200)
passes/opt/opt_const.cc

index 0effd964b503e4710b9d470076bbcc7b0f93096f..7c82f0fcb5a1878ad0c32b28cc1d86a516572c3e 100644 (file)
@@ -181,8 +181,10 @@ void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module)
                        RTLIL::SigSpec b = assign_map(cell->connections["\\B"]);
 
                        if (a.is_fully_const()) {
-                               RTLIL::SigSpec tmp = a;
-                               a = b, b = tmp;
+                               RTLIL::SigSpec tmp;
+                               tmp = a, a = b, b = tmp;
+                               cell->connections["\\A"] = a;
+                               cell->connections["\\B"] = b;
                        }
 
                        if (b.is_fully_const()) {