OpenASIP
2.0
|
#include <InputPSocketBroker.hh>
Public Member Functions | |
InputPSocketBroker (std::string name, ResourceBroker &fub, unsigned int initiationInterval=0) | |
virtual | ~InputPSocketBroker () |
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 *) const override |
virtual bool | isApplicable (const MoveNode &node, const TTAMachine::Bus *preassignedBus=NULL) 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 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 |
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 & | inputFUBroker_ |
ResourceBroker * | busBroker_ |
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_ |
Input p-socket broker takes care of assigning input socket and input port (of FU or RF) at once.
Definition at line 51 of file InputPSocketBroker.hh.
InputPSocketBroker::InputPSocketBroker | ( | std::string | name, |
ResourceBroker & | fub, | ||
unsigned int | initiationInterval = 0 |
||
) |
Constructor.
Definition at line 57 of file InputPSocketBroker.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 79 of file InputPSocketBroker.cc.
References __func__, SchedulingResource::canAssign(), TTAProgram::Move::destination(), TTAMachine::Port::inputSocket(), SchedulingResourceSet::insert(), ResourceBroker::instructionIndex(), isApplicable(), TTAProgram::Terminal::isFUPort(), TTAMachine::BaseRegisterFile::port(), TTAProgram::Terminal::port(), TTAMachine::Unit::portCount(), TTAProgram::Terminal::registerFile(), and ResourceBroker::resourceOf().
|
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 input 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 233 of file InputPSocketBroker.cc.
References __func__, SchedulingResource::assign(), ResourceBroker::assignedResources_, TTAProgram::Move::destination(), ResourceBroker::hasResource(), TTAProgram::Terminal::index(), TTAMachine::Port::inputSocket(), ResourceBroker::instructionIndex(), isApplicable(), TTAProgram::Terminal::isGPR(), ResourceBroker::machinePartOf(), MoveNode::move(), TTAMachine::Port::parentUnit(), TTAMachine::Socket::port(), TTAMachine::Socket::portCount(), TTAProgram::Terminal::registerFile(), and TTAProgram::Move::setDestination().
|
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 318 of file InputPSocketBroker.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 138 of file InputPSocketBroker.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 183 of file InputPSocketBroker.cc.
References ResourceBroker::assignedResources_, MapTools::containsKey(), TTAMachine::Port::inputSocket(), ResourceBroker::instructionIndex(), SchedulingResource::isInUse(), TTAProgram::Terminal::port(), and ResourceBroker::resourceOf().
|
overridevirtual |
Return true if the given node needs a resource of the type managed by this broker, false otherwise.
This broker is applicable for all moves, but not long immediates.
node | Node. |
Implements ResourceBroker.
Definition at line 210 of file InputPSocketBroker.cc.
References MoveNode::isMove().
Referenced by allAvailableResources(), assign(), and unassign().
|
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 160 of file InputPSocketBroker.cc.
References abortWithError.
void InputPSocketBroker::setBusBroker | ( | ResourceBroker & | sb | ) |
Gives reference to segmentbroker to this broker.
Cannot be given in constructor because SegmentBroker is created later.
Definition at line 391 of file InputPSocketBroker.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 340 of file InputPSocketBroker.cc.
References __func__, SchedulingResource::addToRelatedGroup(), busBroker_, Exception::errorMessageStack(), inputFUBroker_, TTAMachine::Segment::parentBus(), TTAMachine::Port::parentUnit(), TTAMachine::Socket::port(), TTAMachine::Socket::portCount(), ResourceBroker::resMap_, 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 288 of file InputPSocketBroker.cc.
References __func__, ResourceBroker::assignedResources_, MapTools::containsKey(), MoveNode::cycle(), TTAProgram::Move::destination(), TTAMachine::Port::inputSocket(), isApplicable(), TTAProgram::Terminal::port(), ResourceBroker::resourceOf(), and SchedulingResource::unassign().
|
private |
Definition at line 98 of file InputPSocketBroker.hh.
Referenced by setBusBroker(), and setupResourceLinks().
|
private |
Definition at line 97 of file InputPSocketBroker.hh.
Referenced by setupResourceLinks().