OpenASIP
2.0
|
#include <BusResource.hh>
Public Member Functions | |
BusResource (const std::string &name, int width, int limmSlotCount, int nopSlotCount, int guardCount, int immSize, int socketCount, unsigned int initiationInterval=0) | |
virtual | ~BusResource () |
virtual bool | isInUse (const int cycle) const override |
virtual bool | isAvailable (const int cycle) const override |
virtual bool | isAvailable (const int cycle, const SchedulingResource &inputPSocket, const SchedulingResource &outputPSocket) const |
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 | canAssign (const int cycle, const MoveNode &node, const SchedulingResource &inputPSocket, const SchedulingResource &outputPSocket) const |
virtual bool | isBusResource () const override |
virtual bool | operator< (const SchedulingResource &other) const override |
int | nopSlotCount () |
void | clear () 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 | 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 | setMaxCycle (unsigned int) |
Protected Member Functions | |
virtual bool | validateDependentGroups () override |
virtual bool | validateRelatedGroups () override |
Private Types | |
typedef std::map< int, int > | ResourceRecordType |
Private Member Functions | |
BusResource (const BusResource &) | |
BusResource & | operator= (const BusResource &) |
Private Attributes | |
int | busWidth_ |
int | limmSlotCount_ |
int | nopSlotCount_ |
int | guardCount_ |
int | immSize_ |
int | socketCount_ |
ResourceRecordType | resourceRecord_ |
Additional Inherited Members | |
Protected Attributes inherited from SchedulingResource | |
int | initiationInterval_ |
An interface for scheduling resources of Resource Model The derived class BusResource
Definition at line 46 of file BusResource.hh.
|
private |
Definition at line 97 of file BusResource.hh.
BusResource::BusResource | ( | const std::string & | name, |
int | width, | ||
int | limmSlotCount, | ||
int | nopSlotCount, | ||
int | guardCount, | ||
int | immSize, | ||
int | socketCount, | ||
unsigned int | initiationInterval = 0 |
||
) |
Constructor Creates new resource with defined name
name | Name of resource |
width | short immediate width of the bus |
limmSlotCount | how many itemplates use this bus in limm field |
Definition at line 54 of file BusResource.cc.
|
virtual |
|
private |
|
overridevirtual |
Assign resource to given node for given cycle without testing Input or Output PSocket, assign ALL segments of bus.
cycle | Cycle to assign |
node | MoveNode assigned |
In | case assignment can not be done |
Implements SchedulingResource.
Definition at line 124 of file BusResource.cc.
References canAssign(), SchedulingResource::increaseUseCount(), SchedulingResource::instructionIndex(), and resourceRecord_.
Referenced by BusBroker::assign().
|
overridevirtual |
Return true if resource can be assigned for given node in given cycle
cycle | Cycle to test |
node | MoveNode to test |
Implements SchedulingResource.
Definition at line 164 of file BusResource.cc.
References isAvailable().
Referenced by BusBroker::allAvailableResources(), assign(), and BusBroker::isAvailable().
|
virtual |
Return true if resource can be assigned for given node in given cycle
cycle | Cycle to test |
node | MoveNode to test |
inputPSocket | PSocket connected to source of move |
outputPSocket | PSocket connected to destination of move |
Definition at line 177 of file BusResource.cc.
References assert, busWidth_, TTAProgram::Move::destination(), MoveNode::destinationOperation(), MoveNode::destinationOperationCount(), SchedulingResource::hasRelatedResource(), isAvailable(), SchedulingResource::isInputPSocketResource(), SchedulingResource::isOutputPSocketResource(), MoveNode::isSourceConstant(), MoveNode::move(), ProgramOperation::operation(), TTAProgram::Terminal::operationIndex(), TTAProgram::Terminal::port(), TTAProgram::Move::source(), and TTAMachine::Port::width().
|
overridevirtual |
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 from SchedulingResource.
Definition at line 334 of file BusResource.cc.
References SchedulingResource::clear(), and resourceRecord_.
|
overridevirtual |
Test if resource BusResource is available
cycle | Cycle which to test |
Implements SchedulingResource.
Definition at line 90 of file BusResource.cc.
References isInUse().
Referenced by canAssign(), and isAvailable().
|
virtual |
Test if resource BusResource is available.
cycle | Cycle which to test |
Definition at line 101 of file BusResource.cc.
References SchedulingResource::hasRelatedResource(), and isAvailable().
|
overridevirtual |
Return allways true
Reimplemented from SchedulingResource.
Definition at line 232 of file BusResource.cc.
|
overridevirtual |
Test if resource BusResource is used in given cycle
cycle | Cycle which to test |
Implements SchedulingResource.
Definition at line 75 of file BusResource.cc.
References SchedulingResource::instructionIndex(), and resourceRecord_.
Referenced by isAvailable(), BusBroker::isInUse(), and unassign().
|
inline |
|
overridevirtual |
Comparison operator.
Favours busses which have less limm slots associated to then in instruction templates, ie. busses which do not get into way of limm writes.
Reimplemented from SchedulingResource.
Definition at line 275 of file BusResource.cc.
References guardCount_, immSize_, limmSlotCount_, nopSlotCount_, and socketCount_.
|
private |
|
overridevirtual |
Unassign resource from given node for given cycle without testing Input or Output PSocket, unassign all segments of bus
cycle | Cycle to remove assignment from |
node | MoveNode to remove assignment from |
In | case bus was not assigned |
Implements SchedulingResource.
Definition at line 142 of file BusResource.cc.
References __func__, SchedulingResource::instructionIndex(), isInUse(), SchedulingResource::name(), resourceRecord_, and Conversion::toString().
Referenced by BusBroker::unassign().
|
overrideprotectedvirtual |
Tests if all referred resources in dependent groups are of proper types
Reimplemented from SchedulingResource.
Definition at line 243 of file BusResource.cc.
|
overrideprotectedvirtual |
Tests if all resources in related resource groups are of proper types
Reimplemented from SchedulingResource.
Definition at line 254 of file BusResource.cc.
References SchedulingResource::isInputPSocketResource(), SchedulingResource::isOutputPSocketResource(), SchedulingResource::relatedResource(), SchedulingResource::relatedResourceCount(), and SchedulingResource::relatedResourceGroupCount().
|
private |
Definition at line 84 of file BusResource.hh.
Referenced by canAssign().
|
private |
Definition at line 90 of file BusResource.hh.
Referenced by operator<().
|
private |
Definition at line 92 of file BusResource.hh.
Referenced by operator<().
|
private |
Definition at line 86 of file BusResource.hh.
Referenced by operator<().
|
private |
Definition at line 88 of file BusResource.hh.
Referenced by nopSlotCount(), and operator<().
|
private |
Definition at line 98 of file BusResource.hh.
Referenced by assign(), clear(), isInUse(), and unassign().
|
private |
Definition at line 94 of file BusResource.hh.
Referenced by operator<().