yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SubCircuit::Solver Class Reference

#include <subcircuit.h>

+ Inheritance diagram for SubCircuit::Solver:
+ Collaboration diagram for SubCircuit::Solver:

Data Structures

struct  MineResult
 
struct  MineResultNode
 
struct  Result
 
struct  ResultNodeMapping
 

Public Member Functions

 Solver ()
 
 ~Solver ()
 
void setVerbose ()
 
void addGraph (std::string graphId, const Graph &graph)
 
void addCompatibleTypes (std::string needleTypeId, std::string haystackTypeId)
 
void addCompatibleConstants (int needleConstant, int haystackConstant)
 
void addSwappablePorts (std::string needleTypeId, std::string portId1, std::string portId2, std::string portId3=std::string(), std::string portId4=std::string())
 
void addSwappablePorts (std::string needleTypeId, std::set< std::string > ports)
 
void addSwappablePortsPermutation (std::string needleTypeId, std::map< std::string, std::string > portMapping)
 
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 ()
 

Protected Member Functions

virtual bool userCompareNodes (const std::string &needleGraphId, const std::string &needleNodeId, void *needleUserData, const std::string &haystackGraphId, const std::string &haystackNodeId, void *haystackUserData, const std::map< std::string, std::string > &portMapping)
 
virtual std::string userAnnotateEdge (const std::string &graphId, const std::string &fromNodeId, void *fromUserData, const std::string &toNodeId, void *toUserData)
 
virtual bool userCompareEdge (const std::string &needleGraphId, const std::string &needleFromNodeId, void *needleFromUserData, const std::string &needleToNodeId, void *needleToUserData, const std::string &haystackGraphId, const std::string &haystackFromNodeId, void *haystackFromUserData, const std::string &haystackToNodeId, void *haystackToUserData)
 
virtual bool userCheckSolution (const Result &result)
 

Private Attributes

SolverWorkerworker
 

Friends

class SolverWorker
 

Detailed Description

Definition at line 92 of file subcircuit.h.

Constructor & Destructor Documentation

SubCircuit::Solver::Solver ( )

Definition at line 1617 of file subcircuit.cc.

1618 {
1619  worker = new SolverWorker(this);
1620 }
friend class SolverWorker
Definition: subcircuit.h:130
SolverWorker * worker
Definition: subcircuit.h:117
SubCircuit::Solver::~Solver ( )

Definition at line 1622 of file subcircuit.cc.

1623 {
1624  delete worker;
1625 }
SolverWorker * worker
Definition: subcircuit.h:117

Member Function Documentation

void SubCircuit::Solver::addCompatibleConstants ( int  needleConstant,
int  haystackConstant 
)

Definition at line 1642 of file subcircuit.cc.

1643 {
1644  worker->addCompatibleConstants(needleConstant, haystackConstant);
1645 }
SolverWorker * worker
Definition: subcircuit.h:117
void addCompatibleConstants(int needleConstant, int haystackConstant)
Definition: subcircuit.cc:1498

+ Here is the caller graph for this function:

void SubCircuit::Solver::addCompatibleTypes ( std::string  needleTypeId,
std::string  haystackTypeId 
)

Definition at line 1637 of file subcircuit.cc.

1638 {
1639  worker->addCompatibleTypes(needleTypeId, haystackTypeId);
1640 }
void addCompatibleTypes(std::string needleTypeId, std::string haystackTypeId)
Definition: subcircuit.cc:1493
SolverWorker * worker
Definition: subcircuit.h:117

+ Here is the caller graph for this function:

void SubCircuit::Solver::addGraph ( std::string  graphId,
const Graph graph 
)

Definition at line 1632 of file subcircuit.cc.

1633 {
1634  worker->addGraph(graphId, graph);
1635 }
void addGraph(std::string graphId, const Graph &graph)
Definition: subcircuit.cc:1483
SolverWorker * worker
Definition: subcircuit.h:117

+ Here is the caller graph for this function:

void SubCircuit::Solver::addSwappablePorts ( std::string  needleTypeId,
std::string  portId1,
std::string  portId2,
std::string  portId3 = std::string(),
std::string  portId4 = std::string() 
)

Definition at line 1647 of file subcircuit.cc.

1648 {
1649  std::set<std::string> ports;
1650  ports.insert(portId1);
1651  ports.insert(portId2);
1652  ports.insert(portId3);
1653  ports.insert(portId4);
1654  ports.erase(std::string());
1655  addSwappablePorts(needleTypeId, ports);
1656 }
void addSwappablePorts(std::string needleTypeId, std::string portId1, std::string portId2, std::string portId3=std::string(), std::string portId4=std::string())
Definition: subcircuit.cc:1647

+ Here is the caller graph for this function:

void SubCircuit::Solver::addSwappablePorts ( std::string  needleTypeId,
std::set< std::string >  ports 
)

Definition at line 1658 of file subcircuit.cc.

1659 {
1660  worker->addSwappablePorts(needleTypeId, ports);
1661 }
SolverWorker * worker
Definition: subcircuit.h:117
void addSwappablePorts(std::string needleTypeId, const std::set< std::string > &ports)
Definition: subcircuit.cc:1503
void SubCircuit::Solver::addSwappablePortsPermutation ( std::string  needleTypeId,
std::map< std::string, std::string >  portMapping 
)

Definition at line 1663 of file subcircuit.cc.

1664 {
1665  worker->addSwappablePortsPermutation(needleTypeId, portMapping);
1666 }
SolverWorker * worker
Definition: subcircuit.h:117
void addSwappablePortsPermutation(std::string needleTypeId, const std::map< std::string, std::string > &portMapping)
Definition: subcircuit.cc:1509

+ Here is the caller graph for this function:

void SubCircuit::Solver::clearConfig ( )

Definition at line 1690 of file subcircuit.cc.

1691 {
1692  worker->clearConfig();
1693 }
SolverWorker * worker
Definition: subcircuit.h:117

+ Here is the caller graph for this function:

void SubCircuit::Solver::clearOverlapHistory ( )

Definition at line 1685 of file subcircuit.cc.

1686 {
1688 }
SolverWorker * worker
Definition: subcircuit.h:117

+ Here is the caller graph for this function:

void SubCircuit::Solver::mine ( std::vector< MineResult > &  results,
int  minNodes,
int  maxNodes,
int  minMatches,
int  limitMatchesPerGraph = -1 
)

Definition at line 1680 of file subcircuit.cc.

1681 {
1682  worker->mine(results, minNodes, maxNodes, minMatches, limitMatchesPerGraph);
1683 }
void mine(std::vector< Solver::MineResult > &results, int minNodes, int maxNodes, int minMatches, int limitMatchesPerGraph)
Definition: subcircuit.cc:1560
SolverWorker * worker
Definition: subcircuit.h:117

+ Here is the caller graph for this function:

void SubCircuit::Solver::setVerbose ( )

Definition at line 1627 of file subcircuit.cc.

1628 {
1629  worker->setVerbose();
1630 }
SolverWorker * worker
Definition: subcircuit.h:117

+ Here is the caller graph for this function:

void SubCircuit::Solver::solve ( std::vector< Result > &  results,
std::string  needleGraphId,
std::string  haystackGraphId,
bool  allowOverlap = true,
int  maxSolutions = -1 
)

Definition at line 1668 of file subcircuit.cc.

1669 {
1670  std::map<std::string, std::set<std::string>> emptyInitialMapping;
1671  worker->solve(results, needleGraphId, haystackGraphId, emptyInitialMapping, allowOverlap, maxSolutions);
1672 }
void solve(std::vector< Solver::Result > &results, std::string needleGraphId, std::string haystackGraphId, const std::map< std::string, std::set< std::string >> &initialMappings, bool allowOverlap, int maxSolutions)
Definition: subcircuit.cc:1515
SolverWorker * worker
Definition: subcircuit.h:117

+ Here is the caller graph for this function:

void SubCircuit::Solver::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 
)

Definition at line 1674 of file subcircuit.cc.

1676 {
1677  worker->solve(results, needleGraphId, haystackGraphId, initialMappings, allowOverlap, maxSolutions);
1678 }
void solve(std::vector< Solver::Result > &results, std::string needleGraphId, std::string haystackGraphId, const std::map< std::string, std::set< std::string >> &initialMappings, bool allowOverlap, int maxSolutions)
Definition: subcircuit.cc:1515
SolverWorker * worker
Definition: subcircuit.h:117
std::string Solver::userAnnotateEdge ( const std::string &  graphId,
const std::string &  fromNodeId,
void *  fromUserData,
const std::string &  toNodeId,
void *  toUserData 
)
protectedvirtual

Definition at line 1602 of file subcircuit.cc.

1603 {
1604  return std::string();
1605 }

+ Here is the caller graph for this function:

bool Solver::userCheckSolution ( const Result result)
protectedvirtual

Definition at line 1612 of file subcircuit.cc.

1613 {
1614  return true;
1615 }

+ Here is the caller graph for this function:

bool Solver::userCompareEdge ( const std::string &  needleGraphId,
const std::string &  needleFromNodeId,
void *  needleFromUserData,
const std::string &  needleToNodeId,
void *  needleToUserData,
const std::string &  haystackGraphId,
const std::string &  haystackFromNodeId,
void *  haystackFromUserData,
const std::string &  haystackToNodeId,
void *  haystackToUserData 
)
protectedvirtual

Definition at line 1607 of file subcircuit.cc.

1608 {
1609  return true;
1610 }

+ Here is the caller graph for this function:

bool Solver::userCompareNodes ( const std::string &  needleGraphId,
const std::string &  needleNodeId,
void *  needleUserData,
const std::string &  haystackGraphId,
const std::string &  haystackNodeId,
void *  haystackUserData,
const std::map< std::string, std::string > &  portMapping 
)
protectedvirtual

Reimplemented in SubCircuitSolver.

Definition at line 1597 of file subcircuit.cc.

1598 {
1599  return true;
1600 }

+ Here is the caller graph for this function:

Friends And Related Function Documentation

friend class SolverWorker
friend

Definition at line 130 of file subcircuit.h.

Field Documentation

SolverWorker* SubCircuit::Solver::worker
private

Definition at line 117 of file subcircuit.h.


The documentation for this class was generated from the following files: