Go to the documentation of this file.
96 string msg =
"Broker not capable of assigning resources to node: "
105 ResourceMap::const_iterator resIter =
resMap_.begin();
115 while (resIter !=
resMap_.end()) {
117 dynamic_cast<const ControlUnit*
>((*resIter).first);
119 if ((*resIter).second->isAvailable(modCycle)) {
120 resourceSet.
insert(*(*resIter).second);
160 Port* resultPort = hwOp->
port(opIndex);
161 assert (resultPort !=
nullptr);
162 if (fuRes.
canAssign(cycle, node, *resultPort)) {
163 resourceSet.
insert(fuRes);
170 std::set<TCEString> candidateFUs;
171 std::set<TCEString> allowedFUs;
172 std::set<TCEString> rejectedFUs;
177 candidateFUs, node.
move(),
180 allowedFUs, node.
move(),
183 rejectedFUs, node.
move(),
187 while (resIter !=
resMap_.end()) {
190 if (srcFU != NULL && unit != srcFU) {
192 <<
" because it's not the pre-set one: "
200 if (candidateFUs.size() > 0 &&
205 if (allowedFUs.size() > 0 &&
208 TCEString(
"skipped ") << unit->
name() <<
" because it was not"
209 " in the allowed set. The set contents: ");
210 for (
auto allowedUnit : allowedFUs)
219 " in the rejected set.");
230 Port* resultPort = hwOp->
port(opIndex);
231 if (fuRes.
canAssign(cycle, node, *resultPort)) {
233 resourceSet.
insert(*(*resIter).second);
235 debugLogRM(
"could not assign the fuRes to it.");
266 string msg =
"Broker not capable of assigning resources to node!";
271 string msg =
"Broker does not contain given resource.";
280 if (src !=
nullptr &&
291 if (outputSocket == NULL) {
293 __FILE__, __LINE__,
__func__,
"GCU is missing RA port - "
294 "socket connection!");
297 std::pair<const MoveNode*, SchedulingResource*>(
302 "GCU required but tried to assign something else!");
315 fuRes.
assign(cycle, node);
317 std::pair<const MoveNode*, SchedulingResource*>(
325 fuRes.
assign(cycle, node);
327 std::pair<const MoveNode*, SchedulingResource*>(
491 std::map<const TTAMachine::FunctionUnit*,int> nopWeights;
494 for (
int i = 0; i < navi.
count(); i++) {
519 for (ResourceMap::iterator resIter =
resMap_.begin();
520 resIter !=
resMap_.end(); resIter++) {
526 for (
int i = 0; i < fu->
portCount(); i++) {
534 std::string msg =
"OutputFUBroker: finding ";
535 msg +=
" resource for Socket ";
536 msg +=
" failed with error: ";
545 for (
int i = 0; i < fuCount; i++) {
const Operation & operation() const
virtual bool isFUPort() const
virtual void addToDependentGroup(const int group, SchedulingResource &resource)
int outputIndexFromGuardOfMove(const MoveNode &node) const
@ ANN_REJECTED_UNIT_SRC
Src. unit rejected.
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 TCEString name() const
virtual const TTAMachine::FunctionUnit & functionUnit() const
std::string toString() const
virtual void unassign(const int cycle, MoveNode &node)=0
bool isUnconditional() const
const TTAMachine::FunctionUnit * fuFromOutMove(const MoveNode &outputNode) const
virtual void buildResources(const TTAMachine::Machine &target) override
bool hasResource(const SchedulingResource &r) const
virtual void unassign(MoveNode &node) override
MoveResMap assignedResources_
virtual BaseFUPort * port(const std::string &name) const
virtual ~OutputFUBroker()
SchedulingResource & resourceOf(const TTAMachine::MachinePart &mp, int index=0) const
void addResource(const TTAMachine::MachinePart &mp, SchedulingResource *res)
bool hasResourceOf(const TTAMachine::MachinePart &mp) const
virtual TCEString name() const
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
ProgramOperation & sourceOperation() const
#define assert(condition)
virtual FUPort * port(int operand) const
virtual Operation & hintOperation() const
virtual void assign(int cycle, MoveNode &node, SchedulingResource &res, int immWriteCycle, int immRegIndex) override
void setResourceMapper(const ResourceMapper &mapper)
@ ANN_ALLOWED_UNIT_SRC
Candidate units can be passed for resource manager for choosing the source/destination unit of the mo...
bool isGuardOperation() const
static void addAnnotatedFUs(std::set< TCEString > &candidateFUs, const TTAProgram::Move &m, TTAProgram::ProgramAnnotation::Id id)
@ ANN_CONN_CANDIDATE_UNIT_SRC
Src. unit candidate.
std::pair< bool, const TTAMachine::FunctionUnit * > findFUOfPO(ProgramOperation &po, const TTAMachine::FunctionUnit *resFU) const
virtual ControlUnit * controlUnit() const
#define abortWithError(message)
virtual int operationIndex() const
virtual bool isAlreadyAssigned(int cycle, const MoveNode &node, const TTAMachine::Bus *preassignedBus) const override
MoveGuard & guard() const
virtual FunctionUnitNavigator functionUnitNavigator() const
virtual void unassign(const int cycle, MoveNode &node) override
std::string errorMessageStack(bool messagesOnly=false) const
virtual int operationCount() const
SchedulingResource * resourceOf(const TTAMachine::MachinePart &mp) const
bool isSourceOperation() const
virtual const TTAMachine::Port & port() const
virtual bool isExecutionPipelineResource() const
virtual void setupResourceLinks(const ResourceMapper &mapper) override
virtual bool hasOperation(const std::string &name) const
virtual int portCount() const
virtual const TTAMachine::FunctionUnit & functionUnit() const
virtual void assign(const int cycle, MoveNode &node) override
virtual bool canAssign(const int cycle, const MoveNode &node) const override
TTAProgram::Move & move()
int resourceCount(const TTAMachine::MachinePart &mp) const
virtual bool isApplicable(const MoveNode &node, const TTAMachine::Bus *b=0) const override
unsigned int instructionIndex(unsigned int) const
virtual Socket * outputSocket() const
Terminal & source() const
virtual const TTAMachine::MachinePart & machinePartOf(const SchedulingResource &r) const
ComponentType * item(int index) const
virtual HWOperation * operation(const std::string &name) const
const TTAMachine::Guard & guard() const
SpecialRegisterPort * returnAddressPort() const
void insert(SchedulingResource &resource)
int outputIndexOfMove(const MoveNode &mn) const
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
OutputFUBroker(std::string, unsigned int initiationInterval=0)
void setSource(Terminal *src)
ProgramOperation & guardOperation() const