OpenASIP 2.2
Loading...
Searching...
No Matches
OperationDAGBehavior.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2020 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 OperationDAGBehavior.hh
26 *
27 * Declaration of OperationDAGBehavior class.
28 *
29 * @author Mikael Lepistö 2007 (mikael.lepisto-no.spam-tut.fi)
30 * @note rating: red
31 */
32
33
34#ifndef TTA_OPERATION_DAG_BEHAVIOR_HH
35#define TTA_OPERATION_DAG_BEHAVIOR_HH
36
37#include <vector>
38#include <string>
39#include <iostream>
40
41#include "Exception.hh"
42#include "OperationBehavior.hh"
43#include "OperationContext.hh"
44#include "Operation.hh"
45
46class SimValue;
48class OperationDAG;
49
50/**
51 * Implementation of OperationBehavior which uses OperationDAG for execution
52 * of operation.
53 */
55public:
57 OperationDAG& dag,
58 int operandCount,
59 const Operation& parent = NullOperation::instance());
60 virtual ~OperationDAGBehavior();
61
62 virtual bool simulateTrigger(
63 SimValue** io, OperationContext& context) const override;
64 virtual bool areValid(
65 const InputOperandVector& inputs,
66 const OperationContext& context) const override;
67
68 virtual bool lateResult(
69 SimValue** io, OperationContext& context) const;
70
71 virtual void createState(OperationContext& context) const override;
72 virtual void deleteState(OperationContext& context) const override;
73
74 virtual const char* stateName() const override;
75
76 virtual bool canBeSimulated() const override;
77
78private:
83
85
86 /// Number of operands of this operation.
88
89 /// Table of parameters for simulate trigger.
91
92 // Script for simulation
93 std::vector<SimulationStep> simulationSteps_;
94
95 /// Contain list of pointers to delete in destructor
96 std::vector<SimValue*> cleanUpTable_;
97
98 /// For checking if there is cyclic dependency in DAG.
99 mutable bool cycleFound_;
100};
101
102#endif
static NullOperation & instance()
std::vector< SimValue > InputOperandVector
Input operand type for areValid()
virtual void deleteState(OperationContext &context) const override
virtual bool lateResult(SimValue **io, OperationContext &context) const
virtual bool simulateTrigger(SimValue **io, OperationContext &context) const override
virtual bool canBeSimulated() const override
virtual void createState(OperationContext &context) const override
virtual bool areValid(const InputOperandVector &inputs, const OperationContext &context) const override
std::vector< SimulationStep > simulationSteps_
std::vector< SimValue * > cleanUpTable_
Contain list of pointers to delete in destructor.
SimValue * ios_
Table of parameters for simulate trigger.
int operandCount_
Number of operands of this operation.
bool cycleFound_
For checking if there is cyclic dependency in DAG.
virtual const char * stateName() const override