Bugfix in "setundef" pass
authorClifford Wolf <clifford@clifford.at>
Tue, 8 Nov 2016 17:53:36 +0000 (18:53 +0100)
committerClifford Wolf <clifford@clifford.at>
Tue, 8 Nov 2016 17:53:36 +0000 (18:53 +0100)
passes/cmds/setundef.cc

index 26b2eb87d3c81587a942de9ca716595da138bf48..e54135c8f30da886a969914131456124dcf5e87f 100644 (file)
@@ -90,6 +90,8 @@ struct SetundefPass : public Pass {
                bool init_mode = false;
                SetundefWorker worker;
 
+               log_header(design, "Executing SETUNDEF pass (replace undef values with defined constants).\n");
+
                size_t argidx;
                for (argidx = 1; argidx < args.size(); argidx++)
                {
@@ -137,8 +139,11 @@ struct SetundefPass : public Pass {
                                SigPool undriven_signals;
 
                                for (auto &it : module->wires_)
-                                       if (!it.second->port_input)
-                                               undriven_signals.add(sigmap(it.second));
+                                       undriven_signals.add(sigmap(it.second));
+
+                               for (auto &it : module->wires_)
+                                       if (it.second->port_input)
+                                               undriven_signals.del(sigmap(it.second));
 
                                CellTypes ct(design);
                                for (auto &it : module->cells_)