OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
AddressSpaceCheck Class Reference

#include <AddressSpaceCheck.hh>

Inheritance diagram for AddressSpaceCheck:
Inheritance graph
Collaboration diagram for AddressSpaceCheck:
Collaboration graph

Public Member Functions

 AddressSpaceCheck (OperationPool &operationPool)
 
virtual ~AddressSpaceCheck ()
 
virtual bool check (const TTAMachine::Machine &mach, MachineCheckResults &results) 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 Attributes

OperationPooloperationPool_
 

Additional Inherited Members

- Protected Member Functions inherited from MachineCheck
 MachineCheck (const std::string &shortDesc_)
 

Detailed Description

MachineCheck to check if the FUs' operations access memory and there is a memory address space available for them.

Definition at line 50 of file AddressSpaceCheck.hh.

Constructor & Destructor Documentation

◆ AddressSpaceCheck()

AddressSpaceCheck::AddressSpaceCheck ( OperationPool operationPool)

The constructor.

Parameters
operationPooloperation pool to search the operations for

Definition at line 51 of file AddressSpaceCheck.cc.

51 :
52 MachineCheck("Address space check."),
53 operationPool_(operationPool) {
54}
OperationPool & operationPool_

◆ ~AddressSpaceCheck()

AddressSpaceCheck::~AddressSpaceCheck ( )
virtual

The destructor.

Definition at line 59 of file AddressSpaceCheck.cc.

59 {
60}

Member Function Documentation

◆ check()

bool AddressSpaceCheck::check ( const TTAMachine::Machine mach,
MachineCheckResults results 
) const
virtual

Checks that if the FUs' operations access memory, there is a memory address space available for them.

Parameters
machMachine to be checked.
resultsCheck results.
Returns
True if the check passed

Implements MachineCheck.

Definition at line 71 of file AddressSpaceCheck.cc.

73 {
74
76 for (int i = 0; i < FUs.count(); i++) {
77 FunctionUnit* unit = FUs.item(i);
78
79 if (unit->addressSpace() != NULL) {
80 continue;
81 }
82
83 for (int j = 0; j < unit->operationCount(); ++j) {
84 Operation& op =
85 operationPool_.operation(unit->operation(j)->name().c_str());
86
87 // skip any Nulloperations because the check is done elsewhere
88 if (&op == &NullOperation::instance()) {
89 continue;
90 }
91
92 if (op.usesMemory() && unit->addressSpace() == NULL) {
93 results.addError(*this,
94 std::string("operation ") + op.name() + " accesses memory" +
95 " but the memory address space was not set.");
96 return false;
97 }
98 }
99 } // end for all FUs
100
101 return true;
102}
void addError(const MachineCheck &check, const std::string &errorMsg)
static NullOperation & instance()
Operation & operation(const char *name)
virtual TCEString name() const
Definition Operation.cc:93
virtual bool usesMemory() const
Definition Operation.cc:232
virtual AddressSpace * addressSpace() const
virtual HWOperation * operation(const std::string &name) const
virtual int operationCount() const
const std::string & name() const
ComponentType * item(int index) const
virtual FunctionUnitNavigator functionUnitNavigator() const
Definition Machine.cc:380

References MachineCheckResults::addError(), TTAMachine::FunctionUnit::addressSpace(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::functionUnitNavigator(), NullOperation::instance(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::HWOperation::name(), Operation::name(), OperationPool::operation(), TTAMachine::FunctionUnit::operation(), TTAMachine::FunctionUnit::operationCount(), operationPool_, and Operation::usesMemory().

Referenced by MachineStateBuilder::buildMachineState().

Here is the call graph for this function:

Member Data Documentation

◆ operationPool_

OperationPool& AddressSpaceCheck::operationPool_
private

Definition at line 59 of file AddressSpaceCheck.hh.

Referenced by check().


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