Fixed bug in opt_reduce (see vloghammer issue_044)
authorClifford Wolf <clifford@clifford.at>
Mon, 12 May 2014 10:45:47 +0000 (12:45 +0200)
committerClifford Wolf <clifford@clifford.at>
Mon, 12 May 2014 10:45:47 +0000 (12:45 +0200)
passes/opt/opt_reduce.cc

index fee8fb71b1069119cec512b29d81646e0a76dc92..dfe214416f928727d9f737e135848e8a958182e0 100644 (file)
@@ -73,7 +73,10 @@ struct OptReduceWorker
                        for (auto child_cell : drivers.find(chunk)) {
                                if (child_cell->type == cell->type) {
                                        opt_reduce(cells, drivers, child_cell);
-                                       new_sig_a.append(child_cell->connections["\\A"]);
+                                       if (child_cell->connections["\\Y"].extract(0, 1) == chunk)
+                                               new_sig_a.append(child_cell->connections["\\A"]);
+                                       else
+                                               new_sig_a.append(RTLIL::State::S0);
                                        imported_children = true;
                                }
                        }