3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-06 03:10:26 +00:00

Added "shared nodes" feature to the subcircuit library

This commit is contained in:
Clifford Wolf 2013-03-03 21:19:55 +01:00
parent 3ebc365c09
commit bc8d94b4ae
4 changed files with 14 additions and 9 deletions

View file

@ -100,7 +100,7 @@ bool SubCircuit::Graph::BitRef::operator < (const BitRef &other) const
return bitIdx < other.bitIdx;
}
void SubCircuit::Graph::createNode(std::string nodeId, std::string typeId, void *userData)
void SubCircuit::Graph::createNode(std::string nodeId, std::string typeId, void *userData, bool shared)
{
assert(nodeMap.count(nodeId) == 0);
nodeMap[nodeId] = nodes.size();
@ -110,6 +110,7 @@ void SubCircuit::Graph::createNode(std::string nodeId, std::string typeId, void
newNode.nodeId = nodeId;
newNode.typeId = typeId;
newNode.userData = userData;
newNode.shared = shared;
}
void SubCircuit::Graph::createPort(std::string nodeId, std::string portId, int width, int minWidth)
@ -1074,7 +1075,8 @@ class SubCircuit::SolverWorker
}
for (int j = 0; j < int(enumerationMatrix.size()); j++)
haystack.usedNodes[*enumerationMatrix[j].begin()] = true;
if (!haystack.graph.nodes[*enumerationMatrix[j].begin()].shared)
haystack.usedNodes[*enumerationMatrix[j].begin()] = true;
if (verbose) {
my_printf("\nSolution:\n");