OpenASIP
2.0
|
#include <FUResource.hh>
Public Member Functions | |
FUResource (const std::string &name, int operationCount, int nopSlotWeight, unsigned int initiationInterval=0) | |
virtual | ~FUResource () |
virtual bool | isInUse (const int cycle) const override |
virtual bool | isAvailable (const int cycle) const override |
virtual bool | canAssign (const int cycle, const MoveNode &node) const override |
virtual void | assign (const int cycle, MoveNode &node) override |
virtual void | unassign (const int cycle, MoveNode &node) override |
virtual bool | operator< (const SchedulingResource &other) const override |
Public Member Functions inherited from SchedulingResource | |
virtual | ~SchedulingResource () |
SchedulingResource (const std::string &name, const unsigned int ii=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 void | clear () |
virtual void | setMaxCycle (unsigned int) |
Private Member Functions | |
FUResource (const FUResource &) | |
FUResource & | operator= (const FUResource &) |
Private Attributes | |
int | opCount_ |
int | nopSlotWeight_ |
Additional Inherited Members | |
Protected Member Functions inherited from SchedulingResource | |
virtual bool | validateDependentGroups () |
virtual bool | validateRelatedGroups () |
Protected Attributes inherited from SchedulingResource | |
int | initiationInterval_ |
An interface for scheduling FU resources of Resource Model
Definition at line 46 of file FUResource.hh.
FUResource::FUResource | ( | const std::string & | name, |
int | opCount, | ||
int | nopSlotWeight, | ||
unsigned int | initiationInterval = 0 |
||
) |
Constructor defining resource name
name | Name of resource |
Definition at line 43 of file FUResource.cc.
|
virtual |
|
private |
|
overridevirtual |
Assign resource to given node for given cycle
cycle | Cycle to assign |
node | MoveNode assigned |
Implements SchedulingResource.
Reimplemented in OutputFUResource, and InputFUResource.
Definition at line 100 of file FUResource.cc.
References abortWithError.
|
overridevirtual |
Return true if resource can be assigned for given resource in given cycle
cycle | Cycle to test |
node | MoveNode to test |
Implements SchedulingResource.
Reimplemented in OutputFUResource, and InputFUResource.
Definition at line 125 of file FUResource.cc.
References abortWithError.
|
overridevirtual |
Test if resource FUResource is available. Not all of the PSocket are inUse.
cycle | Cycle which to test |
Implements SchedulingResource.
Reimplemented in InputFUResource.
Definition at line 80 of file FUResource.cc.
References SchedulingResource::dependentResource(), SchedulingResource::dependentResourceCount(), SchedulingResource::dependentResourceGroupCount(), SchedulingResource::isAvailable(), SchedulingResource::isInputPSocketResource(), and SchedulingResource::isOutputPSocketResource().
Referenced by InputFUResource::isAvailable().
|
overridevirtual |
Test if resource FUResource is used in given cycle, meaning InputPSocket or OutputPSocket is in use or ExecutionPipeline is inUse.
cycle | Cycle which to test |
Implements SchedulingResource.
Reimplemented in InputFUResource.
Definition at line 62 of file FUResource.cc.
References SchedulingResource::dependentResource(), SchedulingResource::dependentResourceCount(), SchedulingResource::dependentResourceGroupCount(), and SchedulingResource::isInUse().
Referenced by InputFUResource::isInUse().
|
overridevirtual |
Comparison operator.
Favours least used FU's and FU's with less operations.
Reimplemented from SchedulingResource.
Definition at line 137 of file FUResource.cc.
References SchedulingResource::dependentResource(), SchedulingResource::dependentResourceCount(), SchedulingResource::name(), nopSlotWeight_, opCount_, SchedulingResource::relatedResourceCount(), and SchedulingResource::useCount().
|
private |
|
overridevirtual |
Unassign resource from given node for given cycle
cycle | Cycle to remove assignment from |
node | MoveNode to remove assignment from |
Implements SchedulingResource.
Reimplemented in OutputFUResource, and InputFUResource.
Definition at line 112 of file FUResource.cc.
References abortWithError.
|
private |
Definition at line 66 of file FUResource.hh.
Referenced by operator<().
|
private |
Definition at line 65 of file FUResource.hh.
Referenced by operator<().