OpenASIP
2.0
|
#include <FullyConnectedCheck.hh>
Public Member Functions | |
FullyConnectedCheck () | |
virtual | ~FullyConnectedCheck () |
virtual bool | check (const TTAMachine::Machine &mach) const |
virtual bool | check (const TTAMachine::Machine &mach, MachineCheckResults &results) const |
virtual bool | canFix (const TTAMachine::Machine &mach) const |
virtual std::string | fix (TTAMachine::Machine &mach) const |
void | connectFUPort (TTAMachine::FUPort &port) const |
void | connectSpecialRegisterPort (TTAMachine::SpecialRegisterPort &port) const |
void | connectControlUnit (TTAMachine::ControlUnit &gcu) const |
Public Member Functions inherited from MachineCheck | |
virtual std::string | shortDescription () const |
virtual std::string | description () const |
virtual | ~MachineCheck () |
Protected Member Functions | |
FullyConnectedCheck (const std::string &shortDesc) | |
Protected Member Functions inherited from MachineCheck | |
MachineCheck (const std::string &shortDesc_) | |
Private Member Functions | |
void | connectIUPort (TTAMachine::RFPort &port) const |
void | connectRFPort (TTAMachine::RFPort &port, TTAMachine::Socket::Direction direction) const |
TTAMachine::Socket * | createSocket (const TTAMachine::Unit &unit, TTAMachine::Socket::Direction direction) const |
void | attachSocketToAllBusses (TTAMachine::Socket &socket) const |
bool | socketAttachedToAllBusses (const TTAMachine::Socket &socket) const |
MachineCheck to check is the machine fully connected.
Definition at line 51 of file FullyConnectedCheck.hh.
FullyConnectedCheck::FullyConnectedCheck | ( | ) |
Constructor for using this generic class directly.
Definition at line 52 of file FullyConnectedCheck.cc.
|
virtual |
|
protected |
Constructor for deriving.
shortDesc | The short description of the check. |
Definition at line 61 of file FullyConnectedCheck.cc.
|
private |
Attaches given socket to all possible busses.
socket | Socket to connect. |
Definition at line 552 of file FullyConnectedCheck.cc.
References TTAMachine::Socket::attachBus(), TTAMachine::Machine::busNavigator(), MachineTester::canConnect(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Socket::isConnectedTo(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, TTAMachine::Component::machine(), TTAMachine::Bus::segment(), and TTAMachine::Bus::segmentCount().
Referenced by createSocket(), and fix().
|
virtual |
Returns true if the machine can be fixed to pass the check.
mach | The machine to be analyzed. |
Reimplemented from MachineCheck.
Definition at line 78 of file FullyConnectedCheck.cc.
References TTAMachine::Machine::bridgeNavigator(), TTAMachine::Machine::busNavigator(), and TTAMachine::Machine::Navigator< ComponentType >::count().
Referenced by fix(), and FullyConnectBussesCmd::isEnabled().
|
virtual |
Checks is the machine fully connected.
mach | Machine to be checked. |
Definition at line 99 of file FullyConnectedCheck.cc.
References TTAMachine::Machine::controlUnit(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::Machine::immediateUnitNavigator(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::FunctionUnit::operationPort(), TTAMachine::FunctionUnit::operationPortCount(), TTAMachine::BaseRegisterFile::port(), TTAMachine::Unit::portCount(), TTAMachine::Machine::registerFileNavigator(), socketAttachedToAllBusses(), TTAMachine::Port::socketCount(), and TTAMachine::Machine::socketNavigator().
Referenced by RegisterQuantityCheck::check(), RegisterQuantityCheck::checkIntRegs(), RegisterQuantityCheck::checkWithIgnore(), RegisterQuantityCheck::fixIntRegs(), and FullyConnectBussesCmd::isEnabled().
|
virtual |
Checks is the machine fully connected and adds errors to results.
mach | Machine to be checked. |
results | Check results. |
Implements MachineCheck.
Definition at line 170 of file FullyConnectedCheck.cc.
References MachineCheckResults::addError(), TTAMachine::Machine::controlUnit(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::Machine::immediateUnitNavigator(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Port::name(), TTAMachine::Component::name(), TTAMachine::FunctionUnit::operationPort(), TTAMachine::FunctionUnit::operationPortCount(), TTAMachine::BaseRegisterFile::port(), TTAMachine::Unit::portCount(), TTAMachine::Machine::registerFileNavigator(), socketAttachedToAllBusses(), TTAMachine::Port::socketCount(), TTAMachine::Machine::socketNavigator(), TTAMachine::ControlUnit::specialRegisterPort(), and TTAMachine::ControlUnit::specialRegisterPortCount().
void FullyConnectedCheck::connectControlUnit | ( | TTAMachine::ControlUnit & | gcu | ) | const |
Definition at line 363 of file FullyConnectedCheck.cc.
References connectFUPort(), connectSpecialRegisterPort(), TTAMachine::FunctionUnit::operationPort(), TTAMachine::FunctionUnit::operationPortCount(), TTAMachine::Port::socketCount(), TTAMachine::ControlUnit::specialRegisterPort(), and TTAMachine::ControlUnit::specialRegisterPortCount().
Referenced by ADFCombiner::addFunctionUnits(), and fix().
void FullyConnectedCheck::connectFUPort | ( | TTAMachine::FUPort & | port | ) | const |
Creates socket(s) and connects a FU port to all possible busses.
port | FU port to connect to busses. |
Definition at line 497 of file FullyConnectedCheck.cc.
References TTAMachine::Port::attachSocket(), TTAMachine::Machine::busNavigator(), MachineTester::canConnect(), createSocket(), TTAMachine::Port::inputSocket(), TTAMachine::ExecutionPipeline::isPortRead(), TTAMachine::ExecutionPipeline::isPortWritten(), TTAMachine::HWOperation::latency(), machine, TTAMachine::Component::machine(), TTAMachine::FunctionUnit::operation(), TTAMachine::FunctionUnit::operationCount(), TTAMachine::Port::outputSocket(), TTAMachine::BaseFUPort::parentUnit(), TTAMachine::HWOperation::pipeline(), and TTAMachine::Machine::socketNavigator().
Referenced by connectControlUnit(), fix(), and MinimalOpSetCheck::fix().
|
private |
Connects an immediate unit port to all possible busses.
port | Immediate unit port to connect. |
Definition at line 383 of file FullyConnectedCheck.cc.
References TTAMachine::Port::attachSocket(), MachineTester::canConnect(), createSocket(), TTAMachine::Component::machine(), and TTAMachine::RFPort::parentUnit().
Referenced by fix().
|
private |
Connects a register file port to all possible busses.
port | Immediate unit port to connect. |
Definition at line 430 of file FullyConnectedCheck.cc.
References TTAMachine::Port::attachSocket(), MachineTester::canConnect(), createSocket(), TTAMachine::Component::machine(), and TTAMachine::RFPort::parentUnit().
Referenced by fix().
void FullyConnectedCheck::connectSpecialRegisterPort | ( | TTAMachine::SpecialRegisterPort & | port | ) | const |
Connects a special register port to all possible busses.
port | Special register port to connect. |
Definition at line 402 of file FullyConnectedCheck.cc.
References TTAMachine::Port::attachSocket(), MachineTester::canConnect(), createSocket(), TTAMachine::Component::machine(), and TTAMachine::BaseFUPort::parentUnit().
Referenced by connectControlUnit().
|
private |
Creates a new socket to be attached to an unit.
unit | Unit whose name is used to generate a name for the socket. |
direction | Direction of the socket. |
Definition at line 454 of file FullyConnectedCheck.cc.
References attachSocketToAllBusses(), TTAMachine::Machine::Navigator< ComponentType >::hasItem(), machine, TTAMachine::Component::machine(), TTAMachine::Component::name(), TTAMachine::Socket::segmentCount(), TTAMachine::Socket::setDirection(), TTAMachine::Socket::setMachine(), TTAMachine::Machine::socketNavigator(), and Conversion::toString().
Referenced by connectFUPort(), connectIUPort(), connectRFPort(), and connectSpecialRegisterPort().
|
virtual |
Fixes the machine to pass the chek if possible.
mach | Machine to be fixed. |
InvalidData | Thows if the machine cannot be fixed. |
Reimplemented from MachineCheck.
Definition at line 267 of file FullyConnectedCheck.cc.
References __func__, attachSocketToAllBusses(), canFix(), connectControlUnit(), connectFUPort(), connectIUPort(), connectRFPort(), TTAMachine::Machine::controlUnit(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::Machine::immediateUnitNavigator(), TTAMachine::Port::inputSocket(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::RegisterFile::maxReads(), TTAMachine::RegisterFile::maxWrites(), TTAMachine::FunctionUnit::operationPort(), TTAMachine::FunctionUnit::operationPortCount(), TTAMachine::Port::outputSocket(), TTAMachine::BaseRegisterFile::port(), TTAMachine::Unit::portCount(), TTAMachine::Machine::registerFileNavigator(), TTAMachine::Port::socketCount(), and TTAMachine::Machine::socketNavigator().
Referenced by MachineResourceModifier::addBusesByAmount(), FullyConnectBussesCmd::Do(), MachineResourceModifier::increaseAllFUsThatDiffersByAmount(), MachineResourceModifier::increaseAllRFsThatDiffersByAmount(), MachineResourceModifier::percentualFUIncrease(), and MachineResourceModifier::percentualRegisterIncrease().
|
private |
Checks if the given socket is attached to all possible busses.
socket | Socket to check. |
Definition at line 581 of file FullyConnectedCheck.cc.
References TTAMachine::Machine::busNavigator(), MachineTester::canConnect(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Socket::isConnectedTo(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, TTAMachine::Component::machine(), TTAMachine::Bus::segment(), and TTAMachine::Bus::segmentCount().
Referenced by check().