Fix handling of (* keep *) wires in wreduce
authorClifford Wolf <clifford@clifford.at>
Mon, 31 Dec 2018 15:34:27 +0000 (16:34 +0100)
committerClifford Wolf <clifford@clifford.at>
Mon, 31 Dec 2018 15:37:40 +0000 (16:37 +0100)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
passes/opt/wreduce.cc

index 0164f58d6a85153445817045e861bda8711b18a3..8063b86a606f757acb546f8efa58495be94d518d 100644 (file)
@@ -235,8 +235,11 @@ struct WreduceWorker
                } else {
                        while (GetSize(sig) > 0)
                        {
-                               auto info = mi.query(sig[GetSize(sig)-1]);
+                               auto bit = sig[GetSize(sig)-1];
+                               if (keep_bits.count(bit))
+                                       break;
 
+                               auto info = mi.query(bit);
                                if (info->is_output || GetSize(info->ports) > 1)
                                        break;