OpenASIP  2.0
Operation.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 Operation.cc
26  *
27  * Definition of Operation class.
28  *
29  * @author Jussi Nykänen 2004 (nykanen-no.spam-cs.tut.fi)
30  * @author Pekka Jääskeläinen 2005 (pjaaskel-no.spam-cs.tut.fi)
31  * @author Mikael Lepistö 2007 (tmlepist-no.spam-cs.tut.fi)
32  * @note rating: yellow
33  * @note reviewed 17 August 2004 by jn, ll, tr, pj
34  */
35 
36 #include <algorithm>
37 
38 #include "Operation.hh"
39 #include "OperationPimpl.hh"
40 #include "TCEString.hh"
41 #include "Application.hh"
42 #include "Exception.hh"
43 #include "Operand.hh"
44 #include "OperationBehavior.hh"
45 #include "SimValue.hh"
46 #include "OperationContext.hh"
47 
48 const char* Operation::OPRN_OPERATION = "operation";
49 const char* Operation::OPRN_NAME = "name";
50 const char* Operation::OPRN_DESCRIPTION = "description";
51 const char* Operation::OPRN_INPUTS = "inputs";
52 const char* Operation::OPRN_OUTPUTS = "outputs";
53 const char* Operation::OPRN_TRAP = "trap";
54 const char* Operation::OPRN_SIDE_EFFECTS = "side-effects";
55 const char* Operation::OPRN_CLOCKED = "clocked";
56 const char* Operation::OPRN_CONTROL_FLOW = "control-flow";
57 const char* Operation::OPRN_READS_MEMORY = "reads-memory";
58 const char* Operation::OPRN_WRITES_MEMORY = "writes-memory";
59 const char* Operation::OPRN_AFFECTS = "affects";
60 const char* Operation::OPRN_AFFECTED_BY = "affected-by";
61 const char* Operation::OPRN_IN = "in";
62 const char* Operation::OPRN_OUT = "out";
63 const char* Operation::OPRN_TRIGGER = "trigger-semantics";
64 const char* Operation::OPRN_ISCALL = "is-call";
65 const char* Operation::OPRN_ISBRANCH = "is-branch";
66 
67 /**
68  * Constructor.
69  *
70  * @param name The name of the Operation.
71  * @param behavior The behavior of the Operation.
72  */
74  pimpl_(new OperationPimpl(name, behavior)) {
75 }
76 
77 /**
78  * Destructor.
79  *
80  * Operands are destroyed.
81  */
83  delete pimpl_;
84  pimpl_ = NULL;
85 }
86 
87 /**
88  * Returns the name of the Operation.
89  *
90  * @return The name of the Operation.
91  */
93 Operation::name() const {
94  return pimpl_->name();
95 }
96 
97 /**
98  * Returns the description of the Operation.
99  *
100  * @return The description of the Operation.
101  */
102 TCEString
104  return pimpl_->description();
105 }
106 
107 /**
108  * Creates new DAG and adds it's code for operation.
109  *
110  * @param code Source code written in DAG language.
111  */
112 void
114  pimpl_->addDag(code);
115 }
116 
117 /**
118  * Removes DAG of given index from operation.
119  *
120  * @param index Index of dag to delete.
121  */
122 void
124  pimpl_->removeDag(index);
125 }
126 
127 
128 /**
129  * Returns number of DAGs stored for operation.
130  *
131  * @return Number of DAGs stored for operation.
132  */
133 int
135  return pimpl_->dagCount();
136 }
137 
138 /**
139  * Returns an operation DAG for operation.
140  *
141  * Compiles DAG from code to object if necessary.
142  *
143  * @param index Index of returned DAG.
144  * @return Requested operation DAG or OperationDAG::null
145  * if DAG is not valid.
146  */
148 Operation::dag(int index) const {
149  return pimpl_->dag(index);
150 }
151 
152 /**
153  * Returns source code of DAG.
154  *
155  * @param index Index of DAG whose source code is requested.
156  * @return The source code set for DAG.
157  */
158 TCEString
159 Operation::dagCode(int index) const {
160  return pimpl_->dagCode(index);
161 }
162 
163 /**
164  * Set new source code for DAG and automatically tries to compile
165  * latest version to object.
166  *
167  * @param index Index of DAG whose source code is updated.
168  * @param code New source code in DAG Osal Language.
169  */
170 void
171 Operation::setDagCode(int index, const TCEString& code) {
172  pimpl_->setDagCode(index, code);
173 }
174 
175 /**
176  * Error message if DAG source code could not be compiled.
177  *
178  * @param index Index of DAG whose error is returned.
179  * @return Error message, empty string if DAG was compiles successfully.
180  */
181 TCEString
182 Operation::dagError(int index) const {
183  return pimpl_->dagError(index);
184 }
185 
186 /**
187  * Returns the number of the inputs of the Operation.
188  *
189  * @return The number of inputs of the Operation.
190  */
191 int
193  return pimpl_->numberOfInputs();
194 }
195 
196 /**
197  * Returns the number of outputs of the Operation.
198  *
199  * @return The number of outputs of the Operation.
200  */
201 int
203  return pimpl_->numberOfOutputs();
204 }
205 
206 /**
207  * Returns the number of all operands of the Operation.
208  *
209  * @return The number of all operands of the Operation.
210  */
211 int
213  return numberOfInputs() + numberOfOutputs();
214 }
215 
216 /**
217  * Returns true if any of the operands is a vector operand.
218  *
219  * @return True if the Operation has a vector operand, false otherwise.
220  */
221 bool
223  return false; // WiP.
224 }
225 
226 /**
227  * Returns true if Operation uses memory.
228  *
229  * @return True if Operation uses memory, false otherwise.
230  */
231 bool
233  return pimpl_->usesMemory();
234 }
235 
236 /**
237  * Returns true if Operation reads from memory.
238  *
239  * @return True if Operation reads from memory, false otherwise.
240  */
241 bool
243  return pimpl_->readsMemory();
244 }
245 
246 /**
247  * Returns true if Operation writes to memory.
248  *
249  * @return True if Operation writes to memory, false otherwise.
250  */
251 bool
253  return pimpl_->writesMemory();
254 }
255 
256 /**
257  * Returns true if Operation can trap.
258  *
259  * @return True if Operation can trap, false otherwise.
260  */
261 bool
263  return pimpl_->canTrap();
264 }
265 
266 /**
267  * Return true if operation has side effects.
268  *
269  * @return True if Operation has side effects, false otherwise.
270  */
271 bool
273  return pimpl_->hasSideEffects();
274 }
275 
276 /**
277  * Returns true if the operation is clocked.
278  *
279  * @return True if the operation is clocked.
280  */
281 bool
283  return pimpl_->isClocked();
284 }
285 
286 /**
287  * Return true if the operation can change control flow.
288  *
289  * Branches and calls of different type have this property set.
290  *
291  * @return True if Operation is a control flow operation.
292  */
293 bool
295  return pimpl_->isControlFlowOperation();
296 }
297 
298 /**
299  * Return true if the operation is branch.
300  *
301  * Branches of different type have this property set.
302  *
303  * @return True if Operation is a branch operation.
304  */
305 bool
307  return pimpl_->isBranch();
308 }
309 
310 /**
311  * Return true if the operation is call.
312  *
313  * Calls of different type have this property set.
314  *
315  * @return True if Operation is a call operation.
316  */
317 bool
319  return pimpl_->isCall();
320 }
321 
322 bool
324  std::string upperName = name().upper();
325  return upperName == "ALDW" || upperName == "ALDHU" ||
326  upperName == "ALDH" || upperName == "ALDQU" ||
327  upperName == "ALDQ" || upperName == "ASTW" ||
328  upperName == "ASTH" || upperName == "ASTQ";
329 }
330 
331 /**
332  * Sets the property of operation indicating the operation is control flow.
333  */
334 void
337 }
338 
339 /**
340  * Returns true if Operand does not have any kind of side effects program wide.
341  *
342  * In Addition of !hasSideEffects(), the operation does not access memory and
343  * is not control flow operation.
344  */
345 bool
347  return (!hasSideEffects()
348  && !usesMemory()
350  && !isCall()
351  && !isBranch() && affectsCount() == 0
352  && affectedByCount() == 0);
353 }
354 
355 /**
356  * Sets the property of operation indicating the operation is function call.
357  */
358 void
359 Operation::setCall(bool setting) {
360  pimpl_->setCall(setting);
361 }
362 
363 /**
364  * Sets the property of operation indicating the operation is branch changing
365  * control flow.
366  */
367 void
368 Operation::setBranch(bool setting) {
369  pimpl_->setBranch(setting);
370 }
371 
372 /**
373  * Sets the behavior for operation.
374  *
375  * @param behavior Behavior for an operation.
376  */
377 void
380 }
381 
382 /**
383  * Returns the behavior of Operation.
384  *
385  * @return The behavior of Operation.
386  */
389  return pimpl_->behavior();
390 }
391 
392 /**
393  * Returns the number of operations that affect this operation.
394  *
395  * @note This is from the point of view of the single operation's
396  * description. It doesn't know the affectedBy-properties globally
397  * of all possible operations!
398  *
399  * @return The number of operations that affect this operation.
400  */
401 int
403  return pimpl_->affectsCount();
404 }
405 
406 /**
407  * Returns the number of operations affected by this operation.
408  *
409  * @note This is from the point of view of the single operation's
410  * description. It doesn't know the affects-properties globally
411  * of all possible operations!
412  *
413  * @return The number of operations affected by this operation.
414  */
415 int
417  return pimpl_->affectedByCount();
418 }
419 
420 /**
421  * Returns the name of the operation this operation affects.
422  *
423  * @note This is from the point of view of the single operation's
424  * description. It doesn't know the affects-properties globally
425  * of all possible operations!
426  *
427  * @param i The index of the operation.
428  * @return The name of the operation.
429  */
430 TCEString
431 Operation::affects(unsigned int i) const {
432  return pimpl_->affects(i);
433 }
434 
435 /**
436  * Returns the name of the operation that is affected by this operation.
437  *
438  * @note This is from the point of view of the single operation's
439  * description. It doesn't know the affects-properties globally
440  * of all possible operations!
441  *
442  * @param i The index of the operation.
443  * @exception OutOfRange If index is illegal.
444  * @return The name of the operation.
445  */
446 TCEString
447 Operation::affectedBy(unsigned int i) const {
448  return pimpl_->affectedBy(i);
449 }
450 
451 /**
452  * Returns true if Operation depends on the given operation.
453  *
454  * @param op The Operation being investigated.
455  * @return True if Operation depends on the given operation, false otherwise.
456  */
457 bool
458 Operation::dependsOn(const Operation& op) const {
459  return pimpl_->dependsOn(op);
460 }
461 
462 /**
463  * Returns true if Operands can be swapped.
464  *
465  * @param id1 Id of the first Operand.
466  * @param id2 Id of the second Operand.
467  * @return True, if Operands can be swapped, false otherwise.
468  */
469 bool
470 Operation::canSwap(int id1, int id2) const {
471  return pimpl_->canSwap(id1, id2);
472 }
473 
474 /**
475  * Loads the Operation from ObjectState object.
476  *
477  * @param state The state of the Operation.
478  */
479 void
481  pimpl_->loadState(state);
482 }
483 
484 /**
485  * Saves the state of the Operation in ObjectState object.
486  *
487  * @return The state of the Operation.
488  */
491  return pimpl_->saveState();
492 }
493 
494 /**
495  * Returns the input Operand with the given index.
496  *
497  * This method can be used to traverse the list of input operands
498  * (the max index is numberOfOutput() - 1).
499  *
500  * @param index The id of Operand.
501  */
502 Operand&
503 Operation::input(int index) const {
504  return pimpl_->input(index);
505 }
506 
507 void
510 }
511 
512 void
515 }
516 
517 /**
518  * Returns the output Operand with the given index.
519  *
520  * This method can be used to traverse the list of output operands
521  * (the max index is numberOfOutput() - 1).
522  *
523  * @param index The index of Operand.
524  */
525 Operand&
526 Operation::output(int index) const {
527  return pimpl_->output(index);
528 }
529 
530 /**
531  * Returns the Operand with the given id if found, otherwise null Operand.
532  *
533  * @note This method is used to fetch operands with their 'id', the number
534  * which identifies it to the programmer. That is, output ids start from
535  * the last input id + 1, etc.
536  *
537  * @param id The id of Operand.
538  * @return Operand if found, null Operand otherwise.
539  */
540 Operand&
541 Operation::operand(int id) const {
542  return pimpl_->operand(id);
543 }
544 
545 /**
546  * Simulates the process of starting execution of an operation.
547  *
548  * @param io The input and output operands.
549  * @param context The operation context.
550  * @return True, if all values could be computed, false otherwise.
551  * @exception Exception Depends on the operation behavior.
552  *
553  */
554 bool
556  SimValue** io,
557  OperationContext& context) const {
558 
559  return pimpl_->simulateTrigger(io, context);
560 }
561 
562 /**
563  * Returns true if the given inputs for valid and sensible for the operation.
564  *
565  * The Base implementation return always true unless number of inputs does
566  * not match of the operands or the operation can not be simulated.
567  *
568  * @param inputs Input vector of SimValues for each input operand in order.
569  * Note: Vector at index 0 is for Operand 1, index 1 is
570  * for Operand 2 and so on.
571  * @param context The context in which the validation is performed.
572  */
573 bool
575  const InputOperandVector& inputs,
576  const OperationContext& context) const {
577 
578  return canBeSimulated()
579  && (inputs.size() == static_cast<size_t>(numberOfInputs()))
580  && pimpl_->behavior().areValid(inputs, context);
581 }
582 
583 /**
584  * Creates an instance of operation state for this operation and adds it to
585  * the operation context.
586  *
587  * @param context The operation context to add the state in.
588  */
589 void
591  pimpl_->createState(context);
592 }
593 
594 /**
595  * Deletes an instance of operation state for this operation from the
596  * operation context.
597  *
598  * @param context The operation context to delete the state from.
599  */
600 void
602  pimpl_->deleteState(context);
603 }
604 
605 /**
606  * Returns true if this operation has behavior, or dag which is
607  * simulateable (doesn't contain infinite recursion loop).
608  *
609  * @return True if this operation has behavior, or dag which is
610  */
611 bool
613  return pimpl_->canBeSimulated();
614 }
615 
616 /**
617  * Name of emulation function which is called if the operation is emulated
618  * in program.
619  *
620  * @return Name of emulation function of the instruction.
621  */
622 TCEString
624  return pimpl_->emulationFunctionName();
625 }
626 
627 /**
628  * Specifies if operation reads memory.
629  */
630 void
632  pimpl_->setReadsMemory(setting);
633 }
634 
635 /**
636  * Specifies if operation writes memory.
637  */
638 void
640  pimpl_->setWritesMemory(setting);
641 }
642 
643 //////////////////////////////////////////////////////////////////////////////
644 // NullOperation
645 //////////////////////////////////////////////////////////////////////////////
646 
648 
649 /**
650  * Constructor.
651  */
653  Operation("<NULL>", NullOperationBehavior::instance()) {
654 }
655 
656 /**
657  * Destructor.
658  */
660 }
661 
662 /**
663  * Aborts program with error log message.
664  *
665  * @return False.
666  */
667 bool
669  abortWithError("dependsOn()");
670  return false;
671 }
672 
673 /**
674  * Aborts program with error log message.
675  *
676  * @return 0.
677  */
678 int
680  abortWithError("affectsCount()");
681  return 0;
682 }
683 
684 /**
685  * Aborts program with error log message.
686  *
687  * @return 0.
688  */
689 int
691  abortWithError("affectedByCount()");
692  return 0;
693 }
694 
695 /**
696  * Aborts program with error log message.
697  *
698  * @exception Nothing.
699  * @return Empty string.
700  */
701 TCEString
702 NullOperation::affects(unsigned int) const {
703 
704  abortWithError("affects()");
705  return "";
706 }
707 
708 /**
709  * Aborts program with error log message.
710  *
711  * @exception Nothing.
712  * @return Empty string.
713  */
714 TCEString
715 NullOperation::affectedBy(unsigned int) const {
716 
717  abortWithError("affectedBy()");
718  return "";
719 }
720 
721 /**
722  * Aborts program with error log message.
723  *
724  * @return False
725  */
726 bool
727 NullOperation::canSwap(int, int) const {
728  abortWithError("canSwap()");
729  return false;
730 }
731 
732 /**
733  * Aborts program with error log message.
734  *
735  * @return NullOperand.
736  */
737 Operand&
739  abortWithError("input()");
740  return NullOperand::instance();
741 }
742 
743 /**
744  * Aborts program with error log message.
745  *
746  * @return NullOperand.
747  */
748 Operand&
750  abortWithError("output()");
751  return NullOperand::instance();
752 }
753 
754 /**
755  * Aborts program with error log message.
756  *
757  * @return NullOperand.
758  */
759 Operand&
761  abortWithError("operand()");
762  return NullOperand::instance();
763 }
764 
765 /**
766  * Aborts program with error log message.
767  *
768  * @return NullOperationBehavior.
769  */
772  abortWithError("behavior()");
774 }
775 
776 /**
777  * Aborts program with error log message.
778  */
779 void
781  abortWithError("setBehavior()");
782 }
783 
784 /**
785  * Aborts program with error log message.
786  *
787  * @return An empty string.
788  */
789 TCEString
791  abortWithError("name()");
792  return "";
793 }
794 
795 /**
796  * Aborts program with error log message.
797  *
798  * @return An empty string.
799  */
800 TCEString
802  abortWithError("description()");
803  return "";
804 }
805 
806 /**
807  * Aborts program with error log message.
808  *
809  * @return -1.
810  */
811 int
813  abortWithError("numberOfInputs()");
814  return -1;
815 }
816 
817 /**
818  * Aborts program with error log message.
819  *
820  * @return -1.
821  */
822 int
824  abortWithError("numberOfOutputs()");
825  return -1;
826 }
827 
828 /**
829  * Aborts program with error log message.
830  *
831  * @return False.
832  */
833 bool
835  abortWithError("usesMemory()");
836  return false;
837 }
838 
839 /**
840  * Aborts program with error log message.
841  *
842  * @return False.
843  */
844 bool
846  abortWithError("readsMemory()");
847  return false;
848 }
849 
850 /**
851  * Aborts program with error log message.
852  *
853  * @return False.
854  */
855 bool
857  abortWithError("writesMemory()");
858  return false;
859 }
860 
861 /**
862  * Aborts program with error log message.
863  *
864  * @return False.
865  */
866 bool
868  abortWithError("canTrap()");
869  return false;
870 }
871 
872 /**
873  * Aborts program with error log message.
874  *
875  * @return False.
876  */
877 bool
879  abortWithError("hasSideEffects()");
880  return false;
881 }
882 
883 /**
884  * Aborts program with error log message.
885  *
886  * @return False.
887  */
888 bool
890  abortWithError("isClocked()");
891  return false;
892 }
893 
894 /**
895  * Aborts program with error log message.
896  *
897  * @return False.
898  */
899 bool
902  return false;
903 }
904 /**
905  * Aborts program with error log message.
906  *
907  * @return False.
908  */
909 bool
912  return false;
913 }
914 /**
915  * Aborts program with error log message.
916  *
917  * @return False.
918  */
919 bool
922  return false;
923 }
924 
925 /**
926  * Aborts program with error log message.
927  *
928  * @return False.
929  * @exception Exception never.
930  */
931 bool
933  SimValue**,
934  OperationContext&) const {
935 
936  abortWithError("simulateTrigger()");
937  return false;
938 }
939 
940 /**
941  * Aborts program with error log message.
942  */
943 void
945  abortWithError("createState()");
946 }
947 
948 /**
949  * Aborts program with error log message.
950  */
951 void
953  abortWithError("deleteState()");
954 }
Operand
Definition: Operand.hh:52
NullOperation::numberOfInputs
virtual int numberOfInputs() const
Definition: Operation.cc:812
NullOperation::operand
virtual Operand & operand(int id) const
Definition: Operation.cc:760
OperationPimpl::writesMemory
bool writesMemory() const
Operation::affects
virtual TCEString affects(unsigned int i) const
Definition: Operation.cc:431
Operation::affectedByCount
virtual int affectedByCount() const
Definition: Operation.cc:416
OperationPimpl::hasSideEffects
bool hasSideEffects() const
Definition: OperationPimpl.cc:268
NullOperation
Definition: Operation.hh:186
OperationPimpl::setBranch
void setBranch(bool setting)
Definition: OperationPimpl.cc:861
Operation::writesMemory
virtual bool writesMemory() const
Definition: Operation.cc:252
OperationPimpl::name
TCEString name() const
Definition: OperationPimpl.cc:121
Operation::setReadsMemory
virtual void setReadsMemory(bool setting)
Definition: Operation.cc:631
OperationPimpl::dagError
TCEString dagError(int index) const
Definition: OperationPimpl.cc:248
OperationPimpl::affectedByCount
int affectedByCount() const
Definition: OperationPimpl.cc:353
Operation::isPure
virtual bool isPure() const
Definition: Operation.cc:346
Operation::removeDag
virtual void removeDag(int index)
Definition: Operation.cc:123
Operation::hasSideEffects
virtual bool hasSideEffects() const
Definition: Operation.cc:272
NullOperation::description
virtual TCEString description() const
Definition: Operation.cc:801
OperationPimpl::loadState
void loadState(const ObjectState *state)
Definition: OperationPimpl.cc:453
Operation::output
virtual Operand & output(int index) const
Definition: Operation.cc:526
Exception.hh
OperationPimpl
Definition: OperationPimpl.hh:54
NullOperation::behavior
virtual OperationBehavior & behavior() const
Definition: Operation.cc:771
OperationPimpl::addInput
void addInput(Operand *operand)
Definition: OperationPimpl.cc:620
Operation::addOutput
virtual void addOutput(Operand *operand)
Definition: Operation.cc:513
Operation::dagError
virtual TCEString dagError(int index) const
Definition: Operation.cc:182
Operation::OPRN_IN
static const char * OPRN_IN
Object state name for input operand.
Definition: Operation.hh:91
OperationContext
Definition: OperationContext.hh:56
OperationPimpl::isCall
bool isCall() const
Definition: OperationPimpl.cc:302
OperationPimpl::isControlFlowOperation
bool isControlFlowOperation() const
Definition: OperationPimpl.cc:290
OperationPimpl::isClocked
bool isClocked() const
Definition: OperationPimpl.cc:278
Operation::Operation
Operation(const TCEString &name, OperationBehavior &behavior)
Definition: Operation.cc:73
Operation::~Operation
virtual ~Operation()
Definition: Operation.cc:82
OperationPimpl::canTrap
bool canTrap() const
Definition: OperationPimpl.cc:258
OperationPimpl::setCall
void setCall(bool setting)
Definition: OperationPimpl.cc:852
NullOperation::instance_
static NullOperation instance_
Unique instance of NullOperation.
Definition: Operation.hh:237
Operation::dependsOn
virtual bool dependsOn(const Operation &op) const
Definition: Operation.cc:458
Operation::OPRN_NAME
static const char * OPRN_NAME
Object state name for name.
Definition: Operation.hh:67
NullOperation::NullOperation
NullOperation()
Some gcc versions warn about private constructors.
Definition: Operation.cc:652
OperationBehavior::areValid
virtual bool areValid(const InputOperandVector &inputs, const OperationContext &context) const
Definition: OperationBehavior.cc:96
Operation::numberOfInputs
virtual int numberOfInputs() const
Definition: Operation.cc:192
Operation::affectedBy
virtual TCEString affectedBy(unsigned int i) const
Definition: Operation.cc:447
ObjectState
Definition: ObjectState.hh:59
NullOperand::instance
static NullOperand & instance()
Operation::isClocked
virtual bool isClocked() const
Definition: Operation.cc:282
Operation::OPRN_AFFECTS
static const char * OPRN_AFFECTS
Object state name for affects.
Definition: Operation.hh:87
Operation::canBeSimulated
virtual bool canBeSimulated() const
Definition: Operation.cc:612
OperationPimpl::addOutput
void addOutput(Operand *operand)
Definition: OperationPimpl.cc:626
OperationPimpl::emulationFunctionName
TCEString emulationFunctionName() const
Definition: OperationPimpl.cc:819
NullOperation::affectsCount
virtual int affectsCount() const
Definition: Operation.cc:679
TCEString::upper
TCEString upper() const
Definition: TCEString.cc:86
Operation::name
virtual TCEString name() const
Definition: Operation.cc:93
Operation::OPRN_AFFECTED_BY
static const char * OPRN_AFFECTED_BY
Object state name for affected by.
Definition: Operation.hh:89
NullOperation::name
virtual TCEString name() const
Definition: Operation.cc:790
Operation::pimpl_
OperationPimpl * pimpl_
Private implementation in a separate source file.
Definition: Operation.hh:173
Operation::dagCode
virtual TCEString dagCode(int index) const
Definition: Operation.cc:159
SimValue
Definition: SimValue.hh:96
OperationPimpl::dagCode
TCEString dagCode(int index) const
Definition: OperationPimpl.cc:220
Operation::canSwap
virtual bool canSwap(int id1, int id2) const
Definition: Operation.cc:470
NullOperation::canSwap
virtual bool canSwap(int id1, int id2) const
Definition: Operation.cc:727
TCEString.hh
OperationPimpl::dagCount
int dagCount() const
Definition: OperationPimpl.cc:172
OperationPimpl::numberOfOutputs
int numberOfOutputs() const
Operation::OPRN_CONTROL_FLOW
static const char * OPRN_CONTROL_FLOW
Object state name for control flow property.
Definition: Operation.hh:81
OperationPimpl::setControlFlowOperation
void setControlFlowOperation(bool setting)
Definition: OperationPimpl.cc:844
Operation::setCall
virtual void setCall(bool setting)
Definition: Operation.cc:359
Operation::setBehavior
virtual void setBehavior(OperationBehavior &behavior)
Definition: Operation.cc:378
Operation::OPRN_DESCRIPTION
static const char * OPRN_DESCRIPTION
Object state name for description.
Definition: Operation.hh:69
OperationPimpl::saveState
ObjectState * saveState() const
Definition: OperationPimpl.cc:557
abortWithError
#define abortWithError(message)
Definition: Application.hh:72
OperationPimpl::setBehavior
void setBehavior(OperationBehavior &behavior)
Definition: OperationPimpl.cc:323
Operation::OPRN_TRAP
static const char * OPRN_TRAP
Object state name for trap.
Definition: Operation.hh:75
Operation::OPRN_TRIGGER
static const char * OPRN_TRIGGER
Object state name for trigger semantics.
Definition: Operation.hh:95
Operation::areValid
virtual bool areValid(const InputOperandVector &inputs, const OperationContext &context) const
Definition: Operation.cc:574
NullOperation::input
virtual Operand & input(int id) const
Definition: Operation.cc:738
Operation::setControlFlowOperation
virtual void setControlFlowOperation(bool setting)
Definition: Operation.cc:335
OperationPimpl::output
Operand & output(int index) const
Definition: OperationPimpl.cc:640
Operation::emulationFunctionName
TCEString emulationFunctionName() const
Definition: Operation.cc:623
Application.hh
OperationDAG
Definition: OperationDAG.hh:43
NullOperation::isControlFlowOperation
virtual bool isControlFlowOperation() const
Definition: Operation.cc:900
Operation::OPRN_OPERATION
static const char * OPRN_OPERATION
Object state name for operation.
Definition: Operation.hh:65
NullOperation::setBehavior
virtual void setBehavior(OperationBehavior &behavior)
Definition: Operation.cc:780
Operation::OPRN_CLOCKED
static const char * OPRN_CLOCKED
Object state name for clockedness.
Definition: Operation.hh:79
__func__
#define __func__
Definition: Application.hh:67
Operation::OPRN_ISCALL
static const char * OPRN_ISCALL
Object state name for call property.
Definition: Operation.hh:97
Operation::loadState
virtual void loadState(const ObjectState *state)
Definition: Operation.cc:480
Operation::addDag
virtual void addDag(const TCEString &code)
Definition: Operation.cc:113
OperationPimpl::simulateTrigger
bool simulateTrigger(SimValue **, OperationContext &context) const
Definition: OperationPimpl.cc:750
Operation.hh
OperationPimpl::affects
TCEString affects(unsigned int i) const
Definition: OperationPimpl.cc:364
OperationPimpl::setReadsMemory
void setReadsMemory(bool setting)
Definition: OperationPimpl.cc:869
NullOperation::deleteState
virtual void deleteState(OperationContext &context) const
Definition: Operation.cc:952
Operation::OPRN_WRITES_MEMORY
static const char * OPRN_WRITES_MEMORY
Object state name for writes memory.
Definition: Operation.hh:85
Operation::readsMemory
virtual bool readsMemory() const
Definition: Operation.cc:242
Operation::isBaseOffsetMemOperation
virtual bool isBaseOffsetMemOperation() const
Definition: Operation.cc:323
OperationPimpl::operand
Operand & operand(int id) const
Definition: OperationPimpl.cc:655
Operation::canTrap
virtual bool canTrap() const
Definition: Operation.cc:262
OperationPimpl.hh
Operation::saveState
virtual ObjectState * saveState() const
Definition: Operation.cc:490
Operation::OPRN_READS_MEMORY
static const char * OPRN_READS_MEMORY
Object state name for reads memory.
Definition: Operation.hh:83
NullOperation::output
virtual Operand & output(int id) const
Definition: Operation.cc:749
OperationPimpl::createState
void createState(OperationContext &context) const
Definition: OperationPimpl.cc:764
Operation::isVectorOperation
virtual bool isVectorOperation() const
Definition: Operation.cc:222
NullOperation::usesMemory
virtual bool usesMemory() const
Definition: Operation.cc:834
Operation::deleteState
virtual void deleteState(OperationContext &context) const
Definition: Operation.cc:601
OperationPimpl::behavior
OperationBehavior & behavior() const
Definition: OperationPimpl.cc:333
Operation
Definition: Operation.hh:59
Operation::OPRN_OUT
static const char * OPRN_OUT
Object state name for output operand.
Definition: Operation.hh:93
Operation::operandCount
virtual int operandCount() const
Definition: Operation.cc:212
Operation::OPRN_INPUTS
static const char * OPRN_INPUTS
Object state name for inputs.
Definition: Operation.hh:71
Operand.hh
NullOperationBehavior
Definition: OperationBehavior.hh:93
Operation::description
virtual TCEString description() const
Definition: Operation.cc:103
Operation::input
virtual Operand & input(int index) const
Definition: Operation.cc:503
Operation::OPRN_SIDE_EFFECTS
static const char * OPRN_SIDE_EFFECTS
Object state name for side effects.
Definition: Operation.hh:77
NullOperation::createState
virtual void createState(OperationContext &context) const
Definition: Operation.cc:944
Operation::usesMemory
virtual bool usesMemory() const
Definition: Operation.cc:232
Operation::operand
virtual Operand & operand(int id) const
Definition: Operation.cc:541
Operation::createState
virtual void createState(OperationContext &context) const
Definition: Operation.cc:590
Operation::dagCount
virtual int dagCount() const
Definition: Operation.cc:134
OperationBehavior.hh
OperationBehavior
Definition: OperationBehavior.hh:53
NullOperationBehavior::instance
static NullOperationBehavior & instance()
Definition: OperationBehavior.hh:95
Operation::InputOperandVector
OperationBehavior::InputOperandVector InputOperandVector
Definition: Operation.hh:62
NullOperation::isClocked
virtual bool isClocked() const
Definition: Operation.cc:889
Operation::addInput
virtual void addInput(Operand *operand)
Definition: Operation.cc:508
SimValue.hh
TCEString
Definition: TCEString.hh:53
NullOperation::writesMemory
virtual bool writesMemory() const
Definition: Operation.cc:856
Operation::setDagCode
virtual void setDagCode(int index, const TCEString &code)
Definition: Operation.cc:171
NullOperation::canTrap
virtual bool canTrap() const
Definition: Operation.cc:867
NullOperation::hasSideEffects
virtual bool hasSideEffects() const
Definition: Operation.cc:878
Operation::simulateTrigger
virtual bool simulateTrigger(SimValue **, OperationContext &context) const
Definition: Operation.cc:555
OperationPimpl::readsMemory
bool readsMemory() const
OperationPimpl::removeDag
void removeDag(int index)
Definition: OperationPimpl.cc:154
Operation::behavior
virtual OperationBehavior & behavior() const
Definition: Operation.cc:388
NullOperation::readsMemory
virtual bool readsMemory() const
Definition: Operation.cc:845
OperationPimpl::dependsOn
bool dependsOn(const Operation &op) const
Definition: OperationPimpl.cc:413
Operation::setWritesMemory
virtual void setWritesMemory(bool setting)
Definition: Operation.cc:639
OperationPimpl::dag
OperationDAG & dag(int index) const
Definition: OperationPimpl.cc:186
OperationPimpl::canSwap
bool canSwap(int id1, int id2) const
Definition: OperationPimpl.cc:435
OperationPimpl::affectedBy
TCEString affectedBy(unsigned int i) const
Definition: OperationPimpl.cc:389
Operation::isCall
virtual bool isCall() const
Definition: Operation.cc:318
NullOperation::~NullOperation
virtual ~NullOperation()
Definition: Operation.cc:659
OperationPimpl::affectsCount
int affectsCount() const
Definition: OperationPimpl.cc:343
NullOperation::isCall
virtual bool isCall() const
Definition: Operation.cc:910
OperationPimpl::canBeSimulated
bool canBeSimulated() const
Definition: OperationPimpl.cc:786
NullOperation::affectedByCount
virtual int affectedByCount() const
Definition: Operation.cc:690
OperationPimpl::isBranch
bool isBranch() const
Definition: OperationPimpl.cc:313
OperationPimpl::usesMemory
bool usesMemory() const
NullOperation::affectedBy
virtual TCEString affectedBy(unsigned int i) const
Definition: Operation.cc:715
NullOperation::isBranch
virtual bool isBranch() const
Definition: Operation.cc:920
OperationPimpl::addDag
void addDag(const TCEString &code)
Definition: OperationPimpl.cc:140
NullOperation::dependsOn
virtual bool dependsOn(const Operation &op) const
Definition: Operation.cc:668
OperationPimpl::input
Operand & input(int index) const
Operation::numberOfOutputs
virtual int numberOfOutputs() const
Definition: Operation.cc:202
Operation::OPRN_ISBRANCH
static const char * OPRN_ISBRANCH
Object state name for branch property.
Definition: Operation.hh:99
Operation::OPRN_OUTPUTS
static const char * OPRN_OUTPUTS
Object state name for outputs.
Definition: Operation.hh:73
Operation::affectsCount
virtual int affectsCount() const
Definition: Operation.cc:402
Operation::isBranch
virtual bool isBranch() const
Definition: Operation.cc:306
OperationContext.hh
Operation::setBranch
virtual void setBranch(bool setting)
Definition: Operation.cc:368
Operation::dag
virtual OperationDAG & dag(int index) const
Definition: Operation.cc:148
OperationPimpl::description
TCEString description() const
Definition: OperationPimpl.cc:131
NullOperation::numberOfOutputs
virtual int numberOfOutputs() const
Definition: Operation.cc:823
NullOperation::affects
virtual TCEString affects(unsigned int i) const
Definition: Operation.cc:702
NullOperation::simulateTrigger
virtual bool simulateTrigger(SimValue **, OperationContext &context) const
Definition: Operation.cc:932
OperationPimpl::setWritesMemory
void setWritesMemory(bool setting)
Definition: OperationPimpl.cc:877
OperationPimpl::deleteState
void deleteState(OperationContext &context) const
Definition: OperationPimpl.cc:775
Operation::isControlFlowOperation
virtual bool isControlFlowOperation() const
Definition: Operation.cc:294
OperationPimpl::setDagCode
void setDagCode(int index, const TCEString &code)
Definition: OperationPimpl.cc:232
OperationPimpl::numberOfInputs
int numberOfInputs() const