OpenASIP
2.0
|
#include <OutputPSocketBroker.hh>
Public Member Functions | |
OutputPSocketBroker (std::string name, ResourceBroker &ofb, SimpleResourceManager *, unsigned int initiationInterval=0) | |
virtual | ~OutputPSocketBroker () |
bool | isAnyResourceAvailable (int cycle, const MoveNode &node, const TTAMachine::Bus *bus, const TTAMachine::FunctionUnit *srcFU, const TTAMachine::FunctionUnit *dstFU, int immWriteCycle, const TTAMachine::ImmediateUnit *immu, int immRegIndex) const override |
virtual SchedulingResourceSet | allAvailableResources (int cycle, const MoveNode &node, const TTAMachine::Bus *bus, const TTAMachine::FunctionUnit *srcFU, const TTAMachine::FunctionUnit *dstFU, int immWriteCycle, const TTAMachine::ImmediateUnit *immu, int immRegIndex) const override |
virtual void | assign (int cycle, MoveNode &node, SchedulingResource &res, int immWriteCycle, int immRegIndex) override |
virtual void | unassign (MoveNode &node) override |
virtual int | earliestCycle (int cycle, const MoveNode &node, const TTAMachine::Bus *bus, const TTAMachine::FunctionUnit *srcFU, const TTAMachine::FunctionUnit *dstFU, int immWriteCycle, const TTAMachine::ImmediateUnit *immu, int immRegIndex) const override |
virtual int | latestCycle (int cycle, const MoveNode &node, const TTAMachine::Bus *bus, const TTAMachine::FunctionUnit *srcFU, const TTAMachine::FunctionUnit *dstFU, int immWriteCycle, const TTAMachine::ImmediateUnit *immu, int immRegIndex) const override |
virtual bool | isAlreadyAssigned (int cycle, const MoveNode &node, const TTAMachine::Bus *preassignedBus) const override |
virtual bool | isApplicable (const MoveNode &node, const TTAMachine::Bus *b) const override |
virtual void | buildResources (const TTAMachine::Machine &target) override |
virtual void | setupResourceLinks (const ResourceMapper &mapper) override |
void | setBusBroker (ResourceBroker &sb) |
Public Member Functions inherited from ResourceBroker | |
ResourceBroker (std::string, unsigned int initiationInterval=0) | |
virtual | ~ResourceBroker () |
virtual SchedulingResource & | availableResource (int cycle, const MoveNode &node, const TTAMachine::Bus *bus, const TTAMachine::FunctionUnit *srcFU, const TTAMachine::FunctionUnit *dstFU, int immWriteCycle, const TTAMachine::ImmediateUnit *immu, int immRegIndex) const |
virtual bool | isAvailable (SchedulingResource &des, const MoveNode &node, int cycle, const TTAMachine::Bus *bus, const TTAMachine::FunctionUnit *srcFU, const TTAMachine::FunctionUnit *dstFU, int immWriteCycle, const TTAMachine::ImmediateUnit *immu, int immRegIndex) const |
SchedulingResource * | resourceOf (const TTAMachine::MachinePart &mp) const |
virtual const TTAMachine::MachinePart & | machinePartOf (const SchedulingResource &r) const |
bool | hasResourceOf (const TTAMachine::MachinePart &mp) const |
bool | hasResource (const SchedulingResource &r) const |
int | resourceCount () const |
virtual bool | isBusBroker () const |
virtual bool | isITemplateBroker () const |
virtual bool | isIUBroker () const |
virtual bool | isExecutionPipelineBroker () const |
void | validateResources () const |
virtual std::string | brokerName () const |
void | resources (ResourceSet &contents) |
virtual void | setInitiationInterval (unsigned int cycles) |
virtual void | clear () |
virtual void | setMaxCycle (unsigned int) |
Private Attributes | |
ResourceBroker & | outputFUBroker_ |
ResourceBroker * | busBroker_ |
SimpleResourceManager * | rm_ |
Additional Inherited Members | |
Public Types inherited from ResourceBroker | |
typedef std::set< SchedulingResource * > | ResourceSet |
Protected Types inherited from ResourceBroker | |
typedef std::map< const TTAMachine::MachinePart *, SchedulingResource *, TTAMachine::MachinePart::Comparator > | ResourceMap |
typedef std::map< const MoveNode *, SchedulingResource *, MoveNode::Comparator > | MoveResMap |
Protected Member Functions inherited from ResourceBroker | |
void | setResourceMapper (const ResourceMapper &mapper) |
const ResourceMapper & | resourceMapper () const |
unsigned int | instructionIndex (unsigned int) const |
void | addResource (const TTAMachine::MachinePart &mp, SchedulingResource *res) |
Protected Attributes inherited from ResourceBroker | |
unsigned int | initiationInterval_ |
ResourceMap | resMap_ |
const ResourceMapper * | resourceMapper_ |
MoveResMap | assignedResources_ |
std::string | brokerName_ |
Output p-socket broker.
Definition at line 51 of file OutputPSocketBroker.hh.
OutputPSocketBroker::OutputPSocketBroker | ( | std::string | name, |
ResourceBroker & | fub, | ||
SimpleResourceManager * | rm, | ||
unsigned int | initiationInterval = 0 |
||
) |
Constructor.
name | name for this broker. |
fub | reference to OutputFUBroker of this resource manager. |
initiationInterval | initiationinterval when doing loop scheduling. |
Definition at line 57 of file OutputPSocketBroker.cc.
|
virtual |
|
overridevirtual |
Return all resources managed by this broker that can be assigned to the given node in the given cycle.
cycle | Cycle. |
node | Node. |
Reimplemented from ResourceBroker.
Definition at line 82 of file OutputPSocketBroker.cc.
References __func__, SchedulingResource::canAssign(), TTAProgram::Terminal::immediateUnit(), SchedulingResourceSet::insert(), ResourceBroker::instructionIndex(), isApplicable(), TTAProgram::Terminal::isFUPort(), TTAProgram::Terminal::isGPR(), TTAProgram::Terminal::isImmediateRegister(), TTAMachine::Port::outputSocket(), TTAMachine::BaseRegisterFile::port(), TTAProgram::Terminal::port(), TTAMachine::Unit::portCount(), TTAProgram::Terminal::registerFile(), ResourceBroker::resourceOf(), and TTAProgram::Move::source().
|
overridevirtual |
Mark given resource as in use for the given node, and assign the corresponding machine part (if applicable) to the node's move.
If the node is already assigned to given resource, this method does nothing.
cycle | Cycle. |
node | Node to assign. |
res | Resource representing Output PSocket |
WrongSubclass | If this broker does not recognise the given type of resource. |
InvalidParameters | If he given resource cannot be assigned to given node or no corresponding machine part is found. |
Implements ResourceBroker.
Definition at line 237 of file OutputPSocketBroker.cc.
References __func__, SchedulingResource::assign(), ResourceBroker::assignedResources_, ResourceBroker::hasResource(), TTAProgram::Terminal::immediateUnit(), TTAProgram::Terminal::index(), ResourceBroker::instructionIndex(), TTAProgram::Terminal::isGPR(), TTAProgram::Terminal::isImmediateRegister(), ResourceBroker::machinePartOf(), MoveNode::move(), TTAMachine::Port::outputSocket(), TTAMachine::Port::parentUnit(), TTAMachine::Socket::port(), TTAMachine::Socket::portCount(), TTAProgram::Terminal::registerFile(), TTAProgram::Move::setSource(), and TTAProgram::Move::source().
|
overridevirtual |
Build all resource objects of the controlled type required to model scheduling resources of the given target processor.
This method cannot set up the resource links (dependent and related resources) of the constructed resource objects.
target | Target machine. |
Implements ResourceBroker.
Definition at line 429 of file OutputPSocketBroker.cc.
References ResourceBroker::addResource(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Socket::direction(), ResourceBroker::initiationInterval_, TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::name(), and TTAMachine::Machine::socketNavigator().
|
overridevirtual |
Return the earliest cycle, starting from given cycle, where a resource of the type managed by this broker can be assigned to the given node.
cycle | Cycle. |
node | Node. |
Implements ResourceBroker.
Definition at line 316 of file OutputPSocketBroker.cc.
References abortWithError.
|
overridevirtual |
Return true if the given node is already assigned a resource of the type managed by this broker, and the assignment appears valid (that is, the broker has marked that resource as in use in the given cycle).
cycle | Cycle. |
node | Node. |
Implements ResourceBroker.
Definition at line 362 of file OutputPSocketBroker.cc.
References TTAProgram::ProgramAnnotation::ANN_REQUIRES_LIMM, ResourceBroker::assignedResources_, SimpleResourceManager::canTransportImmediate(), MapTools::containsKey(), TTAProgram::AnnotatedInstructionElement::hasAnnotations(), ResourceBroker::instructionIndex(), TTAProgram::Terminal::isFUPort(), TTAProgram::Terminal::isGPR(), TTAProgram::Terminal::isImmediateRegister(), SchedulingResource::isInUse(), MoveNode::isSourceConstant(), MoveNode::move(), TTAMachine::Port::outputSocket(), TTAProgram::Terminal::port(), ResourceBroker::resourceOf(), and rm_.
|
overridevirtual |
Return true if one of the resources managed by this broker is suitable for the request contained in the node and can be assigned to it in given cycle.
cycle | Cycle. |
node | Node. |
Reimplemented from ResourceBroker.
Definition at line 155 of file OutputPSocketBroker.cc.
References __func__, SchedulingResource::canAssign(), TTAProgram::Terminal::immediateUnit(), ResourceBroker::instructionIndex(), isApplicable(), TTAProgram::Terminal::isFUPort(), TTAProgram::Terminal::isGPR(), TTAProgram::Terminal::isImmediateRegister(), TTAMachine::Port::outputSocket(), TTAMachine::BaseRegisterFile::port(), TTAProgram::Terminal::port(), TTAMachine::Unit::portCount(), TTAProgram::Terminal::registerFile(), ResourceBroker::resourceOf(), and TTAProgram::Move::source().
|
overridevirtual |
Return true if the given node needs a resource of the type managed by this broker, false otherwise.
node | Node. |
Implements ResourceBroker.
Definition at line 398 of file OutputPSocketBroker.cc.
References TTAProgram::ProgramAnnotation::ANN_REQUIRES_LIMM, SimpleResourceManager::canTransportImmediate(), TTAProgram::AnnotatedInstructionElement::hasAnnotations(), TTAProgram::Terminal::isFUPort(), TTAProgram::Terminal::isGPR(), TTAProgram::Terminal::isImmediateRegister(), MoveNode::isMove(), MoveNode::isSourceConstant(), MoveNode::move(), rm_, and TTAProgram::Move::source().
Referenced by allAvailableResources(), and isAnyResourceAvailable().
|
overridevirtual |
Return the latest cycle, starting from given cycle, where a resource of the type managed by this broker can be assigned to the given node.
cycle | Cycle. |
node | Node. |
Implements ResourceBroker.
Definition at line 338 of file OutputPSocketBroker.cc.
References abortWithError.
void OutputPSocketBroker::setBusBroker | ( | ResourceBroker & | sb | ) |
Gives reference to segmentbroker to this broker.
Cannot be given in constructor because SegmentBroker is created later.
Definition at line 511 of file OutputPSocketBroker.cc.
References busBroker_.
Referenced by SimpleResourceManager::buildResourceModel().
|
overridevirtual |
Complete resource initialisation by creating the references to other resources due to a dependency or a relation. Use the given resource mapper to lookup dependent and related resources using machine parts as keys.
mapper | Resource mapper. |
Implements ResourceBroker.
Definition at line 452 of file OutputPSocketBroker.cc.
References __func__, SchedulingResource::addToRelatedGroup(), busBroker_, Exception::errorMessageStack(), outputFUBroker_, TTAMachine::Segment::parentBus(), TTAMachine::Port::parentUnit(), TTAMachine::Socket::port(), TTAMachine::Socket::portCount(), ResourceBroker::resMap_, ResourceMapper::resourceOf(), ResourceBroker::resourceOf(), TTAMachine::Socket::segment(), TTAMachine::Socket::segmentCount(), and ResourceBroker::setResourceMapper().
|
overridevirtual |
Free the resource type managed by this broker and unassign it from given node.
If this broker is not applicable to the given node, or the node is not assigned a resource of the managed type, this method does nothing.
node | Node. |
Implements ResourceBroker.
Definition at line 294 of file OutputPSocketBroker.cc.
References ResourceBroker::assignedResources_, MapTools::containsKey(), MoveNode::cycle(), and SchedulingResource::unassign().
|
private |
Definition at line 105 of file OutputPSocketBroker.hh.
Referenced by setBusBroker(), and setupResourceLinks().
|
private |
Definition at line 104 of file OutputPSocketBroker.hh.
Referenced by setupResourceLinks().
|
private |
Definition at line 108 of file OutputPSocketBroker.hh.
Referenced by isAlreadyAssigned(), and isApplicable().