OpenASIP
2.0
|
#include <MinimalOpSetCheck.hh>
Public Member Functions | |
MinimalOpSetCheck () | |
virtual | ~MinimalOpSetCheck () |
virtual bool | check (const TTAMachine::Machine &machine, MachineCheckResults &results) const |
virtual bool | check (const TTAMachine::Machine &machine) const |
bool | checkWithIgnore (const TTAMachine::Machine &machine, const std::set< std::string > &ignoreFUName) const |
void | missingOperations (const TTAMachine::Machine &machine, std::vector< std::string > &missingOps) const |
void | buildMinimalOpSet (const TTAMachine::Machine *machine=NULL) |
TCETools::CIStringSet | minimalOpSet () const |
virtual bool | canFix (const TTAMachine::Machine &mach) const |
virtual std::string | fix (TTAMachine::Machine &machine) const |
Public Member Functions inherited from MachineCheck | |
virtual std::string | shortDescription () const |
virtual std::string | description () const |
virtual | ~MachineCheck () |
Private Attributes | |
TCETools::CIStringSet | minimalOpSet_ |
Additional Inherited Members | |
Protected Member Functions inherited from MachineCheck | |
MachineCheck (const std::string &shortDesc_) | |
MachineCheck to check is the machine fully connected.
Definition at line 53 of file MinimalOpSetCheck.hh.
MinimalOpSetCheck::MinimalOpSetCheck | ( | ) |
Definition at line 46 of file MinimalOpSetCheck.cc.
References buildMinimalOpSet().
|
virtual |
Definition at line 51 of file MinimalOpSetCheck.cc.
void MinimalOpSetCheck::buildMinimalOpSet | ( | const TTAMachine::Machine * | machine = NULL | ) |
Constructs a minimal opset from a given machine.
machine | Machine that is used as reference for minimal opset. |
Definition at line 255 of file MinimalOpSetCheck.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Machine::loadFromADF(), machine, Environment::minimalADF(), minimalOpSet_, and TTAMachine::FunctionUnit::operationNames().
Referenced by MinimalOpSetCheck().
|
virtual |
Returns true if the checker can automatically fix the machine to pass the check.
Reimplemented from MachineCheck.
Definition at line 346 of file MinimalOpSetCheck.cc.
|
virtual |
Checks if machine has all operations in minimal opset.
machine | Machine to be checked against minimal opset. |
Definition at line 61 of file MinimalOpSetCheck.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, minimalOpSet_, and TTAMachine::FunctionUnit::operationNames().
|
virtual |
Checks the machine if it misses operations from the minimal op set.
results | Results of the validation are added to the given instance. |
Implements MachineCheck.
Definition at line 106 of file MinimalOpSetCheck.cc.
References MachineCheckResults::addError(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, minimalOpSet_, and TTAMachine::FunctionUnit::operationNames().
bool MinimalOpSetCheck::checkWithIgnore | ( | const TTAMachine::Machine & | machine, |
const std::set< std::string > & | ignoreFUName | ||
) | const |
Checks if machine has all operations in minimal opset.
Ignores fus with specified names from the check. This is useful with testing if minimal opset requirement breaks if a certain FUs are removed.
machine | Machine to be checked against minimal opset. |
ignoreFUs | Names of the fus to be ignored regarding the check. |
Definition at line 159 of file MinimalOpSetCheck.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, minimalOpSet_, TTAMachine::Component::name(), and TTAMachine::FunctionUnit::operationNames().
Referenced by SimpleICOptimizer::removeAllConnections().
|
virtual |
Adds FUs to the machine so that it doesn't miss operations anymore.
Check is done against minimal opset.
machine | Machine to be checked against minimal opset and where FUs are inserted so that minimal opset is fulfilled. |
Reimplemented from MachineCheck.
Definition at line 298 of file MinimalOpSetCheck.cc.
References __func__, TTAMachine::Machine::addFunctionUnit(), FullyConnectedCheck::connectFUPort(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::FunctionUnit::hasOperation(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Machine::loadFromADF(), Environment::minimalADF(), missingOperations(), TTAMachine::Component::name(), TTAMachine::FunctionUnit::operationPort(), TTAMachine::FunctionUnit::operationPortCount(), and TTAMachine::FunctionUnit::unsetMachine().
Referenced by MinimalOpSet::explore().
TCETools::CIStringSet MinimalOpSetCheck::minimalOpSet | ( | ) | const |
Returns constructed minimal opset.
Definition at line 283 of file MinimalOpSetCheck.cc.
References minimalOpSet_.
void MinimalOpSetCheck::missingOperations | ( | const TTAMachine::Machine & | machine, |
std::vector< std::string > & | missingOps | ||
) | const |
Return operations that are missing from a machine.
Returns operations that are missing from a machine compared to the minimal operation set.
machine | Machine to be checked against minimal opset. |
missingOps | Vector where missing operation names are to be stored. |
Definition at line 213 of file MinimalOpSetCheck.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, minimalOpSet_, and TTAMachine::FunctionUnit::operationNames().
Referenced by ProgrammabilityValidator::checkPrimitiveSet(), MinimalOpSet::explore(), and fix().
|
private |
Definition at line 80 of file MinimalOpSetCheck.hh.
Referenced by buildMinimalOpSet(), check(), checkWithIgnore(), minimalOpSet(), and missingOperations().