aboutsummaryrefslogtreecommitdiffstats
path: root/passes
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-08-14 11:25:56 -0700
committerEddie Hung <eddie@fpgeh.com>2019-08-14 11:25:56 -0700
commit5ec5f6dec7d4cdcfd9e1a2cda999886605778400 (patch)
tree3618cf58f09e2bb6f208a4ce7c5c842a4a30ce29 /passes
parente2797f13084931b55d7f1759cdedfecd9eb91268 (diff)
downloadyosys-5ec5f6dec7d4cdcfd9e1a2cda999886605778400.tar.gz
yosys-5ec5f6dec7d4cdcfd9e1a2cda999886605778400.tar.bz2
yosys-5ec5f6dec7d4cdcfd9e1a2cda999886605778400.zip
Only sort leaves on non-ANDNOT/ORNOT cells
Diffstat (limited to 'passes')
-rw-r--r--passes/techmap/extract_fa.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/passes/techmap/extract_fa.cc b/passes/techmap/extract_fa.cc
index b541ceb6b..6e45c47d4 100644
--- a/passes/techmap/extract_fa.cc
+++ b/passes/techmap/extract_fa.cc
@@ -153,11 +153,12 @@ struct ExtractFaWorker
}
}
- void check_partition(SigBit root, pool<SigBit> &leaves)
+ void check_partition(SigBit root, pool<SigBit> &leaves, IdString cell_type)
{
if (config.enable_ha && GetSize(leaves) == 2)
{
- leaves.sort();
+ if (!cell_type.in("$_ANDNOT_", "$_ORNOT_"))
+ leaves.sort();
SigBit A = SigSpec(leaves)[0];
SigBit B = SigSpec(leaves)[1];
@@ -237,7 +238,7 @@ struct ExtractFaWorker
}
}
- void find_partitions(SigBit root, pool<SigBit> &leaves, pool<pool<SigBit>> &cache, int maxdepth, int maxbreadth)
+ void find_partitions(SigBit root, pool<SigBit> &leaves, pool<pool<SigBit>> &cache, int maxdepth, int maxbreadth, IdString cell_type)
{
if (cache.count(leaves))
return;
@@ -248,7 +249,7 @@ struct ExtractFaWorker
// log("\n");
cache.insert(leaves);
- check_partition(root, leaves);
+ check_partition(root, leaves, cell_type);
if (maxdepth == 0)
return;
@@ -270,7 +271,7 @@ struct ExtractFaWorker
if (GetSize(new_leaves) > maxbreadth)
continue;
- find_partitions(root, new_leaves, cache, maxdepth-1, maxbreadth);
+ find_partitions(root, new_leaves, cache, maxdepth-1, maxbreadth, cell_type);
}
}
@@ -302,7 +303,7 @@ struct ExtractFaWorker
count_func2 = 0;
count_func3 = 0;
- find_partitions(root, leaves, cache, config.maxdepth, config.maxbreadth);
+ find_partitions(root, leaves, cache, config.maxdepth, config.maxbreadth, it.second->type);
if (config.verbose && count_func2 > 0)
log(" extracted %d two-input functions\n", count_func2);