OpenASIP 2.2
Loading...
Searching...
No Matches
CompiledSimSymbolGenerator.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 SymbolGenerator.hh
26 *
27 * Declaration of CompiledSimSymbolGenerator class.
28 *
29 * @author Viljami Korhonen 2008 (viljami.korhonen-no.spam-tut.fi)
30 * @note rating: red
31 */
32
33#ifndef COMPILED_SIM_SYMBOL_GENERATOR_HH
34#define COMPILED_SIM_SYMBOL_GENERATOR_HH
35
36#include "BaseType.hh"
37#include "TCEString.hh"
38
39namespace TTAMachine {
40 class Machine;
41 class FunctionUnit;
42 class FUPort;
43 class Port;
44 class Unit;
45 class HWOperation;
46 class Guard;
47 class RegisterFile;
48 class ImmediateUnit;
49 class ControlUnit;
50 class Bus;
51}
52
53namespace TTAProgram {
54 class Instruction;
55 class Terminal;
56 class Move;
57}
58
59
60/**
61 * A class that generates C/C++ symbol names for given objects in the simulation
62 *
63 * Used for the compiled simulation
64 *
65 */
67public:
68
69 CompiledSimSymbolGenerator(const TCEString& globalSymbolSuffix);
71
72 void enablePrefix(const std::string& prefix);
73 void disablePrefix();
74
75
76 std::string timeStamp() const;
77
78 std::string portSymbol(const TTAMachine::Port& port) const;
79
80 std::string registerSymbol(const TTAProgram::Terminal& terminal) const;
81 std::string registerSymbol(
82 const TTAMachine::RegisterFile& rf,
83 int index) const;
84
85 std::string immediateRegisterSymbol(
86 const TTAProgram::Terminal& terminal) const;
87 std::string immediateRegisterSymbol(
89 int index) const;
90
91 std::string busSymbol(const TTAMachine::Bus& bus) const;
92
93 std::string returnAddressSymbol(const TTAMachine::ControlUnit& gcu) const;
94
95 std::string moveOperandSymbol(
96 const TTAProgram::Terminal& terminal,
97 const TTAProgram::Move & move) const;
98
99 std::string operationContextSymbol(
100 const TTAMachine::FunctionUnit& fu) const;
101
102 std::string conflictDetectorSymbol(
103 const TTAMachine::FunctionUnit& fu) const;
104
105 std::string targetMemorySymbol(const TTAMachine::FunctionUnit& fu) const;
106
107 std::string DAMemorySymbol(const TTAMachine::FunctionUnit& fu) const;
108
109 std::string guardBoolSymbol() const;
110
111 std::string basicBlockSymbol(InstructionAddress startAddress) const;
112
113 std::string operationSymbol(
114 const std::string& operationName,
115 const TTAMachine::FunctionUnit& fu) const;
116
117 std::string FUResultSymbol(const TTAMachine::Port& port) const;
118
119 std::string generateTempVariable() const;
120
121 std::string jumpTargetSetterSymbol(InstructionAddress address) const;
122
123private:
124 /// Copying not allowed.
126 /// Assignment not allowed.
128
129 /// Prefix used for generated variable symbols
131
132 /// Suffix used for the generated global function symbols.
134};
135
136#endif
UInt32 InstructionAddress
Definition BaseType.hh:175
std::string basicBlockSymbol(InstructionAddress startAddress) const
std::string DAMemorySymbol(const TTAMachine::FunctionUnit &fu) const
std::string returnAddressSymbol(const TTAMachine::ControlUnit &gcu) const
CompiledSimSymbolGenerator(const CompiledSimSymbolGenerator &)
Copying not allowed.
std::string operationSymbol(const std::string &operationName, const TTAMachine::FunctionUnit &fu) const
std::string operationContextSymbol(const TTAMachine::FunctionUnit &fu) const
std::string busSymbol(const TTAMachine::Bus &bus) const
void enablePrefix(const std::string &prefix)
CompiledSimSymbolGenerator & operator=(const CompiledSimSymbolGenerator &)
Assignment not allowed.
TCEString globalSymbolSuffix_
Suffix used for the generated global function symbols.
std::string portSymbol(const TTAMachine::Port &port) const
TCEString prefix_
Prefix used for generated variable symbols.
std::string moveOperandSymbol(const TTAProgram::Terminal &terminal, const TTAProgram::Move &move) const
std::string targetMemorySymbol(const TTAMachine::FunctionUnit &fu) const
std::string conflictDetectorSymbol(const TTAMachine::FunctionUnit &fu) const
std::string registerSymbol(const TTAProgram::Terminal &terminal) const
std::string FUResultSymbol(const TTAMachine::Port &port) const
std::string immediateRegisterSymbol(const TTAProgram::Terminal &terminal) const
std::string jumpTargetSetterSymbol(InstructionAddress address) const