OpenASIP  2.0
MoveNode.cc
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
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 MoveNode.cc
26  *
27  * Implementation of MoveNode class.
28  *
29  * Nodes are the minimum independent unit of information in a
30  * minimally-ordered program representation. Typically, but not necessarily,
31  * the nodes in a program representation are linked together by dependences
32  * and thus form a graph.
33  *
34  * @author Ari Mets�halme 2006 (ari.metsahalme-no.spam-tut.fi)
35  * @author Vladimir Guzma 2006 (vladimir.guzma-no.spam-tut.fi)
36  * @note rating: red
37  */
38 
39 #include <iostream>
40 #include <climits>
41 #include <boost/format.hpp>
42 
43 #include "MoveNode.hh"
44 #include "Port.hh"
45 #include "SpecialRegisterPort.hh"
46 #include "Bus.hh"
47 #include "UniversalMachine.hh"
48 #include "ProgramOperation.hh"
49 #include "POMDisassembler.hh"
50 #include "SetTools.hh"
51 #include "FUPort.hh"
52 #include "HWOperation.hh"
53 #include "TCEString.hh"
54 #include "Guard.hh"
55 #include "ControlUnit.hh"
56 #include "Terminal.hh"
57 #include "MoveGuard.hh"
58 #include "Operation.hh"
59 #include "Move.hh"
60 #include "Conversion.hh"
61 #include "Immediate.hh"
62 #include "Instruction.hh"
63 
64 using namespace TTAMachine;
65 
66 //#define PRINT_ID
67 
68 /**
69  * Constructor.
70  *
71  * Creates a new node with a smart pointer to the given Move.
72  *
73  * @param newmove the Move this node refers to.
74  */
75 MoveNode::MoveNode(std::shared_ptr<TTAProgram::Move> newMove) :
76  move_(newMove), immediate_(nullptr), srcOp_(nullptr), guardOp_(nullptr),
77  cycle_(0), placed_(false), finalized_(false), isInFrontier_(false) {
78 }
79 
80 /**
81  * Constructor.
82  *
83  * Creates a new node with a smart pointer to the given immediate.
84  *
85  * @param imm the long immediate this node refers to.
86  */
87 MoveNode::MoveNode(std::shared_ptr<TTAProgram::Immediate> imm) :
88  move_(nullptr), immediate_(imm), srcOp_(nullptr), guardOp_(nullptr),
89  cycle_(0), placed_(false), finalized_(false), isInFrontier_(false) {
90 }
91 
92 /**
93  * Constructor.
94  *
95  * Creates a new node to be entry node.
96  *
97  */
98 
100  move_(nullptr), immediate_(nullptr), srcOp_(nullptr), guardOp_(nullptr),
101  cycle_(0), placed_(false), finalized_(false), isInFrontier_(false) {
102 }
103 
104 /**
105  * Destructor.
106  *
107  * Deletes the owned Move instance.
108  * Does not unregister this movenode from ProgramOperations.
109  */
111 
112  if (isSourceOperation()) {
114  }
115  if (isGuardOperation()) {
117  }
118 
119  if (isDestinationOperation()) {
120  for (unsigned int i = 0; i < destinationOperationCount(); i++) {
122  }
123  }
124 }
125 
126 /**
127  * Creates a deep copy of MoveNode.
128  *
129  * Sets the source and destination operation of the copy to the same as
130  * original. Does not copy the cycle.
131  *
132  * @return return copy of MoveNode.
133  */
134 MoveNode*
136 
137  MoveNode* newNode = NULL;
138  if (move_ != NULL) {
139  newNode = new MoveNode(move_->copy());
140  } else {
141  if (immediate_) {
142  newNode = new MoveNode(immediate_->copy());
143  } else {
144  newNode = new MoveNode;
145  }
146  }
147 
148  if (isSourceOperation()) {
149  sourceOperation().addOutputNode(*newNode);
151  }
152 
153  if (isDestinationOperation()) {
154  for (unsigned int i = 0; i < destinationOperationCount(); i++) {
155  destinationOperation(i).addInputNode(*newNode);
157  }
158  }
159  return newNode;
160 }
161 
162 /**
163  * Tells whether the source of the MoveNode (move) belongs to an operation.
164  *
165  * @return True if the source of the MoveNode is an operation output.
166  */
167 bool
169  if (move_ == NULL) {
170  return false;
171  }
172  return srcOp_.get() != NULL;
173 }
174 
175 /**
176  * Tells whether the guard of the MoveNode (move) is a port guard from op.
177  *
178  * @return True if the source of the MoveNode is an operation output.
179  */
180 bool
182  if (move_ == NULL) {
183  return false;
184  }
185  return guardOp_.get() != NULL;
186 }
187 
188 
189 /**
190  * Tells whether the node (move) reads a program variable or, if assigned, a
191  * GPR.
192  *
193  * @return True if the source of the node is a variable or GPR.
194  */
195 bool
197  if (move_ == NULL) {
198  return false;
199  }
200  return move_->source().isGPR();
201 }
202 
203 /**
204  * Tells whether the node (move) reads the return address port.
205  * GPR.
206  *
207  * @return True if the source of the node is the return address port.
208  */
209 bool
211  if (move_ == NULL) {
212  return false;
213  }
214  return move_->source().isRA();
215 }
216 
217 /**
218  * Tells whether the node (move) reads a Immediate Register
219  *
220  * @return True if the source of the node is Immediate register.
221  */
222 bool
224  if (move_ == NULL) {
225  return false;
226  }
227  return move_->source().isImmediateRegister();
228 }
229 
230 
231 /**
232  * Tells whether the source of the node (move) is a program constant. If
233  * assigned, the constant is an in-line immediate.
234  *
235  * @return True if the source of the node is a constant.
236  */
237 bool
239  if (move_ == NULL) {
240  return false;
241  }
242  return move_->source().isImmediate();
243 }
244 
245 
246 
247 /**
248  * Tells whether the move belongs to an operation execution.
249  *
250  * @return True if the the node belongs to an operation.
251  */
252 bool
255 }
256 
257 /**
258  * Tells whether the node (move) writes a program variable or, if assigned,
259  * a GPR.
260  *
261  * @return True if the destination of the node is a variable or GPR.
262  */
263 bool
265  if (move_ == NULL) {
266  return false;
267  }
268  return move_->destination().isGPR();
269 }
270 
271 
272 /**
273  * Tells whether the node is a ``software bypass'' - both its source and its
274  * destination belong to operations.
275  *
276  * @return True if both source and destination of the node are operation
277  * terminals.
278  */
279 bool
282 }
283 
284 /**
285  * Tells whether the node is a register move, thus not belong to
286  * any particular ProgramOperation.
287  *
288  * It's either an immediate move to an register or a register to register
289  * copy.
290  *
291  * @return True if the move is a register to register copy.
292  */
293 bool
296 }
297 
298 
299 /**
300  * Returns true if this MoveNode is in the same ProgramOperation as the
301  * given MoveNode.
302  *
303  * @return True if both MoveNodes belong to the same ProgramOperation.
304  */
305 bool
306 MoveNode::inSameOperation(const MoveNode& other) const {
307 
308  if (other.isRegisterMove() || this->isRegisterMove())
309  return false;
310 
311  unsigned int dopCount1 = destinationOperationCount();
312  unsigned int dopCount2 = other.destinationOperationCount();
313 
314  if (isSourceOperation()) {
315  if (other.isSourceOperation()) {
316  if (&sourceOperation() == &other.sourceOperation()) {
317  return true;
318  }
319  }
320  for (unsigned int i = 0; i < dopCount2; i++) {
321  if (&other.destinationOperation(i) == &sourceOperation()) {
322  return true;
323  }
324  }
325  }
326 
327  for (unsigned int i = 0; i < dopCount1; i++) {
328  const ProgramOperation* dop = &destinationOperation(i);
329  if (other.isSourceOperation()) {
330  if (dop == &other.sourceOperation()) {
331  return true;
332  }
333  }
334 
335  for (unsigned int j = 0; j < dopCount2; j++) {
336  if (&other.destinationOperation(j) == dop) {
337  return true;
338  }
339  }
340  }
341  return false;
342 }
343 
344 
345 /**
346  * Tells whether is placed in the program representation, that is, has a
347  * cycle assigned to it.
348  *
349  * @return True if a cycle is assigned to the node.
350  */
351 bool
353  return placed_;
354 }
355 
356 
357 /**
358  * Tells whether the node is fully assigned.
359  *
360  * A node is fully assigned when all the resources of the target processor
361  * necessary to carry out the transport it specifies are assigned to it.
362  *
363  * @return True if all required scheduling resources of target machine are
364  * assigned to the node.
365  */
366 bool
368 
369  if (immediate_ != NULL) {
370  TTAProgram::Instruction* parent = immediate_->parent();
371  return parent != NULL &&
372  &parent->instructionTemplate() !=
373  &NullInstructionTemplate::instance();
374  }
375 
376  if (move_ == NULL) {
377  // probably a dummy ENTRYNODE or something
378  return false;
379  }
380 
381  /// Machine found is NOT UniversalMachine - we are happy
382  if (!move_->bus().machine()->isUniversalMachine()) {
383  if ((isSourceOperation() ||
384  isSourceVariable() ||
386  (move_->source().port().parentUnit()->machine() !=
387  move_->bus().machine())) {
388  return false;
389  }
391  (move_->destination().port().parentUnit()->machine() !=
392  move_->bus().machine())) {
393  return false;
394  }
395  return true;
396  }
397  return false;
398 }
399 
400 /**
401  * Tells whether the node is completely scheduled.
402  *
403  * A node is completely scheduled only if it is assigned to a program cycle
404  * and the necessary resources of the target processor are assigned to it.
405  *
406  * @return True if the node is placed and assigned.
407  */
408 bool
410  return isPlaced() && isAssigned();
411 }
412 
413 
414 /**
415  * Returns the cycle (index) assigned to the node.
416  *
417  * @return The cycle in which the node is placed.
418  * @exception InvalidData if the node is not placed.
419  */
420 int
422  if (!isPlaced()){
423  std::string msg = "MoveNode was not placed yet: " + toString();
424  throw InvalidData(__FILE__, __LINE__, __func__, msg);
425  } else {
426  return cycle_;
427  }
428 }
429 
430 /**
431  * Returns the enclosing scheduling scope of the node.
432  *
433  * @return A scheduling scope.
434  */
435 Scope&
437  ///TODO: Intentionally falsified code
438  /// Class Scope does not exists so far in real
439  Scope* ns = new Scope;
440  return *ns;
441 }
442 
443 
444 /**
445  * Returns the instance of operation in the program whose output is the
446  * source of this node.
447  *
448  * @return A program operation.
449  * @exception InvalidData if the given node does not read an operation
450  * output.
451  */
454  return *sourceOperationPtr().get();
455 }
456 
459  if (!isSourceOperation()){
460  std::string msg =
461  (boost::format(
462  "MoveNode: '%s' source is not Operation.") % toString()).
463  str();
464  throw InvalidData(__FILE__, __LINE__, __func__, msg);
465  } else {
466  return srcOp_;
467  }
468 }
469 
470 /**
471  * Returns the instance of operation in the program whose output is the
472  * guard of this node.
473  *
474  * @return A program operation.
475  * @exception InvalidData if the given node does not read an operation
476  * output.
477  */
480  return *guardOperationPtr().get();
481 }
482 
485  if (!isGuardOperation()){
486  std::string msg =
487  (boost::format(
488  "MoveNode: '%s' guard is not Operation.") % toString()).
489  str();
490  throw InvalidData(__FILE__, __LINE__, __func__, msg);
491  } else {
492  return guardOp_;
493  }
494 }
495 
496 /**
497  * Set cycle for a node, also sets placed_
498  * @param newcycle Cycle to which node is placed_
499  * @throw InvalidData If node is already placed in cycle different from
500  * newcycle
501  */
502 void
503 MoveNode::setCycle(const int newcycle) {
504  if (placed_ == true && cycle_ != newcycle) {
505  std::string msg = "MoveNode is already placed in cycle ";
506  msg += cycle_;
507  msg += ".";
508  throw InvalidData(__FILE__, __LINE__, __func__, msg);
509  }
510  cycle_ = newcycle;
511  placed_ = true;
512 }
513 
514 /**
515  * Unset cycle from nodes
516  * @throw InvalidData If node is not placed
517  */
518 void
520  if (placed_ == false ) {
521  std::string msg = "MoveNode is not placed.";
522  throw InvalidData(__FILE__, __LINE__, __func__, msg);
523  }
524  cycle_ = 0;
525  placed_ = false;
526 }
527 
528 /**
529  * Set a destination of MoveNode to ProgramOperation
530  *
531  * @param po Program operation that is destination of MoveNode
532  */
534  dstOps_.push_back(po);
535 }
536 /**
537  * Set a source of MoveNode to ProgramOperation
538  *
539  * @param po Program operation that is source of MoveNode
540  */
542  srcOp_ = po;
543 }
544 
545 /**
546  * Set a guard src of MoveNode to ProgramOperation
547  *
548  * @param po Program operation that is source of MoveNode
549  */
551  guardOp_ = po;
552 }
553 
554 /**
555  * Returns type of the MoveNode.
556  *
557  * Not yet used anywhere and types not decided so
558  * current dummy implementation returns -1
559  *
560  * @return type of the node
561  */
562 int
564  return -1;
565 }
566 
567 /**
568  * Returns string with ID of the MoveNode.
569  *
570  * Not yet used anywhere except printing graph in .dot file. Returns the
571  * disassembly of the move along with its id.
572  *
573  * @return The string with node ID.
574  */
575 std::string
577  if (move_ == NULL) {
578  return "-1:\tENTRYNODE";
579  }
580 #ifdef PRINT_ID
581  std::string content = Conversion::toString(nodeID()) + " ";
582 #else
583  std::string content;
584 #endif
585  content += (isPlaced() ? Conversion::toString(cycle()) + " " :
586  std::string()) + POMDisassembler::disassemble(*move_);
587  if (isScheduled()) {
588  content += " Bus: " + move_->bus().name();
589  }
590  return content;
591 }
592 
593 /**
594  * Returns Dot representation of the node.
595  *
596  * Prints the disassembly of the move and sets the color of the node to red
597  * in case it's scheduled.
598  *
599  * @return The string with node ID.
600  */
601 std::string
603 
604  std::string contents = GraphNode::dotString();
605  if (isOperationMove()) {
606  unsigned operationId = 0;
607 
608  // make the outline of the moves that belong to the same operation
609  // of the same color to aid in schedule debugging
610  if (isSourceOperation())
611  operationId = sourceOperation().poId();
612  else
613  operationId = destinationOperation().poId();
614 
615  // hash the colors so that they are easy to separate/recognise.
616  // srand();rand() pair only used as a hash function,
617  // this needs to be deterministic.
618  srand(operationId);
619  int operationColor = rand() / (RAND_MAX>>24);
620 
621  contents +=
622  (boost::format(
623  ",color=\"#%.6x\"") % operationColor).str();
624  }
625 
626  if (isScheduled()) {
627  if (isFinalized()) {
628  contents += ",shape=hexagon";
629  } else {
630  contents += ",shape=box";
631  }
632  } else {
633  if (!isInFrontier_) {
634  contents += ",shape=ellipse";
635  } else {
636  contents += ",shape=diamond";
637  }
638 
639  }
640  return contents;
641 }
642 
643 /**
644  * Returns the cycle the given result move can be scheduled earliest,
645  * taking in the account the latency of the operation.
646  *
647  * In case the trigger move has not been scheduled yet, returns INT_MAX.
648  *
649  * @exception IllegalObject if this MoveNode is not a result read.
650  */
651 int
653 
654  const ProgramOperation* po;
655 
656  int outputIndex;
657  if (isSourceOperation()) {
658  po = &sourceOperation();
659  outputIndex = move_->source().operationIndex();
660  } else {
661  if (!isGuardOperation())
662  throw IllegalParameters(
663  __FILE__, __LINE__, __func__, "Not a result read move.");
664  po = &guardOperation();
665  outputIndex = po->outputIndexOfMove(*this);
666  }
667  try {
668  MoveNode* trigger = po->triggeringMove();
669  if (trigger == NULL || !trigger->isScheduled()) {
670  return INT_MAX;
671  }
672 
673  // find the latency of the operation output we are reading
674  const TTAMachine::HWOperation& hwop =
675  *trigger->move().destination().functionUnit().operation(
676  po->operation().name());
677 
678  return trigger->cycle() + hwop.latency(outputIndex);
679  } catch (const InvalidData& id) {
680  // triggeringMove() throws if the triggering move cannot be resolved
681  // again ignore this. causd by either
682  // incorrect scheduling order ( in RM tests) or
683  // broken machine ( catched by machinecheck now)
684  } catch (const Exception& e) {
686  }
687  return INT_MAX;
688 }
689 /**
690  * Returns the lates cycle the given trigger move can be scheduled at,
691  * taking in the account the latency of the operation results.
692  *
693  * In case the none of the result moves has been scheduled yet, returns INT_MAX.
694  *
695  * @exception IllegalObject if this MoveNode is not a result read.
696  */
697 int
699 
700  if (!isDestinationOperation())
701  throw IllegalParameters(
702  __FILE__, __LINE__, __func__, "Not a result read move.");
703 
705  int latestTrigger = INT_MAX;
706  for (int i = 0; i < po.outputMoveCount(); i++){
707  MoveNode& result = po.outputMove(i);
708  if (!result.isScheduled()) {
709  continue;
710  }
711  // find the latency of the operation output we are testing
712  const TTAMachine::HWOperation& hwop =
713  *result.move().source().functionUnit().operation(
714  po.operation().name());
715  // find the OSAL id of the operand of the output we are testing
716  const int outputIndex = result.move().source().operationIndex();
717  int latency = hwop.latency(outputIndex);
718  latestTrigger = std::min(latestTrigger, result.cycle() - latency);
719  }
720  return latestTrigger;
721 }
722 
723 /**
724  * Unsets destination operation.
725  *
726  * Does not ask the ProgramOperation to remove this MoveNode from
727  * it's input moves.
728  */
729 void
731  dstOps_.clear();
732 }
733 
734 /**
735  * Unsets destination operation.
736  *
737  * Does not ask the ProgramOperation to remove this MoveNode from
738  * it's input moves.
739  */
740 void
742  for (std::vector<ProgramOperationPtr>::iterator i = dstOps_.begin();
743  i != dstOps_.end(); i++) {
744  if (((*i).get()) == ptr) {
745  dstOps_.erase(i);
746  return;
747  }
748  }
749  std::string msg = "Removed destination op not found in MoveNode";
750  throw InvalidData(__FILE__, __LINE__, __func__, msg);
751 }
752 
753 /**
754  * Unsets source operation.
755  *
756  * Does not ask the ProgramOperation to remove this MoveNode from
757  * it's output moves.
758  */
759 void
762 }
763 
764 /**
765  * Unsets guard operation.
766  *
767  * Does not ask the ProgramOperation to remove this MoveNode from
768  * it's output moves.
769  */
770 void
773 }
774 
775 /**
776  * Returns the total guard latency of the guard of given move,
777  * or 0 if the move is unconditional.
778  */
780  if (!isMove()) {
781  return 0;
782  }
783  return move_->guardLatency();
784 }
785 
786 /**
787  * Checks if the source of the movenode is the given reg.
788  *
789  * This method assumes incoming reg name is in correct
790  * rf.number format, and does not check it, due performance reasons.
791  *
792  * @param reg register to check against source of the movenode
793  *
794  * @return true if the source of the movenode is the given reg.
795  * false if some other reg or not reg.
796  */
797 bool
798 MoveNode::isSourceReg(const std::string& reg) const {
799  if (!isMove()) {
800  return false;
801  }
802  if (!move().source().isGPR()) {
803  return false;
804  }
805 
806  // try to do as quickly as possible,
807  // compare the reg in string and reg in terminalregister.
808  size_t dotPlace = reg.find('.');
809  const std::string& rfName = move().source().registerFile().name();
810  if (reg.compare(0, dotPlace, rfName) != 0) {
811  return false;
812  }
813 
814  return atoi(reg.c_str()+dotPlace+1) == move().source().index();
815 }
816 
818  for (unsigned int i = 0; i < destinationOperationCount(); i++) {
819  const ProgramOperation& po = destinationOperation(i);
820  // ignore ops with just one input
821  if (po.inputMoveCount() == 1) {
822  continue;
823  }
824  bool fail = false;
825  for (int j = 0; j < po.inputMoveCount(); j++) {
826  MoveNode& inputNode = po.inputMove(j);
827  if (&inputNode != this && !inputNode.isScheduled()) {
828  fail = true;
829  break;
830  }
831  }
832  if (!fail)
833  return true;
834  }
835  return false;
836 }
837 
839  return *immediate_;
840 }
841 
843  return *immediate_;
844 }
845 
846 std::shared_ptr<TTAProgram::Immediate> MoveNode::immediatePtr() {
847  return immediate_;
848 }
MoveNode::isLastUnscheduledMoveOfDstOp
bool isLastUnscheduledMoveOfDstOp() const
Definition: MoveNode.cc:817
MoveNode::scope
Scope & scope()
Definition: MoveNode.cc:436
ProgramOperation::operation
const Operation & operation() const
Definition: ProgramOperation.cc:590
MoveNode::dotString
std::string dotString() const
Definition: MoveNode.cc:602
MoveNode::placed_
bool placed_
True when the node placed (is given a cycle in program).
Definition: MoveNode.hh:171
MoveNode::isDestinationVariable
bool isDestinationVariable() const
Definition: MoveNode.cc:264
ProgramOperation::removeInputNode
void removeInputNode(MoveNode &node)
Definition: ProgramOperation.cc:289
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
MoveNode::toString
std::string toString() const
Definition: MoveNode.cc:576
MoveNode::guardOperationPtr
ProgramOperationPtr guardOperationPtr() const
Definition: MoveNode.cc:484
TTAProgram::Terminal::index
virtual int index() const
Definition: Terminal.cc:274
TTAMachine::HWOperation
Definition: HWOperation.hh:52
TTAProgram::Terminal::registerFile
virtual const TTAMachine::RegisterFile & registerFile() const
Definition: Terminal.cc:225
MoveNode::isDestinationOperation
bool isDestinationOperation() const
TTAProgram::Instruction
Definition: Instruction.hh:57
GraphNode::dotString
virtual std::string dotString() const
Definition: GraphNode.cc:76
MoveNode::isFinalized
bool isFinalized() const
TTAProgram::Move::destination
Terminal & destination() const
Definition: Move.cc:323
GraphNode::nodeID
int nodeID() const
MoveNode::clearDestinationOperation
void clearDestinationOperation()
Definition: MoveNode.cc:730
MoveNode::isSourceReg
bool isSourceReg(const std::string &reg) const
Definition: MoveNode.cc:798
ProgramOperation
Definition: ProgramOperation.hh:70
MoveNode
Definition: MoveNode.hh:65
MoveNode::isSourceConstant
bool isSourceConstant() const
Definition: MoveNode.cc:238
Terminal.hh
Operation::name
virtual TCEString name() const
Definition: Operation.cc:93
Scope
Definition: MoveNode.hh:50
MoveNode::unsetCycle
void unsetCycle()
Definition: MoveNode.cc:519
Conversion::toString
static std::string toString(const T &source)
MoveNode::isSourceRA
bool isSourceRA() const
Definition: MoveNode.cc:210
ProgramOperation::triggeringMove
MoveNode * triggeringMove() const
Definition: ProgramOperation.cc:643
ProgramOperationPtr
std::shared_ptr< ProgramOperation > ProgramOperationPtr
Definition: MoveNode.hh:52
ProgramOperation::addOutputNode
void addOutputNode(MoveNode &node, int outputIndex)
Definition: ProgramOperation.cc:167
MoveNode::isSourceImmediateRegister
bool isSourceImmediateRegister() const
Definition: MoveNode.cc:223
POMDisassembler.hh
MoveNode::MoveNode
MoveNode()
Node can be entry node.
Definition: MoveNode.cc:99
MoveNode::isPlaced
bool isPlaced() const
Definition: MoveNode.cc:352
TCEString.hh
MoveNode::srcOp_
ProgramOperationPtr srcOp_
Definition: MoveNode.hh:162
MoveNode::setSourceOperationPtr
void setSourceOperationPtr(ProgramOperationPtr po)
Definition: MoveNode.cc:541
MoveNode::sourceOperation
ProgramOperation & sourceOperation() const
Definition: MoveNode.cc:453
UniversalMachine.hh
Port.hh
MoveNode::isMove
bool isMove() const
MoveNode::isBypass
bool isBypass() const
Definition: MoveNode.cc:280
MoveNode::isGuardOperation
bool isGuardOperation() const
Definition: MoveNode.cc:181
TTAProgram::Immediate
Definition: Immediate.hh:54
MoveNode::earliestResultReadCycle
int earliestResultReadCycle() const
Definition: MoveNode.cc:652
IllegalParameters
Definition: Exception.hh:113
TTAProgram::Terminal::operationIndex
virtual int operationIndex() const
Definition: Terminal.cc:364
abortWithError
#define abortWithError(message)
Definition: Application.hh:72
MoveNode::cycle
int cycle() const
Definition: MoveNode.cc:421
HWOperation.hh
MoveNode::guardLatency
int guardLatency() const
Definition: MoveNode.cc:779
InvalidData
Definition: Exception.hh:149
Instruction.hh
MoveNode::addDestinationOperationPtr
void addDestinationOperationPtr(ProgramOperationPtr po)
Definition: MoveNode.cc:533
Conversion.hh
__func__
#define __func__
Definition: Application.hh:67
MoveNode::guardOp_
ProgramOperationPtr guardOp_
Definition: MoveNode.hh:164
MoveNode::latestTriggerWriteCycle
int latestTriggerWriteCycle() const
Definition: MoveNode.cc:698
Guard.hh
Exception::errorMessageStack
std::string errorMessageStack(bool messagesOnly=false) const
Definition: Exception.cc:138
Operation.hh
MoveNode::isSourceOperation
bool isSourceOperation() const
Definition: MoveNode.cc:168
MoveNode::unsetSourceOperation
void unsetSourceOperation()
Definition: MoveNode.cc:760
ProgramOperation::removeGuardOutputNode
void removeGuardOutputNode(MoveNode &node)
Definition: ProgramOperation.cc:249
Exception
Definition: Exception.hh:54
MoveNode::cycle_
int cycle_
Cycle in which the node is placed. Each cycle uniquely identifies an instruction slot within the curr...
Definition: MoveNode.hh:168
Bus.hh
MoveNode::unsetGuardOperation
void unsetGuardOperation()
Definition: MoveNode.cc:771
MoveNode::destinationOperationCount
unsigned int destinationOperationCount() const
ProgramOperation::inputMoveCount
int inputMoveCount() const
Definition: ProgramOperation.cc:600
MoveNode::dstOps_
std::vector< ProgramOperationPtr > dstOps_
Definition: MoveNode.hh:160
MoveNode::immediatePtr
std::shared_ptr< TTAProgram::Immediate > immediatePtr()
Definition: MoveNode.cc:846
MoveNode::move_
const std::shared_ptr< TTAProgram::Move > move_
Pointer to Move this node represents, Node itself do not change move.
Definition: MoveNode.hh:155
ProgramOperation::outputMoveCount
int outputMoveCount() const
Definition: ProgramOperation.cc:610
TTAProgram::Instruction::instructionTemplate
const TTAMachine::InstructionTemplate & instructionTemplate() const
Definition: Instruction.cc:523
ProgramOperation.hh
TTAProgram::Terminal::functionUnit
virtual const TTAMachine::FunctionUnit & functionUnit() const
Definition: Terminal.cc:251
MoveNode::isSourceVariable
bool isSourceVariable() const
Definition: MoveNode.cc:196
MoveNode::destinationOperation
ProgramOperation & destinationOperation(unsigned int index=0) const
ProgramOperation::addInputNode
void addInputNode(MoveNode &node)
Definition: ProgramOperation.cc:144
MoveNode::destinationOperationPtr
ProgramOperationPtr destinationOperationPtr(unsigned int index=0) const
MoveNode::move
TTAProgram::Move & move()
MoveNode::setCycle
void setCycle(const int newcycle)
Definition: MoveNode.cc:503
POMDisassembler::disassemble
static std::string disassemble(const TTAProgram::Move &move)
Definition: POMDisassembler.cc:629
MoveNode::~MoveNode
virtual ~MoveNode()
Definition: MoveNode.cc:110
SetTools.hh
Immediate.hh
false
find Finds info of the inner loops in the false
Definition: InnerLoopFinder.cc:81
MoveNode::removeDestinationOperation
void removeDestinationOperation(const ProgramOperation *po)
Definition: MoveNode.cc:741
MoveNode::isRegisterMove
bool isRegisterMove() const
Definition: MoveNode.cc:294
MoveNode::inSameOperation
bool inSameOperation(const MoveNode &other) const
Definition: MoveNode.cc:306
FUPort.hh
ControlUnit.hh
SpecialRegisterPort.hh
MoveNode::setGuardOperationPtr
void setGuardOperationPtr(ProgramOperationPtr po)
Definition: MoveNode.cc:550
MoveNode::isOperationMove
bool isOperationMove() const
Definition: MoveNode.cc:253
MoveNode::sourceOperationPtr
ProgramOperationPtr sourceOperationPtr() const
Definition: MoveNode.cc:458
MoveNode::isScheduled
bool isScheduled() const
Definition: MoveNode.cc:409
TTAProgram::Move::source
Terminal & source() const
Definition: Move.cc:302
ProgramOperation::poId
unsigned int poId() const
Definition: ProgramOperation.cc:765
TTAMachine::FunctionUnit::operation
virtual HWOperation * operation(const std::string &name) const
Definition: FunctionUnit.cc:363
TTAMachine::HWOperation::latency
int latency() const
Definition: HWOperation.cc:216
MoveNode::isAssigned
bool isAssigned() const
Definition: MoveNode.cc:367
Move.hh
TTAMachine
Definition: Assembler.hh:48
MoveNode::immediate
TTAProgram::Immediate & immediate()
Definition: MoveNode.cc:838
MoveNode.hh
MoveNode::copy
MoveNode * copy()
Definition: MoveNode.cc:135
ProgramOperation::outputMove
MoveNode & outputMove(int index) const
Definition: ProgramOperation.cc:632
MoveNode::immediate_
const std::shared_ptr< TTAProgram::Immediate > immediate_
Pointer to Immediate this node represents, Node itself do not change move.
Definition: MoveNode.hh:158
MoveNode::isInFrontier_
bool isInFrontier_
This is in scheduling frontier(used in Bubblefish scheduler)
Definition: MoveNode.hh:177
ProgramOperation::outputIndexOfMove
int outputIndexOfMove(const MoveNode &mn) const
Definition: ProgramOperation.cc:886
MoveNode::type
int type()
Definition: MoveNode.cc:563
ProgramOperation::removeOutputNode
void removeOutputNode(MoveNode &node, int outputIndex)
Definition: ProgramOperation.cc:214
ProgramOperation::inputMove
MoveNode & inputMove(int index) const
Definition: ProgramOperation.cc:621
MoveNode::guardOperation
ProgramOperation & guardOperation() const
Definition: MoveNode.cc:479
MoveGuard.hh