OpenASIP  2.0
IUBroker.cc
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University of Technology.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file IUBroker.cc
26  *
27  * Implementation of IUBroker class.
28  *
29  * @author Ari Mets�halme 2006 (ari.metsahalme-no.spam-tut.fi)
30  * @author Vladimir Guzma 2007 (vladimir.guzma-no.spam-tut.fi)
31  * @note rating: red
32  */
33 
34 #include <algorithm>
35 
36 #include "IUBroker.hh"
37 #include "IUResource.hh"
38 #include "Machine.hh"
39 #include "Move.hh"
40 #include "MapTools.hh"
41 #include "ResourceMapper.hh"
42 #include "OutputPSocketResource.hh"
43 #include "MoveNode.hh"
44 #include "TCEString.hh"
45 #include "TerminalRegister.hh"
46 #include "TerminalImmediate.hh"
47 #include "Immediate.hh"
48 #include "SimpleResourceManager.hh"
49 
50 using std::string;
51 using namespace TTAMachine;
52 using namespace TTAProgram;
53 
54 // limit distance between LIMM write and use.
55 // this limit makes scheduling much faster, and cases
56 // where there is some advantage in limm read and write being
57 // far away are extremely rare
58 static const int MAX_LIMM_DISTANCE = 25;
59 
60 /**
61  * Constructor.
62  */
63 IUBroker::IUBroker(std::string name):
64  ResourceBroker(name),
65  target_(NULL),
66  rm_(NULL) {
67 }
68 
69 /**
70  * Constructor.
71  */
73  unsigned int initiationInterval) :
74  ResourceBroker(name, initiationInterval),
75  target_(NULL), rm_(rm) {
76 }
77 
78 /**
79  * Destructor.
80  */
82 }
83 
84 /**
85  * Return true if one of the resources managed by this broker is
86  * suitable for the request contained in the node and can be assigned
87  * to it in given cycle.
88  *
89  * @param defCycle Cycle in which the write to long immediate register is
90  * @param useCycle Cycle in which the long immediate register is read by node
91  * @param node Node.
92  * @return True if one of the resources managed by this broker is
93  * suitable for the request contained in the node and can be assigned
94  * to it in given cycle.
95  */
96 bool
97 IUBroker::isAnyResourceAvailable(int useCycle,const MoveNode& node,
98  const TTAMachine::Bus* bus,
99  const TTAMachine::FunctionUnit* srcFU,
100  const TTAMachine::FunctionUnit* dstFU,
101  int immWriteCycle,
102  const TTAMachine::ImmediateUnit* immu,
103  int immRegIndex) const {
104  int resultCount = allAvailableResources(
105  useCycle, node, bus, srcFU, dstFU, immWriteCycle, immu, immRegIndex).
106  count();
107  return (resultCount > 0);
108 }
109 
110 /**
111  * Return one (any) resource managed by this broker that has a
112  * register available for assignment between given definition
113  * and use cycles.
114  *
115  * @param useCycle Use cycle.
116  * @param node Node.
117  * @return One (any) resource managed by this broker that has a
118  * register available for assignment between given definition and
119  * use cycles.
120  */
122 IUBroker::availableResource(int useCycle, const MoveNode& node,
123  const TTAMachine::Bus* bus,
124  const TTAMachine::FunctionUnit* srcFU,
125  const TTAMachine::FunctionUnit* dstFU,
126  int immWriteCycle,
127  const TTAMachine::ImmediateUnit* immu,
128  int immRegIndex)
129  const {
130  try {
131  return allAvailableResources(
132  useCycle, node, bus, srcFU, dstFU, immWriteCycle, immu, immRegIndex).
133  resource(0);
134  } catch (const KeyNotFound& e) {
135  std::string message = "No immediate register resource available.";
136  throw InstanceNotFound(__FILE__, __LINE__, __func__, message);
137  }
138 }
139 /**
140  * Return all resources managed by this broker that can be assigned to
141  * the given node in the given cycle.
142  *
143  * @param useCycle Read from immediate register by Node
144  * @param node Node.
145  * @return All resources managed by this broker that can be assigned to
146  * the given node in the given cycle.
147  */
149 IUBroker::allAvailableResources(int useCycle, const MoveNode& node,
150  const TTAMachine::Bus*,
153  int immWriteCycle,
154  const TTAMachine::ImmediateUnit* immu,
155  int immRegIndex) const {
156 
157  int defCycle = useCycle;
158  if (immWriteCycle != -1) {
159  defCycle = immWriteCycle;
160  }
161 
162  SchedulingResourceSet results;
163 
164  // pre-split LIMM
165  if (node.move().source().isImmediateRegister()) {
166  const ImmediateUnit& iu =
167  node.move().source().immediateUnit();
168  IUResource* iuRes = static_cast<IUResource*>(resourceOf(iu));
169  if (iuRes->canAssign(useCycle, node)) {
170  results.insert(*iuRes);
171  }
172  return results;
173  }
174 
175  std::vector<IUResource*> tmpResult;
176 
177  // RM breaks if LIMM write and use are in same instruction.
178  int maxLimmDistance = MAX_LIMM_DISTANCE;
179  if (initiationInterval_) {
180  maxLimmDistance = std::min(maxLimmDistance, (int)initiationInterval_);
181  }
182  while (defCycle >= 0 && (useCycle - defCycle) < maxLimmDistance &&
183  tmpResult.empty()) {
184  ResourceMap::const_iterator resIter = resMap_.begin();
185  while (resIter != resMap_.end()) {
186  // TODO: why is this dynamic, not static cast?
187  IUResource* iuRes = dynamic_cast<IUResource*>((*resIter).second);
188  if (immu == NULL || resourceOf(*immu) == (*resIter).second) {
189  if (iuRes->canAssign(defCycle, useCycle, node, immRegIndex)) {
190  TerminalImmediate* tempImm =
191  dynamic_cast<TerminalImmediate*>(
192  node.move().source().copy());
193  const ImmediateUnit& iu =
194  dynamic_cast<const ImmediateUnit&>(
195  machinePartOf(*iuRes));
196  RFPort* port = iu.port(0);
197  TerminalRegister* newSrc = new TerminalRegister(*port, 0);
198  auto imm = std::make_shared<Immediate>(tempImm, newSrc);
199  if (rm_->isTemplateAvailable(defCycle, imm)) {
200  tmpResult.push_back(iuRes);
201  }
202  }
203  }
204  resIter++;
205  }
206  sort(tmpResult.begin(), tmpResult.end(), less_width());
207  std::vector<IUResource*>::iterator tmpItr = tmpResult.begin();
208  while (tmpItr != tmpResult.end()) {
209  results.insert(*(*tmpItr));
210  tmpItr++;
211  }
212  if (immWriteCycle != -1) {
213  break;
214  }
215  defCycle--;
216  }
217  return results;
218 }
219 /**
220  * Mark given resource as in use for the given node, and assign the
221  * corresponding machine part (if applicable) to the node's move.
222  *
223  * @param useCycle Cycle in which immediate register is read by Node
224  * @param node MoveNode that reads a register
225  * @param res Long immediate register file resource
226  * @param immWriteCycle forced def cycle for the immediate. Not forced if -1
227  * @exception WrongSubclass If this broker does not recognise the given
228  * type of resource.
229  * @exception InvalidParameters If he given resource cannot be assigned to
230  * given node or no corresponding machine part is found.
231  */
232 void
234  int useCycle, MoveNode& node, SchedulingResource& res, int immWriteCycle,
235  int immRegIndex) {
236 
237  int defCycle = useCycle;
238  if (immWriteCycle != -1) {
239  defCycle = immWriteCycle;
240  }
241 
242  IUResource& iuRes = dynamic_cast<IUResource&>(res);
243  Move& move = const_cast<MoveNode&>(node).move();
244 
245  if (hasResource(res)) {
246  ImmediateUnit& iu =
247  const_cast<ImmediateUnit&>(
248  dynamic_cast<const ImmediateUnit&>(machinePartOf(res)));
249 
250  // pre-split LIMM
251  if (node.move().source().isImmediateRegister()) {
252  const ImmediateUnit& iuSrc =
253  node.move().source().immediateUnit();
254  assert(&iu == &iuSrc);
255  IUResource* iuRes = static_cast<IUResource*>(resourceOf(iu));
256  iuRes->assign(useCycle, node);
257  assignedResources_.insert(
258  std::pair<const MoveNode*, SchedulingResource*>(&node, iuRes));
259 
260  } else {
261  int index = -1;
262  // IURes assign method will set index to the register
263  // in IU that was assigned for immediate read
264 
265  while (defCycle >= 0 && (useCycle - defCycle) < MAX_LIMM_DISTANCE) {
266  if (iuRes.canAssign(defCycle, useCycle, node, immRegIndex)) {
267  TerminalImmediate* tempImm =
268  dynamic_cast<TerminalImmediate*>(
269  node.move().source().copy());
270  const ImmediateUnit& iu =
271  dynamic_cast<const ImmediateUnit&>(machinePartOf(iuRes));
272  RFPort* port = iu.port(0);
273  TerminalRegister* newSrc = new TerminalRegister(*port, 0);
274  auto imm = std::make_shared<Immediate>(tempImm, newSrc);
275  if (rm_->isTemplateAvailable(defCycle, imm)) {
276  break;
277  }
278  }
279  if (immWriteCycle != -1) {
280  std::cerr << "Use cycle: " << useCycle << " imm cycle: "
281  << immWriteCycle << " node: " << node.toString()
282  << std::endl;
283  assert(NULL && "Can't assign forced imm write at cycle");
284  }
285  defCycle--;
286  }
287  // is index forced?
288  if (immRegIndex != -1)
289  index = immRegIndex;
290  iuRes.assign(defCycle, useCycle, node, index);
291 
292 
293  // temporary, source() has to know some port of IU to
294  // be able to identify which IU Move uses.
295  // OutputPSocket broker will assign a free port later
296  RFPort* port = iu.port(0);
297  assignedResources_.insert(
298  std::pair<const MoveNode*, SchedulingResource*>(&node, &iuRes));
299  TerminalRegister* newSrc = new TerminalRegister(*port, index);
300  move.setSource(newSrc);
301  }
302  } else {
303  string msg = "Broker does not contain given resource.";
304  throw InvalidData(__FILE__, __LINE__, __func__, msg);
305  }
306 }
307 
308 /**
309  * Free the Immediate register and set MoveNode source back to
310  * TerminalImmediate constant.
311  *
312  * If this broker is not applicable to the given node, or the node is
313  * not assigned a resource of the managed type, this method does
314  * nothing.
315  *
316  * @param node Node.
317  * @note The ImmediateResource keeps a copy of original source terminal and
318  * will restore it during unassignment.
319  */
320 void
323  TCEString msg = "Trying to unassign Long Immediate register ";
324  msg += "that was not assigned previously: " + node.toString();
325  abortWithError(msg);
326  return;
327  }
328  IUResource* iuRes = dynamic_cast<IUResource*>(
329  MapTools::valueForKey<SchedulingResource*>(
330  assignedResources_, &node));
331  iuRes->unassign(node.cycle(), node);
332  assignedResources_.erase(&node);
333 }
334 
335 /**
336  * Return the earliest cycle, starting from given cycle, where a
337  * resource of the type managed by this broker can be assigned to the
338  * given node.
339  *
340  * @param cycle Cycle.
341  * @param node Node.
342  * @return The earliest cycle, starting from given cycle, where a
343  * resource of the type managed by this broker can be assigned to the
344  * given node.
345  */
346 int
348  int, const MoveNode&,
349  const TTAMachine::Bus*,
351  const TTAMachine::FunctionUnit*, int,
353  int) const {
354  abortWithError("Not implemented.");
355  return -1;
356 }
357 
358 /**
359  * Return the latest cycle, starting from given cycle, where a
360  * resource of the type managed by this broker can be assigned to the
361  * given node.
362  *
363  * @param cycle Cycle.
364  * @param node Node.
365  * @return The latest cycle, starting from given cycle, where a
366  * resource of the type managed by this broker can be assigned to the
367  * given node.
368  */
369 int
371  const TTAMachine::Bus*,
373  const TTAMachine::FunctionUnit*, int,
375  int) const {
376  abortWithError("Not implemented.");
377  return -1;
378 }
379 
380 /**
381  * Return true if the given node is already assigned a resource of the
382  * type managed by this broker, and the assignment appears valid (that
383  * is, the broker has marked that resource as in use in the given
384  * cycle).
385  *
386  * @param cycle Cycle.
387  * @param node Node.
388  * @return True if the given node is already assigned a resource of the
389  * type managed by this broker, and the assignment appears valid (that
390  * is, the broker has marked that resource as in use in the given
391  * cycle).
392  */
393 bool
395  int, const MoveNode& node, const TTAMachine::Bus*) const {
397  return false;
398  }
399  try {
400  // Somehow nasty solution, but in correct case should
401  // never be throwing exception
402  IUResource* iu = dynamic_cast<IUResource*>(
403  MapTools::valueForKey<SchedulingResource*>(
404  assignedResources_, &node));
405  iu->immediateValue(node);
406  } catch (const KeyNotFound&) {
407  return false;
408  }
409  return true;
410 }
411 
412 /**
413  * Return true if the given node needs a resource of the type managed
414  * by this broker, false otherwise.
415  *
416  * @param node Node.
417  * @return True if the given node is Immediate read.
418  * @note this method is called to determine if node needs IU resource
419  * as well as by resetAssignments to remove the IU assignment
420  */
421 bool
423  const MoveNode& node, const TTAMachine::Bus* preassignedBus) const {
424  if (!node.isMove()) {
425  return false;
426  }
427  if (node.isSourceImmediateRegister()) {
428  return true;
429  }
430  // If node is annotated, it needs to be converted to LIMM,
431  // detected in BB scheduler
432  if (node.isSourceConstant() && node.move().hasAnnotations(
434  return true;
435  }
436  if (node.isSourceConstant() &&
437  !rm_->canTransportImmediate(node, preassignedBus)) {
438  return true;
439  }
440  return false;
441 }
442 
443 /**
444  * Build all resource objects of the controlled type required to model
445  * scheduling resources of the given target processor.
446  *
447  * This method cannot set up the resource links (dependent and related
448  * resources) of the constructed resource objects.
449  *
450  * @param target Target machine.
451  */
452 void
454 
455  target_ = &target;
457 
458  for (int i = 0; i < navi.count(); i++) {
459  ImmediateUnit* iu = navi.item(i);
460  bool extension = false;
461  if (iu->extensionMode() == Machine::ZERO) {
462  extension = false;
463  } else {
464  extension = true;
465  }
466  IUResource* iuResource =
467  new IUResource(
468  target,
469  iu->name(), iu->numberOfRegisters(), iu->width(),
470  iu->latency(), extension, initiationInterval_);
471  ResourceBroker::addResource(*iu, iuResource);
472  }
473 }
474 
475 /**
476  * Complete resource initialisation by creating the references to
477  * other resources due to a dependency or a relation. Use the given
478  * resource mapper to lookup dependent and related resources using
479  * machine parts as keys.
480  *
481  * @param mapper Resource mapper.
482  */
483 void
485 
486  setResourceMapper(mapper);
487 
488  for (ResourceMap::iterator resIter = resMap_.begin();
489  resIter != resMap_.end(); resIter++) {
490 
491  const ImmediateUnit* iu =
492  dynamic_cast<const ImmediateUnit*>((*resIter).first);
493 
494  SchedulingResource* iuResource = (*resIter).second;
495  for (int i = 0; i < iu->portCount(); i++) {
496  Port* port = iu->port(i);
497  if (port->outputSocket() != NULL) {
498  try {
499  SchedulingResource& relatedRes =
500  mapper.resourceOf(*port->outputSocket());
501  iuResource->addToRelatedGroup(0, relatedRes);
502  } catch (const KeyNotFound& e) {
503  std::string msg = "IUBroker: finding ";
504  msg += " resource for Socket ";
505  msg += " failed with error: ";
506  msg += e.errorMessageStack();
507  throw KeyNotFound(
508  __FILE__, __LINE__, __func__, msg);
509  }
510  }
511  }
512 
515 
516  for (int i = 0; i < navi.count(); i++) {
517  InstructionTemplate* itemplate = navi.item(i);
518  if (itemplate->isOneOfDestinations(*iu)) {
519  try {
520  SchedulingResource& relatedRes =
521  mapper.resourceOf(*itemplate);
522  iuResource->addToRelatedGroup(1, relatedRes);
523  } catch (const KeyNotFound& e) {
524  std::string msg = "IUBroker: finding ";
525  msg += " resource for Template ";
526  msg += " failed with error: ";
527  msg += e.errorMessageStack();
528  throw KeyNotFound(
529  __FILE__, __LINE__, __func__, msg);
530  }
531  }
532  }
533  }
534  // todo: dependent register resources?
535 }
536 
537 /**
538  * Return true always.
539  *
540  * @return True always.
541  */
542 bool
544  return true;
545 }
546 
547 /**
548  * Returns a original Immediate value for a node
549  *
550  * @param node Node that was changed to immediate register
551  * read
552  * @return Terminal representing original source of Move
553  */
554 std::shared_ptr<TTAProgram::TerminalImmediate>
555 IUBroker::immediateValue(const MoveNode& node) const {
556  if (!node.isSourceImmediateRegister()) {
557  return NULL;
558  }
560  IUResource* iuRes = dynamic_cast<IUResource*>(
561  MapTools::valueForKey<SchedulingResource*>(
562  assignedResources_, &node));
563  return iuRes->immediateValue(node);
564  }
565  throw KeyNotFound(__FILE__, __LINE__, __func__,
566  "MoveNode was not assigned Immediate resource.");
567 }
568 
569 /**
570  * Returns a cycle in which the original Immediate value is written
571  * into immediate register.
572  *
573  * @param node Node that was changed to immediate register
574  * read
575  * @return Cycle in which immediate was written into register.
576  */
577 int
579  if (!node.isSourceImmediateRegister()) {
580  return -1;
581  }
583  IUResource* iuRes = dynamic_cast<IUResource*>(
584  MapTools::valueForKey<SchedulingResource*>(
585  assignedResources_, &node));
586  return iuRes->immediateWriteCycle(node);
587  }
588  throw KeyNotFound(__FILE__, __LINE__, __func__,
589  "MoveNode was not assigned Immediate resource.");
590 }
591 
592 /**
593  * Clears bookkeeping which is needed for unassigning previously assigned
594  * moves. After this call these cannot be unassigned, but new moves which
595  * are assigned after this call can still be unassigned.
596  */
597 void
599  for (ResourceMap::iterator i = resMap_.begin(); i != resMap_.end(); i++) {
600  IUResource* iuRes = static_cast<IUResource*>(i->second);
601  iuRes->clearOldResources();
602  }
603 }
TTAProgram
Definition: Estimator.hh:65
IUBroker::~IUBroker
virtual ~IUBroker()
Definition: IUBroker.cc:81
IUBroker::clearOldResources
void clearOldResources()
Definition: IUBroker.cc:598
OutputPSocketResource.hh
IUBroker::isAlreadyAssigned
virtual bool isAlreadyAssigned(int cycle, const MoveNode &node, const TTAMachine::Bus *preassignedBus) const override
Definition: IUBroker.cc:394
ResourceBroker::initiationInterval_
unsigned int initiationInterval_
Definition: ResourceBroker.hh:158
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
MoveNode::toString
std::string toString() const
Definition: MoveNode.cc:576
ResourceMapper.hh
ResourceBroker::resMap_
ResourceMap resMap_
Definition: ResourceBroker.hh:165
IUBroker::target_
const TTAMachine::Machine * target_
Target machine.
Definition: IUBroker.hh:127
MAX_LIMM_DISTANCE
static const int MAX_LIMM_DISTANCE
Definition: IUBroker.cc:58
IUBroker::isIUBroker
virtual bool isIUBroker() const override
Definition: IUBroker.cc:543
MapTools.hh
TTAMachine::Bus
Definition: Bus.hh:53
IUBroker::isApplicable
virtual bool isApplicable(const MoveNode &node, const TTAMachine::Bus *preassignedBus) const override
Definition: IUBroker.cc:422
IUBroker::allAvailableResources
virtual SchedulingResourceSet allAvailableResources(int, const MoveNode &, const TTAMachine::Bus *bus, const TTAMachine::FunctionUnit *srcFU, const TTAMachine::FunctionUnit *dstFU, int immWriteCycle, const TTAMachine::ImmediateUnit *immu, int immRegIndex) const override
Definition: IUBroker.cc:149
IUBroker::assign
virtual void assign(int, MoveNode &, SchedulingResource &, int immWriteCycle, int immRegIndex) override
Definition: IUBroker.cc:233
ResourceBroker
Definition: ResourceBroker.hh:61
ResourceBroker::hasResource
bool hasResource(const SchedulingResource &r) const
Definition: ResourceBroker.cc:214
IUBroker.hh
MoveNode
Definition: MoveNode.hh:65
MoveNode::isSourceConstant
bool isSourceConstant() const
Definition: MoveNode.cc:238
ResourceBroker::assignedResources_
MoveResMap assignedResources_
Definition: ResourceBroker.hh:167
ResourceMapper::resourceOf
SchedulingResource & resourceOf(const TTAMachine::MachinePart &mp, int index=0) const
Definition: ResourceMapper.cc:96
TTAMachine::Machine::Navigator::count
int count() const
ResourceBroker::addResource
void addResource(const TTAMachine::MachinePart &mp, SchedulingResource *res)
Definition: ResourceBroker.cc:265
TTAMachine::ImmediateUnit::latency
virtual int latency() const
Definition: ImmediateUnit.cc:155
TTAMachine::RFPort
Definition: RFPort.hh:45
TerminalRegister.hh
TTAMachine::BaseRegisterFile::numberOfRegisters
virtual int numberOfRegisters() const
MoveNode::isSourceImmediateRegister
bool isSourceImmediateRegister() const
Definition: MoveNode.cc:223
TCEString.hh
TTAMachine::InstructionTemplate
Definition: InstructionTemplate.hh:49
SchedulingResourceSet
Definition: SchedulingResource.hh:161
assert
#define assert(condition)
Definition: Application.hh:86
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
TTAProgram::Terminal::isImmediateRegister
virtual bool isImmediateRegister() const
Definition: Terminal.cc:97
MoveNode::isMove
bool isMove() const
ResourceBroker::setResourceMapper
void setResourceMapper(const ResourceMapper &mapper)
Definition: ResourceBroker.cc:224
abortWithError
#define abortWithError(message)
Definition: Application.hh:72
SchedulingResource::addToRelatedGroup
virtual void addToRelatedGroup(const int group, SchedulingResource &resource)
Definition: SchedulingResource.cc:82
MoveNode::cycle
int cycle() const
Definition: MoveNode.cc:421
InvalidData
Definition: Exception.hh:149
IUResource.hh
IUBroker::earliestCycle
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
Definition: IUBroker.cc:347
TTAMachine::Machine::immediateUnitNavigator
virtual ImmediateUnitNavigator immediateUnitNavigator() const
Definition: Machine.cc:416
SchedulingResource
Definition: SchedulingResource.hh:52
TTAMachine::Port
Definition: Port.hh:54
IUResource::assign
virtual void assign(const int cycle, MoveNode &node) override
Definition: IUResource.cc:175
__func__
#define __func__
Definition: Application.hh:67
IUBroker::isAnyResourceAvailable
bool isAnyResourceAvailable(int useCycle, 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
Definition: IUBroker.cc:97
Exception::errorMessageStack
std::string errorMessageStack(bool messagesOnly=false) const
Definition: Exception.cc:138
ResourceBroker::resourceOf
SchedulingResource * resourceOf(const TTAMachine::MachinePart &mp) const
TTAProgram::Terminal::immediateUnit
virtual const TTAMachine::ImmediateUnit & immediateUnit() const
Definition: Terminal.cc:240
IUBroker::IUBroker
IUBroker(std::string)
Definition: IUBroker.cc:63
TTAProgram::ProgramAnnotation::ANN_REQUIRES_LIMM
@ ANN_REQUIRES_LIMM
Definition: ProgramAnnotation.hh:125
TTAProgram::Move
Definition: Move.hh:55
IUResource::canAssign
virtual bool canAssign(const int, const MoveNode &) const override
Definition: IUResource.cc:282
IUBroker::rm_
SimpleResourceManager * rm_
Definition: IUBroker.hh:136
Machine.hh
IUBroker::latestCycle
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
Definition: IUBroker.cc:370
TTAMachine::InstructionTemplate::isOneOfDestinations
virtual bool isOneOfDestinations(const ImmediateUnit &dstUnit) const
Definition: InstructionTemplate.cc:323
IUResource::immediateWriteCycle
int immediateWriteCycle(const MoveNode &node) const
Definition: IUResource.cc:433
TTAMachine::Unit::portCount
virtual int portCount() const
Definition: Unit.cc:135
TTAProgram::AnnotatedInstructionElement::hasAnnotations
bool hasAnnotations(ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID) const
Definition: AnnotatedInstructionElement.cc:165
IUBroker::availableResource
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 override
Definition: IUBroker.cc:122
IUResource
Definition: IUResource.hh:56
TTAProgram::TerminalImmediate
Definition: TerminalImmediate.hh:44
IUBroker::unassign
virtual void unassign(MoveNode &node) override
Definition: IUBroker.cc:321
MoveNode::move
TTAProgram::Move & move()
TTAMachine::BaseRegisterFile::port
virtual RFPort * port(const std::string &name) const
Definition: BaseRegisterFile.cc:129
IUResource::unassign
virtual void unassign(const int cycle, MoveNode &node) override
Definition: IUResource.cc:240
MapTools::containsKey
static bool containsKey(const MapType &aMap, const KeyType &aKey)
TerminalImmediate.hh
Immediate.hh
IUResource::immediateValue
std::shared_ptr< TTAProgram::TerminalImmediate > immediateValue(const MoveNode &node) const
Definition: IUResource.cc:407
SimpleResourceManager::canTransportImmediate
virtual bool canTransportImmediate(const MoveNode &node, const TTAMachine::Bus *preAssignedBus=NULL) const
Definition: SimpleResourceManager.cc:411
TCEString
Definition: TCEString.hh:53
ResourceMapper
Definition: ResourceMapper.hh:51
SimpleResourceManager::isTemplateAvailable
virtual bool isTemplateAvailable(int, std::shared_ptr< TTAProgram::Immediate >) const
Definition: SimpleResourceManager.cc:543
TTAProgram::Terminal::copy
virtual Terminal * copy() const =0
TTAMachine::Port::outputSocket
virtual Socket * outputSocket() const
Definition: Port.cc:281
IUBroker::immediateValue
virtual std::shared_ptr< TTAProgram::TerminalImmediate > immediateValue(const MoveNode &node) const
Definition: IUBroker.cc:555
SimpleResourceManager.hh
TTAProgram::Move::source
Terminal & source() const
Definition: Move.cc:302
SimpleResourceManager
Definition: SimpleResourceManager.hh:58
IUBroker::setupResourceLinks
virtual void setupResourceLinks(const ResourceMapper &mapper) override
Definition: IUBroker.cc:484
ResourceBroker::machinePartOf
virtual const TTAMachine::MachinePart & machinePartOf(const SchedulingResource &r) const
Definition: ResourceBroker.cc:181
TTAMachine::Machine::Navigator::item
ComponentType * item(int index) const
KeyNotFound
Definition: Exception.hh:285
TTAMachine::ImmediateUnit::extensionMode
virtual Machine::Extension extensionMode() const
Definition: ImmediateUnit.cc:143
Move.hh
TTAMachine
Definition: Assembler.hh:48
IUBroker::buildResources
virtual void buildResources(const TTAMachine::Machine &target) override
Definition: IUBroker.cc:453
MoveNode.hh
TTAMachine::Machine::instructionTemplateNavigator
virtual InstructionTemplateNavigator instructionTemplateNavigator() const
Definition: Machine.cc:428
TTAMachine::BaseRegisterFile::width
virtual int width() const
SchedulingResourceSet::insert
void insert(SchedulingResource &resource)
Definition: SchedulingResource.cc:236
IUResource::clearOldResources
void clearOldResources()
Definition: IUResource.cc:560
TTAMachine::Machine::Navigator
Definition: Machine.hh:186
IUBroker::immediateWriteCycle
virtual int immediateWriteCycle(const MoveNode &node) const
Definition: IUBroker.cc:578
IUBroker::less_width
Functor for sorting result of allAvailable by register width.
Definition: IUBroker.hh:129
TTAProgram::TerminalRegister
Definition: TerminalRegister.hh:53
InstanceNotFound
Definition: Exception.hh:304
TTAProgram::Move::setSource
void setSource(Terminal *src)
Definition: Move.cc:312
TTAMachine::Machine
Definition: Machine.hh:73
TTAMachine::ImmediateUnit
Definition: ImmediateUnit.hh:50