Go to the documentation of this file.
60 std::vector<std::set<OperationDAGNode*, OperationDAGNode::Comparator> >
62 std::set<OperationDAGNode*, OperationDAGNode::Comparator> addedNodes;
68 while (
static_cast<int>(addedNodes.size()) <
dag_.
nodeCount()) {
69 std::set<OperationDAGNode*, OperationDAGNode::Comparator> currSet;
75 if (addedNodes.find(&currNode) != addedNodes.end()) {
80 bool canBeAddedToCurrentLevel =
true;
87 bool wasFound =
false;
88 for (
unsigned int k = 0; k < nodeLevels.size(); k++) {
89 if (nodeLevels[k].find(&parentNode) !=
90 nodeLevels[k].end()) {
98 canBeAddedToCurrentLevel =
false;
103 if (canBeAddedToCurrentLevel) {
104 currSet.insert(&currNode);
105 addedNodes.insert(&currNode);
109 nodeLevels.push_back(currSet);
115 std::map<OperationNode*, int> stepOfNode;
117 for (
unsigned int i = 0; i < nodeLevels.size(); i++) {
118 for (std::set<OperationDAGNode*,OperationDAGNode::Comparator>::
120 nodeLevels[i].begin(); nodeIter != nodeLevels[i].end();
125 if (opNode != NULL) {
147 if (termNode != NULL) {
152 }
else if (constNode != NULL) {
156 *newVal = constNode->
value();
160 }
else if (operNode != NULL) {
168 assert(
false &&
"Invalid node type");
183 if (termNode != NULL) {
188 }
else if (operNode != NULL) {
195 assert(
false &&
"Invalid node type");
267 sandboxedProgramCounter,
268 sandboxedReturnAddress,
271 for (
size_t i = 0; i < inputs.size(); i++) {
virtual Edge & outEdge(const Node &node, const int index) const
UInt32 InstructionAddress
virtual Node & tailNode(const Edge &edge) const
virtual bool areValid(const InputOperandVector &inputs, const OperationContext &context) const override
virtual Node & headNode(const Edge &edge) const
Node & node(const int index) const
virtual int numberOfInputs() const
virtual bool canBeSimulated() const override
virtual const char * stateName() const override
virtual bool canBeSimulated() const
Operation & referencedOperation() const
virtual int outDegree(const Node &node) const
#define assert(condition)
SimValue * ios_
Table of parameters for simulate trigger.
int branchDelayCycles() const
virtual Edge & inEdge(const Node &node, const int index) const
bool cycleFound_
For checking if there is cyclic dependency in DAG.
std::vector< SimulationStep > simulationSteps_
std::vector< SimValue * > cleanUpTable_
Contain list of pointers to delete in destructor.
virtual int inDegree(const Node &node) const
virtual bool lateResult(SimValue **io, OperationContext &context) const
virtual void createState(OperationContext &context) const override
virtual ~OperationDAGBehavior()
std::vector< SimValue > InputOperandVector
Input operand type for areValid()
virtual bool simulateTrigger(SimValue **io, OperationContext &context) const override
InstructionAddress & programCounter()
virtual long value() const
find Finds info of the inner loops in the false
OperationDAG & dag(int index) const
virtual void deleteState(OperationContext &context) const override
virtual int numberOfOutputs() const
SimValue & returnAddress()
OperationDAGBehavior(OperationDAG &dag, int operandCount, const Operation &parent=NullOperation::instance())
virtual int operandIndex() const
int operandCount_
Number of operands of this operation.
void deepCopy(const SimValue &source)