OpenASIP  2.0
OperationContainer.hh
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 OperationContainer.hh
26  *
27  * Declaration of OperationContainer class.
28  *
29  * @author Jussi Nykänen 2004 (nykanen-no.spam-cs.tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_OPERATION_CONTAINER_HH
34 #define TTA_OPERATION_CONTAINER_HH
35 
36 #include <string>
37 
38 #include "PluginTools.hh"
39 #include "OperationContext.hh"
40 #include "BaseType.hh"
41 
42 class Operation;
43 class OperationIndex;
45 class OperationModule;
46 class OperationBehavior;
47 class IdealSRAM;
48 
49 /**
50  * Singleton class that holds necessary information for viewing operation
51  * properties, modifying operation behavior, and simulating operation
52  * behavior.
53  *
54  * Include also means to view and modify the contents of the memory.
55  */
57 public:
61  static Memory& memory();
62 
63  static void destroy();
64 
65  static OperationModule& module(
66  const std::string& path,
67  const std::string& mod);
68 
69  static Operation* operation(
70  const std::string& path,
71  const std::string& module,
72  const std::string& oper);
73 
74  static bool operationExists(const std::string& name);
75 
76  static bool isEffective(OperationModule& module, const std::string& name);
77 
78  static Word memoryStart();
79  static Word memoryEnd();
80 
81  virtual ~OperationContainer();
82 
83 private:
85  /// Copying not allowed.
87  /// Assignment not allowed.
89 
90  /// Creation function name for operation behavior.
91  static const std::string CREATE_FUNCTION;
92  /// Operation behavior deletion function name.
93  static const std::string DELETE_FUNCTION;
94 
95  /// Starting point of the memory.
96  static const Word MEMORY_START;
97  /// End point of the memory.
98  static const Word MEMORY_END;
99  /// MAU size of the memory.
100  static const Word MAUSIZE;
101 
102  /// Contains information of operations.
104  /// Static instance of operation serializer.
106  /// Operation context used through the execution of the program.
108  /// Program counter.
110  /// Return address.
112  /// Sys call handler.
114  /// Sys call number.
116  /// Memory used througout the execution of the program.
118  /// PluginTools used by OperationContainer;
120 };
121 
122 #endif
OperationContainer::memory_
static IdealSRAM * memory_
Memory used througout the execution of the program.
Definition: OperationContainer.hh:117
OperationContainer
Definition: OperationContainer.hh:56
OperationContainer::DELETE_FUNCTION
static const std::string DELETE_FUNCTION
Operation behavior deletion function name.
Definition: OperationContainer.hh:93
InstructionAddress
UInt32 InstructionAddress
Definition: BaseType.hh:175
BaseType.hh
OperationContainer::operationContext
static OperationContext & operationContext()
Definition: OperationContainer.cc:124
OperationContainer::MEMORY_END
static const Word MEMORY_END
End point of the memory.
Definition: OperationContainer.hh:98
PluginTools
Definition: PluginTools.hh:53
OperationContainer::operationSerializer
static OperationSerializer & operationSerializer()
Definition: OperationContainer.cc:111
OperationContainer::~OperationContainer
virtual ~OperationContainer()
Definition: OperationContainer.cc:85
OperationContext
Definition: OperationContext.hh:56
OperationContainer::module
static OperationModule & module(const std::string &path, const std::string &mod)
Definition: OperationContainer.cc:148
OperationContainer::CREATE_FUNCTION
static const std::string CREATE_FUNCTION
Creation function name for operation behavior.
Definition: OperationContainer.hh:91
OperationContainer::operationExists
static bool operationExists(const std::string &name)
Definition: OperationContainer.cc:219
SimValue
Definition: SimValue.hh:96
OperationContainer::index_
static OperationIndex * index_
Contains information of operations.
Definition: OperationContainer.hh:103
OperationContainer::context_
static OperationContext context_
Operation context used through the execution of the program.
Definition: OperationContainer.hh:107
OperationContainer::memoryEnd
static Word memoryEnd()
Definition: OperationContainer.cc:314
OperationContainer::tools_
static PluginTools tools_
PluginTools used by OperationContainer;.
Definition: OperationContainer.hh:119
OperationContainer::destroy
static void destroy()
Definition: OperationContainer.cc:280
OperationSerializer
Definition: OperationSerializer.hh:49
OperationContainer::programCounter_
static InstructionAddress programCounter_
Program counter.
Definition: OperationContainer.hh:109
PluginTools.hh
Operation
Definition: Operation.hh:59
OperationContainer::sysCallNumber_
static SimValue sysCallNumber_
Sys call number.
Definition: OperationContainer.hh:115
OperationContainer::serializer_
static OperationSerializer * serializer_
Static instance of operation serializer.
Definition: OperationContainer.hh:105
OperationBehavior
Definition: OperationBehavior.hh:53
OperationContainer::operator=
OperationContainer & operator=(const OperationContainer &)
Assignment not allowed.
OperationContainer::OperationContainer
OperationContainer()
Definition: OperationContainer.cc:79
OperationModule
Definition: OperationModule.hh:46
OperationContainer::MEMORY_START
static const Word MEMORY_START
Starting point of the memory.
Definition: OperationContainer.hh:96
OperationIndex
Definition: OperationIndex.hh:58
OperationContainer::memory
static Memory & memory()
Definition: OperationContainer.cc:134
OperationContainer::operation
static Operation * operation(const std::string &path, const std::string &module, const std::string &oper)
Definition: OperationContainer.cc:173
IdealSRAM
Definition: IdealSRAM.hh:55
OperationContainer::sysCallHandler_
static SimValue sysCallHandler_
Sys call handler.
Definition: OperationContainer.hh:113
OperationContainer::MAUSIZE
static const Word MAUSIZE
MAU size of the memory.
Definition: OperationContainer.hh:100
OperationContainer::operationIndex
static OperationIndex & operationIndex()
Definition: OperationContainer.cc:94
OperationContainer::isEffective
static bool isEffective(OperationModule &module, const std::string &name)
Definition: OperationContainer.cc:244
OperationContext.hh
OperationContainer::returnAddress_
static SimValue returnAddress_
Return address.
Definition: OperationContainer.hh:111
OperationContainer::memoryStart
static Word memoryStart()
Definition: OperationContainer.cc:304
Memory
Definition: Memory.hh:74