Since $_ANDNOT_ is not symmetric, do not sort leaves
authorEddie Hung <eddie@fpgeh.com>
Mon, 12 Aug 2019 18:17:15 +0000 (11:17 -0700)
committerEddie Hung <eddie@fpgeh.com>
Mon, 12 Aug 2019 18:17:15 +0000 (11:17 -0700)
passes/techmap/extract_fa.cc

index b541ceb6b8a7723199c56fefe8d2eb2ff16794cc..befaf68a432bac299c8e89bfa0a10b1252abe2ef 100644 (file)
@@ -153,12 +153,10 @@ struct ExtractFaWorker
                }
        }
 
-       void check_partition(SigBit root, pool<SigBit> &leaves)
+       void check_partition(SigBit root, const pool<SigBit> &leaves)
        {
                if (config.enable_ha && GetSize(leaves) == 2)
                {
-                       leaves.sort();
-
                        SigBit A = SigSpec(leaves)[0];
                        SigBit B = SigSpec(leaves)[1];
 
@@ -196,8 +194,6 @@ struct ExtractFaWorker
 
                if (config.enable_fa && GetSize(leaves) == 3)
                {
-                       leaves.sort();
-
                        SigBit A = SigSpec(leaves)[0];
                        SigBit B = SigSpec(leaves)[1];
                        SigBit C = SigSpec(leaves)[2];
@@ -237,7 +233,7 @@ struct ExtractFaWorker
                }
        }
 
-       void find_partitions(SigBit root, pool<SigBit> &leaves, pool<pool<SigBit>> &cache, int maxdepth, int maxbreadth)
+       void find_partitions(SigBit root, const pool<SigBit> &leaves, pool<const pool<SigBit>> &cache, int maxdepth, int maxbreadth)
        {
                if (cache.count(leaves))
                        return;
@@ -293,8 +289,8 @@ struct ExtractFaWorker
                                continue;
 
                        SigBit root = it.first;
-                       pool<SigBit> leaves = { root };
-                       pool<pool<SigBit>> cache;
+                       const pool<SigBit> leaves = { root };
+                       pool<const pool<SigBit>> cache;
 
                        if (config.verbose)
                                log("  checking %s\n", log_signal(it.first));