mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-15 13:28:59 +00:00
Fixed subcircuit allowOverlap=false corner case
This commit is contained in:
parent
b9b990ca2c
commit
40646d3516
|
@ -844,7 +844,7 @@ class SubCircuit::SolverWorker
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool pruneEnumerationMatrix(std::vector<std::set<int>> &enumerationMatrix, const GraphData &needle, const GraphData &haystack, int &nextRow)
|
bool pruneEnumerationMatrix(std::vector<std::set<int>> &enumerationMatrix, const GraphData &needle, const GraphData &haystack, int &nextRow, bool allowOverlap)
|
||||||
{
|
{
|
||||||
bool didSomething = true;
|
bool didSomething = true;
|
||||||
while (didSomething)
|
while (didSomething)
|
||||||
|
@ -854,10 +854,12 @@ class SubCircuit::SolverWorker
|
||||||
for (int i = 0; i < int(enumerationMatrix.size()); i++) {
|
for (int i = 0; i < int(enumerationMatrix.size()); i++) {
|
||||||
std::set<int> newRow;
|
std::set<int> newRow;
|
||||||
for (int j : enumerationMatrix[i]) {
|
for (int j : enumerationMatrix[i]) {
|
||||||
if (checkEnumerationMatrix(enumerationMatrix, i, j, needle, haystack))
|
if (!checkEnumerationMatrix(enumerationMatrix, i, j, needle, haystack))
|
||||||
newRow.insert(j);
|
|
||||||
else
|
|
||||||
didSomething = true;
|
didSomething = true;
|
||||||
|
else if (!allowOverlap && haystack.usedNodes[j])
|
||||||
|
didSomething = true;
|
||||||
|
else
|
||||||
|
newRow.insert(j);
|
||||||
}
|
}
|
||||||
if (newRow.size() == 0)
|
if (newRow.size() == 0)
|
||||||
return false;
|
return false;
|
||||||
|
@ -1028,7 +1030,7 @@ class SubCircuit::SolverWorker
|
||||||
void ullmannRecursion(std::vector<Solver::Result> &results, std::vector<std::set<int>> &enumerationMatrix, int iter, const GraphData &needle, GraphData &haystack, bool allowOverlap, int limitResults)
|
void ullmannRecursion(std::vector<Solver::Result> &results, std::vector<std::set<int>> &enumerationMatrix, int iter, const GraphData &needle, GraphData &haystack, bool allowOverlap, int limitResults)
|
||||||
{
|
{
|
||||||
int i = -1;
|
int i = -1;
|
||||||
if (!pruneEnumerationMatrix(enumerationMatrix, needle, haystack, i))
|
if (!pruneEnumerationMatrix(enumerationMatrix, needle, haystack, i, allowOverlap))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
|
|
Loading…
Reference in a new issue