OpenASIP  2.0
OperationPoolPimpl.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 OperationPoolPimpl.hh
26  *
27  * Declaration of OperationPoolPimpl (private implementation) class.
28  *
29  * @author Viljami Korhonen 2008 (viljami.korhonen-no.spam-tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef OPERATIONPOOL_PIMPL_HH
34 #define OPERATIONPOOL_PIMPL_HH
35 
36 #include <string>
37 #include <map>
38 #include "tce_config.h"
39 
40 class OperationPool;
43 class OperationIndex;
44 class Operation;
45 namespace llvm {
46  class MCInstrDesc;
47  class MCInstrInfo;
48 }
49 
50 /**
51  * A private implementation class for OperationPool
52  */
54 public:
55  friend class OperationPool;
57 
58  Operation& operation(const char* name);
60  bool sharesState(const Operation& op);
61 
62  static void cleanupCache();
63 
64  static void setLLVMTargetInstrInfo(const llvm::MCInstrInfo* tid) {
66  }
67 private:
69 
70  /// Container for operations indexed by their names.
71  typedef std::map<std::string, Operation*> OperationTable;
72 
73  /// Copying not allowed.
75  /// Assignment not allowed.
77  Operation* loadFromLLVM(const llvm::MCInstrDesc& tid);
78  /// Operation pool uses this to load behavior models of the operations.
80  /// Indexed table used to find out which operation module contains the
81  /// given operation.
83 
85 
86  /// Contains all operations that have been already requested by the client.
88  /// Contains all operation behavior proxies.
89  static std::vector<OperationBehaviorProxy*> proxies_;
90  /// If this is set, OSAL data is loaded from the TargetInstrInfo
91  /// instead of .opp XML files. Used when calling the TCE scheduler from
92  /// non-TTA LLVM targets.
93  static const llvm::MCInstrInfo* llvmTargetInstrInfo_;
94 };
95 
96 #endif
97 
OperationPoolPimpl::serializer_
OperationSerializer serializer_
Definition: OperationPoolPimpl.hh:84
llvm
Definition: InlineAsmParser.hh:49
OperationPoolPimpl::index
OperationIndex & index()
Definition: OperationPoolPimpl.cc:213
OperationPoolPimpl::OperationTable
std::map< std::string, Operation * > OperationTable
Container for operations indexed by their names.
Definition: OperationPoolPimpl.hh:71
OperationPoolPimpl::cleanupCache
static void cleanupCache()
Definition: OperationPoolPimpl.cc:100
OperationPoolPimpl::sharesState
bool sharesState(const Operation &op)
Definition: OperationPoolPimpl.cc:219
OperationPoolPimpl::operationCache_
static OperationTable operationCache_
Contains all operations that have been already requested by the client.
Definition: OperationPoolPimpl.hh:87
OperationPoolPimpl::OperationPoolPimpl
OperationPoolPimpl()
Definition: OperationPoolPimpl.cc:75
OperationBehaviorProxy
Definition: OperationBehaviorProxy.hh:58
OperationPoolPimpl::index_
static OperationIndex * index_
Indexed table used to find out which operation module contains the given operation.
Definition: OperationPoolPimpl.hh:82
OperationPoolPimpl::setLLVMTargetInstrInfo
static void setLLVMTargetInstrInfo(const llvm::MCInstrInfo *tid)
Definition: OperationPoolPimpl.hh:64
OperationPoolPimpl::proxies_
static std::vector< OperationBehaviorProxy * > proxies_
Contains all operation behavior proxies.
Definition: OperationPoolPimpl.hh:89
OperationSerializer
Definition: OperationSerializer.hh:49
OperationPoolPimpl
Definition: OperationPoolPimpl.hh:53
OperationPoolPimpl::loader_
static OperationBehaviorLoader * loader_
Operation pool uses this to load behavior models of the operations.
Definition: OperationPoolPimpl.hh:79
OperationBehaviorLoader
Definition: OperationBehaviorLoader.hh:54
Operation
Definition: Operation.hh:59
OperationPoolPimpl::llvmTargetInstrInfo_
static const llvm::MCInstrInfo * llvmTargetInstrInfo_
If this is set, OSAL data is loaded from the TargetInstrInfo instead of .opp XML files....
Definition: OperationPoolPimpl.hh:93
OperationPoolPimpl::loadFromLLVM
Operation * loadFromLLVM(const llvm::MCInstrDesc &tid)
Definition: OperationPoolPimpl.cc:164
OperationPoolPimpl::operation
Operation & operation(const char *name)
Definition: OperationPoolPimpl.cc:116
OperationIndex
Definition: OperationIndex.hh:58
OperationPool
Definition: OperationPool.hh:52
OperationPoolPimpl::~OperationPoolPimpl
~OperationPoolPimpl()
Definition: OperationPoolPimpl.cc:90
OperationPoolPimpl::operator=
OperationPoolPimpl & operator=(const OperationPoolPimpl &)
Assignment not allowed.