OpenASIP 2.2
Loading...
Searching...
No Matches
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
48const char* Operation::OPRN_OPERATION = "operation";
49const char* Operation::OPRN_NAME = "name";
50const char* Operation::OPRN_DESCRIPTION = "description";
51const char* Operation::OPRN_INPUTS = "inputs";
52const char* Operation::OPRN_OUTPUTS = "outputs";
53const char* Operation::OPRN_TRAP = "trap";
54const char* Operation::OPRN_SIDE_EFFECTS = "side-effects";
55const char* Operation::OPRN_CLOCKED = "clocked";
56const char* Operation::OPRN_CONTROL_FLOW = "control-flow";
57const char* Operation::OPRN_READS_MEMORY = "reads-memory";
58const char* Operation::OPRN_WRITES_MEMORY = "writes-memory";
59const char* Operation::OPRN_AFFECTS = "affects";
60const char* Operation::OPRN_AFFECTED_BY = "affected-by";
61const char* Operation::OPRN_IN = "in";
62const char* Operation::OPRN_OUT = "out";
63const char* Operation::OPRN_TRIGGER = "trigger-semantics";
64const char* Operation::OPRN_ISCALL = "is-call";
65const 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 */
94 return pimpl_->name();
95}
96
97/**
98 * Returns the description of the Operation.
99 *
100 * @return The description of the Operation.
101 */
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 */
112void
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 */
122void
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 */
133int
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 */
148Operation::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 */
159Operation::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 */
170void
171Operation::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 */
182Operation::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 */
191int
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 */
201int
205
206/**
207 * Returns the number of all operands of the Operation.
208 *
209 * @return The number of all operands of the Operation.
210 */
211int
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 */
221bool
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 */
231bool
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 */
241bool
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 */
251bool
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 */
261bool
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 */
271bool
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 */
281bool
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 */
293bool
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 */
305bool
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 */
317bool
319 return pimpl_->isCall();
320}
321
322bool
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 */
334void
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 */
345bool
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 */
358void
359Operation::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 */
367void
368Operation::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 */
377void
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 */
401int
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 */
415int
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 */
431Operation::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 */
447Operation::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 */
457bool
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 */
469bool
470Operation::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 */
479void
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 */
502Operand&
503Operation::input(int index) const {
504 return pimpl_->input(index);
505}
506
507void
511
512void
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 */
525Operand&
526Operation::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 */
540Operand&
541Operation::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 */
554bool
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 */
573bool
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 */
589void
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 */
600void
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 */
611bool
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 */
626
627/**
628 * Specifies if operation reads memory.
629 */
630void
632 pimpl_->setReadsMemory(setting);
633}
634
635/**
636 * Specifies if operation writes memory.
637 */
638void
640 pimpl_->setWritesMemory(setting);
641}
642
643//////////////////////////////////////////////////////////////////////////////
644// NullOperation
645//////////////////////////////////////////////////////////////////////////////
646
648
649/**
650 * Constructor.
651 */
655
656/**
657 * Destructor.
658 */
661
662/**
663 * Aborts program with error log message.
664 *
665 * @return False.
666 */
667bool
669 abortWithError("dependsOn()");
670 return false;
671}
672
673/**
674 * Aborts program with error log message.
675 *
676 * @return 0.
677 */
678int
680 abortWithError("affectsCount()");
681 return 0;
682}
683
684/**
685 * Aborts program with error log message.
686 *
687 * @return 0.
688 */
689int
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 */
702NullOperation::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 */
715NullOperation::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 */
726bool
727NullOperation::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 */
737Operand&
739 abortWithError("input()");
740 return NullOperand::instance();
741}
742
743/**
744 * Aborts program with error log message.
745 *
746 * @return NullOperand.
747 */
748Operand&
750 abortWithError("output()");
751 return NullOperand::instance();
752}
753
754/**
755 * Aborts program with error log message.
756 *
757 * @return NullOperand.
758 */
759Operand&
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 */
779void
783
784/**
785 * Aborts program with error log message.
786 *
787 * @return An empty string.
788 */
791 abortWithError("name()");
792 return "";
793}
794
795/**
796 * Aborts program with error log message.
797 *
798 * @return An empty string.
799 */
802 abortWithError("description()");
803 return "";
804}
805
806/**
807 * Aborts program with error log message.
808 *
809 * @return -1.
810 */
811int
813 abortWithError("numberOfInputs()");
814 return -1;
815}
816
817/**
818 * Aborts program with error log message.
819 *
820 * @return -1.
821 */
822int
824 abortWithError("numberOfOutputs()");
825 return -1;
826}
827
828/**
829 * Aborts program with error log message.
830 *
831 * @return False.
832 */
833bool
835 abortWithError("usesMemory()");
836 return false;
837}
838
839/**
840 * Aborts program with error log message.
841 *
842 * @return False.
843 */
844bool
846 abortWithError("readsMemory()");
847 return false;
848}
849
850/**
851 * Aborts program with error log message.
852 *
853 * @return False.
854 */
855bool
857 abortWithError("writesMemory()");
858 return false;
859}
860
861/**
862 * Aborts program with error log message.
863 *
864 * @return False.
865 */
866bool
868 abortWithError("canTrap()");
869 return false;
870}
871
872/**
873 * Aborts program with error log message.
874 *
875 * @return False.
876 */
877bool
879 abortWithError("hasSideEffects()");
880 return false;
881}
882
883/**
884 * Aborts program with error log message.
885 *
886 * @return False.
887 */
888bool
890 abortWithError("isClocked()");
891 return false;
892}
893
894/**
895 * Aborts program with error log message.
896 *
897 * @return False.
898 */
899bool
902 return false;
903}
904/**
905 * Aborts program with error log message.
906 *
907 * @return False.
908 */
909bool
912 return false;
913}
914/**
915 * Aborts program with error log message.
916 *
917 * @return False.
918 */
919bool
922 return false;
923}
924
925/**
926 * Aborts program with error log message.
927 *
928 * @return False.
929 * @exception Exception never.
930 */
931bool
933 SimValue**,
934 OperationContext&) const {
935
936 abortWithError("simulateTrigger()");
937 return false;
938}
939
940/**
941 * Aborts program with error log message.
942 */
943void
945 abortWithError("createState()");
946}
947
948/**
949 * Aborts program with error log message.
950 */
951void
953 abortWithError("deleteState()");
954}
#define __func__
#define abortWithError(message)
static NullOperand & instance()
static NullOperationBehavior & instance()
virtual ~NullOperation()
Definition Operation.cc:659
virtual bool canSwap(int id1, int id2) const
Definition Operation.cc:727
virtual TCEString description() const
Definition Operation.cc:801
virtual void createState(OperationContext &context) const
Definition Operation.cc:944
virtual bool isClocked() const
Definition Operation.cc:889
virtual Operand & input(int id) const
Definition Operation.cc:738
virtual int affectsCount() const
Definition Operation.cc:679
virtual bool canTrap() const
Definition Operation.cc:867
virtual int numberOfOutputs() const
Definition Operation.cc:823
virtual void setBehavior(OperationBehavior &behavior)
Definition Operation.cc:780
virtual Operand & output(int id) const
Definition Operation.cc:749
virtual bool isControlFlowOperation() const
Definition Operation.cc:900
virtual TCEString name() const
Definition Operation.cc:790
virtual TCEString affectedBy(unsigned int i) const
Definition Operation.cc:715
virtual int affectedByCount() const
Definition Operation.cc:690
virtual bool isCall() const
Definition Operation.cc:910
virtual bool hasSideEffects() const
Definition Operation.cc:878
virtual bool readsMemory() const
Definition Operation.cc:845
virtual bool simulateTrigger(SimValue **, OperationContext &context) const
Definition Operation.cc:932
virtual void deleteState(OperationContext &context) const
Definition Operation.cc:952
virtual bool usesMemory() const
Definition Operation.cc:834
NullOperation()
Some gcc versions warn about private constructors.
Definition Operation.cc:652
static NullOperation instance_
Unique instance of NullOperation.
Definition Operation.hh:237
virtual int numberOfInputs() const
Definition Operation.cc:812
virtual TCEString affects(unsigned int i) const
Definition Operation.cc:702
virtual Operand & operand(int id) const
Definition Operation.cc:760
virtual bool isBranch() const
Definition Operation.cc:920
virtual bool writesMemory() const
Definition Operation.cc:856
virtual OperationBehavior & behavior() const
Definition Operation.cc:771
virtual bool dependsOn(const Operation &op) const
Definition Operation.cc:668
virtual bool areValid(const InputOperandVector &inputs, const OperationContext &context) const
void loadState(const ObjectState *state)
bool isClocked() const
void createState(OperationContext &context) const
TCEString description() const
bool dependsOn(const Operation &op) const
void setDagCode(int index, const TCEString &code)
bool isCall() const
bool hasSideEffects() const
Operand & operand(int id) const
TCEString emulationFunctionName() const
bool canSwap(int id1, int id2) const
Operand & output(int index) const
bool writesMemory() const
bool isBranch() const
ObjectState * saveState() const
int dagCount() const
int affectedByCount() const
bool usesMemory() const
bool isControlFlowOperation() const
void setBranch(bool setting)
bool readsMemory() const
int numberOfOutputs() const
OperationDAG & dag(int index) const
TCEString name() const
void addInput(Operand *operand)
int numberOfInputs() const
void setReadsMemory(bool setting)
TCEString dagCode(int index) const
void removeDag(int index)
Operand & input(int index) const
TCEString affectedBy(unsigned int i) const
TCEString affects(unsigned int i) const
void setCall(bool setting)
bool canBeSimulated() const
bool canTrap() const
void addOutput(Operand *operand)
void setBehavior(OperationBehavior &behavior)
void addDag(const TCEString &code)
void deleteState(OperationContext &context) const
int affectsCount() const
TCEString dagError(int index) const
bool simulateTrigger(SimValue **, OperationContext &context) const
void setWritesMemory(bool setting)
OperationBehavior & behavior() const
void setControlFlowOperation(bool setting)
static const char * OPRN_CONTROL_FLOW
Object state name for control flow property.
Definition Operation.hh:81
virtual bool isVectorOperation() const
Definition Operation.cc:222
OperationPimpl * pimpl_
Private implementation in a separate source file.
Definition Operation.hh:173
virtual bool readsMemory() const
Definition Operation.cc:242
virtual void setBehavior(OperationBehavior &behavior)
Definition Operation.cc:378
virtual OperationDAG & dag(int index) const
Definition Operation.cc:148
static const char * OPRN_ISBRANCH
Object state name for branch property.
Definition Operation.hh:99
virtual void setWritesMemory(bool setting)
Definition Operation.cc:639
virtual TCEString name() const
Definition Operation.cc:93
virtual int affectedByCount() const
Definition Operation.cc:416
virtual ~Operation()
Definition Operation.cc:82
virtual TCEString dagError(int index) const
Definition Operation.cc:182
static const char * OPRN_DESCRIPTION
Object state name for description.
Definition Operation.hh:69
virtual bool dependsOn(const Operation &op) const
Definition Operation.cc:458
virtual bool usesMemory() const
Definition Operation.cc:232
virtual void setCall(bool setting)
Definition Operation.cc:359
virtual TCEString dagCode(int index) const
Definition Operation.cc:159
virtual TCEString description() const
Definition Operation.cc:103
virtual void addDag(const TCEString &code)
Definition Operation.cc:113
virtual void addOutput(Operand *operand)
Definition Operation.cc:513
virtual void setControlFlowOperation(bool setting)
Definition Operation.cc:335
virtual bool isCall() const
Definition Operation.cc:318
virtual ObjectState * saveState() const
Definition Operation.cc:490
virtual bool isBaseOffsetMemOperation() const
Definition Operation.cc:323
static const char * OPRN_IN
Object state name for input operand.
Definition Operation.hh:91
virtual void deleteState(OperationContext &context) const
Definition Operation.cc:601
virtual bool isControlFlowOperation() const
Definition Operation.cc:294
static const char * OPRN_CLOCKED
Object state name for clockedness.
Definition Operation.hh:79
virtual void addInput(Operand *operand)
Definition Operation.cc:508
virtual Operand & output(int index) const
Definition Operation.cc:526
virtual TCEString affectedBy(unsigned int i) const
Definition Operation.cc:447
Operation(const TCEString &name, OperationBehavior &behavior)
Definition Operation.cc:73
virtual OperationBehavior & behavior() const
Definition Operation.cc:388
virtual bool canTrap() const
Definition Operation.cc:262
virtual void createState(OperationContext &context) const
Definition Operation.cc:590
virtual Operand & input(int index) const
Definition Operation.cc:503
virtual int operandCount() const
Definition Operation.cc:212
static const char * OPRN_TRAP
Object state name for trap.
Definition Operation.hh:75
virtual bool hasSideEffects() const
Definition Operation.cc:272
virtual int affectsCount() const
Definition Operation.cc:402
virtual bool isBranch() const
Definition Operation.cc:306
static const char * OPRN_AFFECTED_BY
Object state name for affected by.
Definition Operation.hh:89
virtual bool simulateTrigger(SimValue **, OperationContext &context) const
Definition Operation.cc:555
virtual bool isClocked() const
Definition Operation.cc:282
virtual bool writesMemory() const
Definition Operation.cc:252
virtual int numberOfInputs() const
Definition Operation.cc:192
TCEString emulationFunctionName() const
Definition Operation.cc:623
virtual void setDagCode(int index, const TCEString &code)
Definition Operation.cc:171
static const char * OPRN_OPERATION
Object state name for operation.
Definition Operation.hh:65
virtual bool canBeSimulated() const
Definition Operation.cc:612
virtual void setBranch(bool setting)
Definition Operation.cc:368
virtual bool canSwap(int id1, int id2) const
Definition Operation.cc:470
virtual void removeDag(int index)
Definition Operation.cc:123
static const char * OPRN_TRIGGER
Object state name for trigger semantics.
Definition Operation.hh:95
virtual TCEString affects(unsigned int i) const
Definition Operation.cc:431
static const char * OPRN_ISCALL
Object state name for call property.
Definition Operation.hh:97
static const char * OPRN_SIDE_EFFECTS
Object state name for side effects.
Definition Operation.hh:77
virtual bool areValid(const InputOperandVector &inputs, const OperationContext &context) const
Definition Operation.cc:574
static const char * OPRN_READS_MEMORY
Object state name for reads memory.
Definition Operation.hh:83
static const char * OPRN_OUT
Object state name for output operand.
Definition Operation.hh:93
virtual int dagCount() const
Definition Operation.cc:134
static const char * OPRN_OUTPUTS
Object state name for outputs.
Definition Operation.hh:73
virtual int numberOfOutputs() const
Definition Operation.cc:202
static const char * OPRN_NAME
Object state name for name.
Definition Operation.hh:67
static const char * OPRN_INPUTS
Object state name for inputs.
Definition Operation.hh:71
static const char * OPRN_AFFECTS
Object state name for affects.
Definition Operation.hh:87
virtual Operand & operand(int id) const
Definition Operation.cc:541
virtual void setReadsMemory(bool setting)
Definition Operation.cc:631
virtual bool isPure() const
Definition Operation.cc:346
static const char * OPRN_WRITES_MEMORY
Object state name for writes memory.
Definition Operation.hh:85
virtual void loadState(const ObjectState *state)
Definition Operation.cc:480
OperationBehavior::InputOperandVector InputOperandVector
Definition Operation.hh:62
TCEString upper() const
Definition TCEString.cc:86