OpenASIP
2.0
|
#include <RegisterQuantityCheck.hh>
Public Member Functions | |
RegisterQuantityCheck () | |
virtual | ~RegisterQuantityCheck () |
virtual bool | check (const TTAMachine::Machine &mach) const |
virtual bool | check (const TTAMachine::Machine &mach, MachineCheckResults &results) const |
bool | checkWithIgnore (const TTAMachine::Machine &mach, const std::set< std::string > &ignoreRFs) const |
bool | checkWithIgnore (const TTAMachine::Machine &mach, MachineCheckResults &results, const std::set< std::string > &ignoreRFs) const |
bool | checkIntRegs (const TTAMachine::Machine &mach) const |
bool | canFixIntRegs (const TTAMachine::Machine &mach) const |
bool | fixIntRegs (TTAMachine::Machine &mach) const |
Public Member Functions inherited from MachineCheck | |
virtual std::string | shortDescription () const |
virtual std::string | description () const |
virtual bool | canFix (const TTAMachine::Machine &mach) const |
virtual std::string | fix (TTAMachine::Machine &mach) const |
virtual | ~MachineCheck () |
Private Types | |
typedef std::pair< const TTAMachine::RegisterFile *, int > | Register |
Private Member Functions | |
void | findGuardRegisters (const TTAMachine::Machine &mach, std::set< Register > ®isters, const std::set< std::string > &ignoreRFs) const |
unsigned int | countIntRegisters (const TTAMachine::Machine &mach, const std::set< Register > &guardRegs, const std::set< std::string > &ignoreRFs) const |
bool | checkPredRegs (const unsigned int ®Count, MachineCheckResults *results) const |
unsigned int | missingIntRegs (const unsigned int ®Count, MachineCheckResults *results, bool isFullyConnected) const |
Private Attributes | |
FullyConnectedCheck | fullyConCheck_ |
Additional Inherited Members | |
Protected Member Functions inherited from MachineCheck | |
MachineCheck (const std::string &shortDesc_) | |
Definition at line 48 of file RegisterQuantityCheck.hh.
|
private |
Definition at line 71 of file RegisterQuantityCheck.hh.
RegisterQuantityCheck::RegisterQuantityCheck | ( | ) |
Definition at line 47 of file RegisterQuantityCheck.cc.
|
virtual |
Definition at line 50 of file RegisterQuantityCheck.cc.
bool RegisterQuantityCheck::canFixIntRegs | ( | const TTAMachine::Machine & | mach | ) | const |
Returns true if an int register file found, meaning int registers can be added.
Definition at line 380 of file RegisterQuantityCheck.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Machine::registerFileNavigator(), and TTAMachine::BaseRegisterFile::width().
Referenced by SimpleICOptimizer::fixIntRegisters().
|
virtual |
Checks register quantities, just returns false if problems where found.
mach | Machine to be checked for registers resources. |
results | MachineCheckResults where possible errors are added. |
Definition at line 61 of file RegisterQuantityCheck.cc.
References FullyConnectedCheck::check(), checkPredRegs(), countIntRegisters(), findGuardRegisters(), fullyConCheck_, and missingIntRegs().
|
virtual |
Checks register quantities.
Stores errors during checking to a MachineCheckResults object given as a parameter.
mach | Machine to be checked for registers resources. |
results | MachineCheckResults where possible errors are added. |
Implements MachineCheck.
Definition at line 96 of file RegisterQuantityCheck.cc.
References checkWithIgnore().
bool RegisterQuantityCheck::checkIntRegs | ( | const TTAMachine::Machine & | mach | ) | const |
Check only if enough integer registers.
mach | Machine to be checked for int registers. |
Definition at line 186 of file RegisterQuantityCheck.cc.
References FullyConnectedCheck::check(), countIntRegisters(), findGuardRegisters(), fullyConCheck_, and missingIntRegs().
Referenced by SimpleICOptimizer::explore(), and SimpleICOptimizer::fixIntRegisters().
|
private |
Checks that there are enough predicate registers.
Outputs errors in MachineCheckResults object if given as a pointer.
regCount | The number of predicate registers. |
results | MachineCheckResults where possible errors are added. |
Definition at line 288 of file RegisterQuantityCheck.cc.
References MachineCheckResults::addError(), and Conversion::toString().
Referenced by check(), and checkWithIgnore().
bool RegisterQuantityCheck::checkWithIgnore | ( | const TTAMachine::Machine & | mach, |
const std::set< std::string > & | ignoreRFs | ||
) | const |
Checks register quantities with an option to ignore some RFs.
Can be passed a list of RFs names that are ignored regarding the test.
mach | Machine to be checked for registers resources. |
ignoreRFs | A sorted list of RFs to be ignored while checking the needed registers. |
Definition at line 116 of file RegisterQuantityCheck.cc.
References FullyConnectedCheck::check(), checkPredRegs(), countIntRegisters(), findGuardRegisters(), fullyConCheck_, and missingIntRegs().
Referenced by check(), and SimpleICOptimizer::removeAllConnections().
bool RegisterQuantityCheck::checkWithIgnore | ( | const TTAMachine::Machine & | mach, |
MachineCheckResults & | results, | ||
const std::set< std::string > & | ignoreRFs | ||
) | const |
Checks register quantities with an option to ignore some RFs.
Can be passed a list of RFs names that are ignored regarding the test. Stores errors during checking to a MachineCheckResults object given as a parameter.
mach | Machine to be checked for registers resources. |
results | MachineCheckResults where possible errors are added. |
ignoreRFs | A sorted list of RFs to be ignored while checking the needed registers. |
Definition at line 156 of file RegisterQuantityCheck.cc.
References FullyConnectedCheck::check(), checkPredRegs(), countIntRegisters(), MachineCheckResults::errorCount(), findGuardRegisters(), fullyConCheck_, and missingIntRegs().
|
private |
Counts integer registers int the given machine.
Doesn't count guard registers given as sorted list of pairs. Can be passed a list of RFs names that are ignored regarding the test.
mach | Machine where integer registers are counted. |
guardRegs | A sorted list of register file, index pairs. |
ignoreRFs | A sorted list of RFs to be ignored while counting the registers. |
Definition at line 254 of file RegisterQuantityCheck.cc.
References AssocTools::containsKey(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::name(), TTAMachine::Machine::registerFileNavigator(), TTAMachine::BaseRegisterFile::size(), and TTAMachine::BaseRegisterFile::width().
Referenced by check(), checkIntRegs(), checkWithIgnore(), and fixIntRegs().
|
private |
Checks register quantities with an option to ignore some RFs.
Can be passed a list of RFs names that are ignored regarding the test.
mach | Machine to be checked for registers resources. |
guardRegs | Counts registers that can be used as guards in the given machine. |
ignoreRFs | A sorted list of RFs to be ignored while checking the needed registers. |
Definition at line 216 of file RegisterQuantityCheck.cc.
References TTAMachine::Machine::busNavigator(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Bus::guard(), TTAMachine::Bus::guardCount(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::name(), TTAMachine::RegisterGuard::registerFile(), and TTAMachine::RegisterGuard::registerIndex().
Referenced by check(), checkIntRegs(), checkWithIgnore(), and fixIntRegs().
bool RegisterQuantityCheck::fixIntRegs | ( | TTAMachine::Machine & | mach | ) | const |
Adds integer registers to an int rf so that requirements are met.
machine | Machine where integer registers are to be added if needed. |
Definition at line 340 of file RegisterQuantityCheck.cc.
References FullyConnectedCheck::check(), TTAMachine::Machine::Navigator< ComponentType >::count(), countIntRegisters(), findGuardRegisters(), fullyConCheck_, TTAMachine::Machine::Navigator< ComponentType >::item(), missingIntRegs(), TTAMachine::Machine::registerFileNavigator(), TTAMachine::RegisterFile::setNumberOfRegisters(), TTAMachine::BaseRegisterFile::size(), and TTAMachine::BaseRegisterFile::width().
Referenced by SimpleICOptimizer::fixIntRegisters().
|
private |
Checks that there are enough integer registers.
Outputs errors in MachineCheckResults object if given as a pointer.
regCount | The number of integer registers. |
results | MachineCheckResults where possible errors are added. |
Definition at line 315 of file RegisterQuantityCheck.cc.
References MachineCheckResults::addError().
Referenced by check(), checkIntRegs(), checkWithIgnore(), and fixIntRegs().
|
private |
Definition at line 88 of file RegisterQuantityCheck.hh.
Referenced by check(), checkIntRegs(), checkWithIgnore(), and fixIntRegs().