aboutsummaryrefslogtreecommitdiffstats
path: root/libs/subcircuit/subcircuit.h
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-03-02 13:53:59 +0100
committerClifford Wolf <clifford@clifford.at>2013-03-02 13:53:59 +0100
commit84cdfa55fc81c233a308c82c5fa6d482b8661ca0 (patch)
tree20c4635bdda03b64503a8ea0808f5e18b48ec7b2 /libs/subcircuit/subcircuit.h
parenta338d1a082726d84210912318a9ac49977dc380c (diff)
downloadyosys-84cdfa55fc81c233a308c82c5fa6d482b8661ca0.tar.gz
yosys-84cdfa55fc81c233a308c82c5fa6d482b8661ca0.tar.bz2
yosys-84cdfa55fc81c233a308c82c5fa6d482b8661ca0.zip
Added frequent subcircuit miner to subcircuit library
Diffstat (limited to 'libs/subcircuit/subcircuit.h')
-rw-r--r--libs/subcircuit/subcircuit.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/subcircuit/subcircuit.h b/libs/subcircuit/subcircuit.h
index da536ba09..b9399a99d 100644
--- a/libs/subcircuit/subcircuit.h
+++ b/libs/subcircuit/subcircuit.h
@@ -73,6 +73,7 @@ namespace SubCircuit
public:
Graph() : allExtern(false) { };
+ Graph(const Graph &other, const std::vector<std::string> &otherNodes);
void createNode(std::string nodeId, std::string typeId, void *userData = NULL);
void createPort(std::string nodeId, std::string portId, int width = 1, int minWidth = -1);
@@ -100,6 +101,17 @@ namespace SubCircuit
std::map<std::string, ResultNodeMapping> mappings;
};
+ struct MineResultNode {
+ std::string nodeId;
+ void *userData;
+ };
+ struct MineResult {
+ std::string graphId;
+ int totalMatchesAfterLimits;
+ std::map<std::string, int> matchesPerGraph;
+ std::vector<MineResultNode> nodes;
+ };
+
private:
SolverWorker *worker;
@@ -131,6 +143,9 @@ namespace SubCircuit
void solve(std::vector<Result> &results, std::string needleGraphId, std::string haystackGraphId, bool allowOverlap = true, int maxSolutions = -1);
void solve(std::vector<Result> &results, std::string needleGraphId, std::string haystackGraphId,
const std::map<std::string, std::set<std::string>> &initialMapping, bool allowOverlap = true, int maxSolutions = -1);
+
+ void mine(std::vector<MineResult> &results, int minNodes, int maxNodes, int minMatches, int limitMatchesPerGraph = -1);
+
void clearOverlapHistory();
void clearConfig();
};