OpenASIP  2.0
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
OutputFUResource Class Reference

#include <OutputFUResource.hh>

Inheritance diagram for OutputFUResource:
Inheritance graph
Collaboration diagram for OutputFUResource:
Collaboration graph

Public Member Functions

virtual ~OutputFUResource ()
 
 OutputFUResource (const std::string &name, int opCount, int nopSlotWeight)
 
virtual bool canAssign (const int cycle, const MoveNode &node) const override
 
virtual bool canAssign (const int cycle, const MoveNode &node, const TTAMachine::Port &resultPort) const
 
virtual void assign (const int cycle, MoveNode &node) override
 
virtual void unassign (const int cycle, MoveNode &node) override
 
virtual bool isOutputFUResource () const override
 
- Public Member Functions inherited from FUResource
 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 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 SchedulingResourcerelatedResource (const int group, const int index) const
 
virtual SchedulingResourcedependentResource (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 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)
 

Protected Member Functions

virtual bool validateDependentGroups () override
 
virtual bool validateRelatedGroups () override
 

Private Member Functions

 OutputFUResource (const OutputFUResource &)
 
OutputFUResourceoperator= (const OutputFUResource &)
 

Additional Inherited Members

- Protected Attributes inherited from SchedulingResource
int initiationInterval_
 

Detailed Description

An interface for scheduling resources of Resource Model The derived class OutputFUResource

Definition at line 53 of file OutputFUResource.hh.

Constructor & Destructor Documentation

◆ ~OutputFUResource()

OutputFUResource::~OutputFUResource ( )
virtual

Empty destructor

Definition at line 56 of file OutputFUResource.cc.

56 {}

◆ OutputFUResource() [1/2]

OutputFUResource::OutputFUResource ( const std::string &  name,
int  opCount,
int  nopSlotWeight 
)

Constructor with resource name

Parameters
nameName of resource

Definition at line 49 of file OutputFUResource.cc.

50  :
51  FUResource(name, opCount, nopSlotWeight) {}

◆ OutputFUResource() [2/2]

OutputFUResource::OutputFUResource ( const OutputFUResource )
private

Member Function Documentation

◆ assign()

void OutputFUResource::assign ( const int  cycle,
MoveNode node 
)
overridevirtual

Assign resource to given node for given cycle.

There is actually nothing assigned here, only test that the OutputPSocket of given FU can be assigned.

Parameters
cycleCycle to assign
nodeMoveNode assigned

Reimplemented from FUResource.

Definition at line 78 of file OutputFUResource.cc.

78  {
79 
80  for (int i = 0; i < dependentResourceGroupCount(); i++) {
81  for (int j = 0, count = dependentResourceCount(i); j < count; j++) {
85  dynamic_cast<ExecutionPipelineResource*>(res);
86  epRes->assignSource(cycle, node);
88  return;
89  }
90  }
91  }
92 }

References ExecutionPipelineResource::assignSource(), SchedulingResource::dependentResource(), SchedulingResource::dependentResourceCount(), SchedulingResource::dependentResourceGroupCount(), SchedulingResource::increaseUseCount(), and SchedulingResource::isExecutionPipelineResource().

Referenced by OutputFUBroker::assign().

Here is the call graph for this function:

◆ canAssign() [1/2]

bool OutputFUResource::canAssign ( const int  cycle,
const MoveNode node 
) const
overridevirtual

Not to be used, aborts!

Use version with third OutputPSocket operand!

Reimplemented from FUResource.

Definition at line 64 of file OutputFUResource.cc.

64  {
65  abortWithError("Wrong method. Use canAssign with PSocket!");
66  return false;
67 }

References abortWithError.

Referenced by OutputFUBroker::allAvailableResources().

◆ canAssign() [2/2]

bool OutputFUResource::canAssign ( const int  cycle,
const MoveNode node,
const TTAMachine::Port resultPort 
) const
virtual

Return true if resource can be assigned for given node in given cycle

Parameters
cycleCycle to test
nodeMoveNode to test
Returns
true if node can be assigned to cycle

Definition at line 128 of file OutputFUResource.cc.

131  {
132 
133  for (int i = 0; i < dependentResourceGroupCount(); i++) {
134  for (int j = 0, count = dependentResourceCount(i); j < count; j++) {
138  dynamic_cast<ExecutionPipelineResource*>(res);
139  if (!epRes->canAssignSource(cycle, node, resultPort)){
140  return false;
141  }
142  }
143  }
144  }
145  return true;
146 }

References ExecutionPipelineResource::canAssignSource(), SchedulingResource::dependentResource(), SchedulingResource::dependentResourceCount(), SchedulingResource::dependentResourceGroupCount(), and SchedulingResource::isExecutionPipelineResource().

Here is the call graph for this function:

◆ isOutputFUResource()

bool OutputFUResource::isOutputFUResource ( ) const
overridevirtual

Allways return true

Returns
true

Reimplemented from SchedulingResource.

Definition at line 153 of file OutputFUResource.cc.

153  {
154  return true;
155 }

◆ operator=()

OutputFUResource& OutputFUResource::operator= ( const OutputFUResource )
private

◆ unassign()

void OutputFUResource::unassign ( const int  cycle,
MoveNode node 
)
overridevirtual

Unassign resource from given node for given cycle.

It only tests that OutputPSocket to be unassigned is connected to given FU.

Parameters
cycleCycle to remove assignment from
nodeMoveNode to remove assignment from

Reimplemented from FUResource.

Definition at line 103 of file OutputFUResource.cc.

105  {
106 
107  for (int i = 0; i < dependentResourceGroupCount(); i++) {
108  for (int j = 0, count = dependentResourceCount(i); j < count; j++) {
112  dynamic_cast<ExecutionPipelineResource*>(res);
113  epRes->unassignSource(cycle, node);
115  return;
116  }
117  }
118  }
119 }

References SchedulingResource::decreaseUseCount(), SchedulingResource::dependentResource(), SchedulingResource::dependentResourceCount(), SchedulingResource::dependentResourceGroupCount(), SchedulingResource::isExecutionPipelineResource(), and ExecutionPipelineResource::unassignSource().

Referenced by OutputFUBroker::unassign().

Here is the call graph for this function:

◆ validateDependentGroups()

bool OutputFUResource::validateDependentGroups ( )
overrideprotectedvirtual

Tests if all referred resources in dependent groups are of proper types

Returns
true If all resources in dependent groups are input or output PSockets or ExecutionPipeline

Reimplemented from SchedulingResource.

Definition at line 164 of file OutputFUResource.cc.

164  {
165  for (int i = 0; i < dependentResourceGroupCount(); i++) {
166  for (int j = 0, count = dependentResourceCount(i); j < count; j++) {
170  return false;
171  }
172  }
173  }
174  return true;
175 }

References SchedulingResource::dependentResource(), SchedulingResource::dependentResourceCount(), SchedulingResource::dependentResourceGroupCount(), SchedulingResource::isExecutionPipelineResource(), SchedulingResource::isInputPSocketResource(), and SchedulingResource::isOutputPSocketResource().

Here is the call graph for this function:

◆ validateRelatedGroups()

bool OutputFUResource::validateRelatedGroups ( )
overrideprotectedvirtual

Tests if related resource groups are empty

Returns
true If all resources in related resource groups are empty

Reimplemented from SchedulingResource.

Definition at line 183 of file OutputFUResource.cc.

183  {
184  for (int i = 0; i < relatedResourceGroupCount(); i++) {
185  if (relatedResourceCount(i) > 0) {
186  return false;
187  }
188  }
189  return true;
190 }

References SchedulingResource::relatedResourceCount(), and SchedulingResource::relatedResourceGroupCount().

Here is the call graph for this function:

The documentation for this class was generated from the following files:
ExecutionPipelineResource
Definition: ExecutionPipelineResource.hh:64
SchedulingResource::dependentResourceGroupCount
virtual int dependentResourceGroupCount() const
Definition: SchedulingResource.cc:71
ExecutionPipelineResource::canAssignSource
virtual bool canAssignSource(int cycle, const MoveNode &node, const TTAMachine::Port &resultPort) const
Definition: ExecutionPipelineResource.cc:819
ExecutionPipelineResource::unassignSource
virtual void unassignSource(const int cycle, MoveNode &node)
Definition: ExecutionPipelineResource.cc:597
SchedulingResource::isInputPSocketResource
virtual bool isInputPSocketResource() const
SchedulingResource::dependentResource
virtual SchedulingResource & dependentResource(const int group, const int index) const
Definition: SchedulingResource.cc:158
SchedulingResource::dependentResourceCount
int dependentResourceCount(const int group) const
abortWithError
#define abortWithError(message)
Definition: Application.hh:72
SchedulingResource
Definition: SchedulingResource.hh:52
SchedulingResource::isOutputPSocketResource
virtual bool isOutputPSocketResource() const
SchedulingResource::isExecutionPipelineResource
virtual bool isExecutionPipelineResource() const
ExecutionPipelineResource::assignSource
virtual void assignSource(int cycle, MoveNode &node)
Definition: ExecutionPipelineResource.cc:405
FUResource::FUResource
FUResource(const std::string &name, int operationCount, int nopSlotWeight, unsigned int initiationInterval=0)
Definition: FUResource.cc:43
SchedulingResource::relatedResourceCount
int relatedResourceCount(const int group) const
SchedulingResource::decreaseUseCount
virtual void decreaseUseCount()
Definition: SchedulingResource.cc:364
SchedulingResource::name
virtual const std::string & name() const
SchedulingResource::relatedResourceGroupCount
virtual int relatedResourceGroupCount() const
Definition: SchedulingResource.cc:61
SchedulingResource::increaseUseCount
virtual void increaseUseCount()
Definition: SchedulingResource.cc:355