flowmap: when doing mincut, ensure source is always in X, not X̅.
authorwhitequark <whitequark@whitequark.org>
Tue, 12 Nov 2019 00:15:43 +0000 (00:15 +0000)
committerwhitequark <whitequark@whitequark.org>
Tue, 12 Nov 2019 00:15:43 +0000 (00:15 +0000)
Fixes #1475.

passes/techmap/flowmap.cc

index 96eee45db49177d2bd7199d5593627a31462f56b..a2ad87f7d279ac5868e8d81c8463ff63f2612bff 100644 (file)
@@ -394,7 +394,7 @@ struct FlowGraph
 
        pair<pool<RTLIL::SigBit>, pool<RTLIL::SigBit>> edge_cut()
        {
-               pool<RTLIL::SigBit> x, xi;
+               pool<RTLIL::SigBit> x = {source}, xi; // X and X̅ in the paper
 
                NodePrime source_prime = {source, true};
                pool<NodePrime> visited;
@@ -437,6 +437,7 @@ struct FlowGraph
                for (auto collapsed_node : collapsed[sink])
                        xi.insert(collapsed_node);
 
+               log_assert(x[source] && !xi[source]);
                log_assert(!x[sink] && xi[sink]);
                return {x, xi};
        }