OpenASIP
2.0
|
#include <SchedulingResource.hh>
Public Member Functions | |
virtual | ~SchedulingResource () |
SchedulingResource (const std::string &name, const unsigned int ii=0) | |
virtual bool | isInUse (const int cycle) const =0 |
virtual bool | isAvailable (const int cycle) const =0 |
virtual bool | canAssign (const int cycle, const MoveNode &node) const =0 |
virtual void | assign (const int cycle, MoveNode &node)=0 |
virtual void | unassign (const int cycle, MoveNode &node)=0 |
virtual int | relatedResourceGroupCount () const |
virtual int | dependentResourceGroupCount () const |
int | relatedResourceCount (const int group) const |
int | dependentResourceCount (const int group) const |
virtual void | addToRelatedGroup (const int group, SchedulingResource &resource) |
virtual void | addToDependentGroup (const int group, SchedulingResource &resource) |
virtual SchedulingResource & | relatedResource (const int group, const int index) const |
virtual SchedulingResource & | dependentResource (const int group, const int index) const |
virtual bool | hasRelatedResource (const SchedulingResource &sResource) const |
virtual bool | hasDependentResource (const SchedulingResource &sResource) const |
virtual const std::string & | name () const |
virtual int | useCount () const |
virtual void | increaseUseCount () |
virtual void | decreaseUseCount () |
virtual bool | isInputPSocketResource () const |
virtual bool | isOutputPSocketResource () const |
virtual bool | isShortImmPSocketResource () const |
virtual bool | isInputFUResource () const |
virtual bool | isOutputFUResource () const |
virtual bool | isExecutionPipelineResource () const |
virtual bool | isBusResource () const |
virtual bool | isSegmentResource () const |
virtual bool | isIUResource () const |
virtual bool | isITemplateResource () const |
int | instructionIndex (int cycle) const |
void | setInitiationInterval (unsigned int ii) |
int | initiationInterval () const |
virtual bool | operator< (const SchedulingResource &other) const |
virtual void | clear () |
virtual void | setMaxCycle (unsigned int) |
Protected Member Functions | |
virtual bool | validateDependentGroups () |
virtual bool | validateRelatedGroups () |
Protected Attributes | |
int | initiationInterval_ |
Private Types | |
typedef std::vector< SchedulingResource * > | SchedulingResourceVector |
typedef std::vector< SchedulingResourceVector > | SchedulingResourceGroup |
typedef std::set< const SchedulingResource * > | SchedulingResourceSet |
Private Member Functions | |
SchedulingResource (const SchedulingResource &) | |
SchedulingResource & | operator= (const SchedulingResource &) |
Private Attributes | |
SchedulingResourceGroup | relatedResourceGroup_ |
SchedulingResourceGroup | dependentResourceGroup_ |
std::string | name_ |
SchedulingResourceSet | relatedResourceSet_ |
int | useCount_ |
Friends | |
class | ResourceBroker |
An interface for scheduling resources of Resource Model The base class SchedulingResource
Definition at line 52 of file SchedulingResource.hh.
|
private |
Definition at line 138 of file SchedulingResource.hh.
|
private |
Definition at line 151 of file SchedulingResource.hh.
|
private |
Definition at line 136 of file SchedulingResource.hh.
|
virtual |
SchedulingResource::SchedulingResource | ( | const std::string & | name, |
const unsigned int | ii = 0 |
||
) |
|
private |
|
virtual |
Add resource to group of dependent resources.
group | Group to which resource add. |
resource | Resource to add to group. |
Definition at line 101 of file SchedulingResource.cc.
References dependentResourceGroup_, and dependentResourceGroupCount().
Referenced by OutputFUBroker::setupResourceLinks(), InputFUBroker::setupResourceLinks(), and ITemplateBroker::setupResourceLinks().
|
virtual |
Add resource to group of related resources.
group | Group to which resource add. |
resource | Resource to add to group. |
Definition at line 82 of file SchedulingResource.cc.
References relatedResourceGroup_, relatedResourceGroupCount(), and relatedResourceSet_.
Referenced by ExecutionPipelineBroker::setupResourceLinks(), InputPSocketBroker::setupResourceLinks(), OutputPSocketBroker::setupResourceLinks(), IUBroker::setupResourceLinks(), and BusBroker::setupResourceLinks().
|
pure virtual |
Implemented in ExecutionPipelineResource, IUResource, OutputFUResource, BusResource, ITemplateResource, OutputPSocketResource, FUResource, InputFUResource, and PSocketResource.
Referenced by InputPSocketBroker::assign(), and OutputPSocketBroker::assign().
|
pure virtual |
Implemented in IUResource, ExecutionPipelineResource, OutputPSocketResource, BusResource, ITemplateResource, OutputFUResource, FUResource, InputFUResource, PSocketResource, and InputPSocketResource.
Referenced by InputPSocketBroker::allAvailableResources(), OutputPSocketBroker::allAvailableResources(), ResourceBroker::availableResource(), OutputPSocketBroker::isAnyResourceAvailable(), and ResourceBroker::isAnyResourceAvailable().
|
virtual |
Clears bookkeeping of the scheduling resource.
After this call the state of the resource should be identical to a newly-created and initialized resource.
Reimplemented in ExecutionPipelineResource, IUResource, BusResource, ITemplateResource, OutputPSocketResource, and PSocketResource.
Definition at line 397 of file SchedulingResource.cc.
References useCount_.
Referenced by PSocketResource::clear(), ITemplateResource::clear(), BusResource::clear(), IUResource::clear(), and ExecutionPipelineResource::clear().
|
virtual |
Decrease use count of Schedulign Resource by 1
Definition at line 364 of file SchedulingResource.cc.
References useCount_.
Referenced by PSocketResource::unassign(), InputFUResource::unassign(), and OutputFUResource::unassign().
|
virtual |
Return dependent resource from group with position.
group | Group from which to return resource. |
index | Index of resource in particular group. |
OutOfRange | When group or index requested does not exist. |
Definition at line 158 of file SchedulingResource.cc.
References __func__, dependentResourceCount(), dependentResourceGroup_, dependentResourceGroupCount(), name(), and Conversion::toString().
Referenced by InputFUResource::assign(), OutputFUResource::assign(), OutputFUResource::canAssign(), InputFUResource::canAssign(), hasDependentResource(), FUResource::isAvailable(), InputFUResource::isAvailable(), FUResource::isInUse(), InputFUResource::isInUse(), FUResource::operator<(), InputFUResource::unassign(), OutputFUResource::unassign(), OutputFUResource::validateDependentGroups(), ITemplateResource::validateDependentGroups(), and InputFUResource::validateDependentGroups().
|
inline |
Referenced by InputFUResource::assign(), OutputFUResource::assign(), OutputFUResource::canAssign(), InputFUResource::canAssign(), dependentResource(), hasDependentResource(), FUResource::isAvailable(), InputFUResource::isAvailable(), FUResource::isInUse(), InputFUResource::isInUse(), FUResource::operator<(), InputFUResource::unassign(), OutputFUResource::unassign(), InputPSocketResource::validateDependentGroups(), OutputPSocketResource::validateDependentGroups(), OutputFUResource::validateDependentGroups(), ITemplateResource::validateDependentGroups(), and InputFUResource::validateDependentGroups().
|
virtual |
Return number of groups of dependent resources.
Definition at line 71 of file SchedulingResource.cc.
References dependentResourceGroup_.
Referenced by addToDependentGroup(), InputFUResource::assign(), OutputFUResource::assign(), OutputFUResource::canAssign(), InputFUResource::canAssign(), dependentResource(), hasDependentResource(), FUResource::isAvailable(), InputFUResource::isAvailable(), FUResource::isInUse(), InputFUResource::isInUse(), InputFUResource::unassign(), OutputFUResource::unassign(), InputPSocketResource::validateDependentGroups(), OutputPSocketResource::validateDependentGroups(), OutputFUResource::validateDependentGroups(), InputFUResource::validateDependentGroups(), and ITemplateResource::validateDependentGroups().
|
virtual |
Return true if resource contains given dependent resource.
sResource | Resource to test. |
Definition at line 207 of file SchedulingResource.cc.
References dependentResource(), dependentResourceCount(), dependentResourceGroupCount(), and name().
Referenced by InputFUResource::canAssign().
|
virtual |
Return true if resource contains given related resource.
sResource | Resource to test. |
Definition at line 194 of file SchedulingResource.cc.
References relatedResourceSet_.
Referenced by BusResource::canAssign(), and BusResource::isAvailable().
|
virtual |
Increases use count of Scheduling Resource by 1
Definition at line 355 of file SchedulingResource.cc.
References useCount_.
Referenced by InputFUResource::assign(), PSocketResource::assign(), BusResource::assign(), and OutputFUResource::assign().
int SchedulingResource::initiationInterval | ( | ) | const |
Get initiation interval, if ii = 0 then initiation interval is not used.
Definition at line 385 of file SchedulingResource.cc.
References initiationInterval_.
Referenced by ExecutionPipelineResource::operandAllowedAtCycle(), and ExecutionPipelineResource::resourcesAllowTrigger().
|
inline |
Referenced by PSocketResource::assign(), OutputPSocketResource::assign(), BusResource::assign(), ITemplateResource::assign(), ExecutionPipelineResource::assignDestination(), ExecutionPipelineResource::assignSource(), OutputPSocketResource::canAssign(), IUResource::canAssign(), IUResource::canAssignUse(), ExecutionPipelineResource::checkOperandAllowed(), ExecutionPipelineResource::cyclesOverlap(), IUResource::findAvailable(), ExecutionPipelineResource::hasConflictingResultsOnCycle(), PSocketResource::isAvailable(), IUResource::isAvailable(), ExecutionPipelineResource::isAvailable(), PSocketResource::isInUse(), BusResource::isInUse(), ITemplateResource::isInUse(), IUResource::isInUse(), ExecutionPipelineResource::isInUse(), ExecutionPipelineResource::nextResultCycle(), ExecutionPipelineResource::operandAllowedAtCycle(), ExecutionPipelineResource::operandOverwritten(), ExecutionPipelineResource::operandPossibleAtCycle(), ExecutionPipelineResource::operandSharePreventsTriggerForScheduledResult(), ExecutionPipelineResource::otherTriggerBeforeMyTrigger(), ExecutionPipelineResource::resourcesAllowTrigger(), ExecutionPipelineResource::resultAllowedAtCycle(), ExecutionPipelineResource::resultCausesTriggerBetweenOperandSharing(), ExecutionPipelineResource::resultNotOverWritten(), ExecutionPipelineResource::setOperandUsed(), ExecutionPipelineResource::setResultWriten(), PSocketResource::unassign(), OutputPSocketResource::unassign(), BusResource::unassign(), ITemplateResource::unassign(), ExecutionPipelineResource::unassignDestination(), ExecutionPipelineResource::unassignSource(), ExecutionPipelineResource::unsetOperandUsed(), and ExecutionPipelineResource::unsetResultWriten().
|
pure virtual |
Implemented in ExecutionPipelineResource, IUResource, InputFUResource, ITemplateResource, OutputPSocketResource, BusResource, FUResource, and PSocketResource.
Referenced by ResourceBroker::availableResource(), ResourceBroker::isAnyResourceAvailable(), FUResource::isAvailable(), and InputFUResource::isAvailable().
|
virtual |
|
virtual |
Reimplemented in ExecutionPipelineResource.
Referenced by InputFUResource::assign(), OutputFUResource::assign(), OutputFUResource::canAssign(), InputFUResource::canAssign(), InputFUResource::isAvailable(), InputFUResource::isInUse(), OutputFUBroker::setupResourceLinks(), InputFUBroker::setupResourceLinks(), InputFUResource::unassign(), OutputFUResource::unassign(), OutputFUResource::validateDependentGroups(), and InputFUResource::validateDependentGroups().
|
virtual |
Reimplemented in InputFUResource.
Referenced by InputFUBroker::allAvailableResources(), and InputPSocketResource::validateRelatedGroups().
|
virtual |
Reimplemented in InputPSocketResource.
Referenced by BusResource::canAssign(), FUResource::isAvailable(), OutputFUResource::validateDependentGroups(), InputFUResource::validateDependentGroups(), BusResource::validateRelatedGroups(), IUResource::validateRelatedGroups(), and ExecutionPipelineResource::validateRelatedGroups().
|
pure virtual |
Implemented in ExecutionPipelineResource, IUResource, InputFUResource, ITemplateResource, BusResource, FUResource, and PSocketResource.
Referenced by IUResource::canAssign(), IUResource::canAssignUse(), InputPSocketBroker::isAlreadyAssigned(), OutputPSocketBroker::isAlreadyAssigned(), ITemplateBroker::isAlreadyAssigned(), FUResource::isInUse(), and InputFUResource::isInUse().
|
virtual |
Reimplemented in ITemplateResource.
Referenced by IUResource::validateRelatedGroups().
|
virtual |
Reimplemented in IUResource.
Referenced by ITemplateResource::validateDependentGroups(), and OutputPSocketResource::validateRelatedGroups().
|
virtual |
Reimplemented in OutputFUResource.
Referenced by OutputPSocketResource::validateRelatedGroups().
|
virtual |
Reimplemented in OutputPSocketResource.
Referenced by BusResource::canAssign(), IUResource::canAssign(), IUResource::canAssignUse(), FUResource::isAvailable(), OutputFUResource::validateDependentGroups(), InputFUResource::validateDependentGroups(), BusResource::validateRelatedGroups(), and IUResource::validateRelatedGroups().
|
virtual |
|
virtual |
Reimplemented in ShortImmPSocketResource.
Referenced by BusBroker::findImmResource().
|
virtual |
Referenced by IUResource::assign(), ExecutionPipelineResource::assignDestination(), InputFUResource::canAssign(), dependentResource(), hasDependentResource(), ResourceBroker::machinePartOf(), FUResource::operator<(), relatedResource(), ExecutionPipelineBroker::setupResourceLinks(), and BusResource::unassign().
|
virtual |
Reimplemented in BusResource, ITemplateResource, OutputPSocketResource, FUResource, and InputPSocketResource.
Referenced by ITemplateResource::operator<().
|
private |
|
virtual |
Return related resource from group with position.
group | Group from which to return resource. |
index | Index of resource in particular group. |
OutOfRange | When group or index requested does not exist. |
Definition at line 120 of file SchedulingResource.cc.
References __func__, name(), relatedResourceCount(), relatedResourceGroup_, relatedResourceGroupCount(), and Conversion::toString().
Referenced by IUResource::canAssign(), IUResource::canAssignUse(), BusBroker::findImmResource(), InputPSocketResource::operator<(), OutputPSocketResource::operator<(), InputPSocketResource::validateRelatedGroups(), ShortImmPSocketResource::validateRelatedGroups(), OutputPSocketResource::validateRelatedGroups(), BusResource::validateRelatedGroups(), IUResource::validateRelatedGroups(), and ExecutionPipelineResource::validateRelatedGroups().
|
inline |
Referenced by IUResource::canAssign(), IUResource::canAssignUse(), BusBroker::findImmResource(), InputPSocketResource::operator<(), FUResource::operator<(), OutputPSocketResource::operator<(), relatedResource(), InputPSocketResource::validateRelatedGroups(), ShortImmPSocketResource::validateRelatedGroups(), OutputPSocketResource::validateRelatedGroups(), OutputFUResource::validateRelatedGroups(), ITemplateResource::validateRelatedGroups(), InputFUResource::validateRelatedGroups(), BusResource::validateRelatedGroups(), IUResource::validateRelatedGroups(), and ExecutionPipelineResource::validateRelatedGroups().
|
virtual |
Return number of groups of related resources.
Definition at line 61 of file SchedulingResource.cc.
References relatedResourceGroup_.
Referenced by addToRelatedGroup(), IUResource::canAssign(), IUResource::canAssignUse(), relatedResource(), InputPSocketResource::validateRelatedGroups(), ShortImmPSocketResource::validateRelatedGroups(), OutputPSocketResource::validateRelatedGroups(), OutputFUResource::validateRelatedGroups(), InputFUResource::validateRelatedGroups(), ITemplateResource::validateRelatedGroups(), BusResource::validateRelatedGroups(), IUResource::validateRelatedGroups(), and ExecutionPipelineResource::validateRelatedGroups().
void SchedulingResource::setInitiationInterval | ( | unsigned int | ii | ) |
Set initiation interval, if ii = 0 then initiation interval is not used.
ii | initiation interval |
Definition at line 374 of file SchedulingResource.cc.
References initiationInterval_.
|
inlinevirtual |
Reimplemented in ExecutionPipelineResource.
Definition at line 122 of file SchedulingResource.hh.
|
pure virtual |
Implemented in ExecutionPipelineResource, IUResource, OutputFUResource, ITemplateResource, BusResource, InputFUResource, OutputPSocketResource, FUResource, and PSocketResource.
Referenced by OutputFUBroker::unassign(), InputPSocketBroker::unassign(), and OutputPSocketBroker::unassign().
|
virtual |
Returns how many times particular scheduling resource was used
Definition at line 346 of file SchedulingResource.cc.
References useCount_.
Referenced by FUResource::operator<().
|
protectedvirtual |
Reimplemented in ExecutionPipelineResource, IUResource, BusResource, InputFUResource, ITemplateResource, OutputFUResource, OutputPSocketResource, and InputPSocketResource.
|
protectedvirtual |
|
friend |
Definition at line 118 of file SchedulingResource.hh.
|
private |
Definition at line 147 of file SchedulingResource.hh.
Referenced by addToDependentGroup(), dependentResource(), and dependentResourceGroupCount().
|
protected |
Definition at line 132 of file SchedulingResource.hh.
Referenced by ExecutionPipelineResource::assignSource(), ExecutionPipelineResource::canAssignDestination(), ExecutionPipelineResource::canAssignSource(), ExecutionPipelineResource::highestKnownCycle(), initiationInterval(), ExecutionPipelineResource::latestTriggerWriteCycle(), ExecutionPipelineResource::nextResultCycle(), ExecutionPipelineResource::operandOverwritten(), ExecutionPipelineResource::resultAllowedAtCycle(), ExecutionPipelineResource::resultCausesTriggerBetweenOperandSharing(), ExecutionPipelineResource::resultNotOverWritten(), setInitiationInterval(), ExecutionPipelineResource::testTriggerResult(), ExecutionPipelineResource::unassignDestination(), and ExecutionPipelineResource::unassignSource().
|
private |
Definition at line 149 of file SchedulingResource.hh.
|
private |
Definition at line 145 of file SchedulingResource.hh.
Referenced by addToRelatedGroup(), relatedResource(), and relatedResourceGroupCount().
|
private |
Definition at line 152 of file SchedulingResource.hh.
Referenced by addToRelatedGroup(), and hasRelatedResource().
|
private |
Definition at line 155 of file SchedulingResource.hh.
Referenced by clear(), decreaseUseCount(), increaseUseCount(), and useCount().