OpenASIP 2.2
Loading...
Searching...
No Matches
CompiledSimController.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2010 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 CompiledSimController.hh
26 *
27 * Declaration of CompiledSimController class.
28 *
29 * @author Viljami Korhonen 2007 (viljami.korhonen-no.spam-tut.fi)
30 * @author Pekka Jääskeläinen 2010
31 * @note rating: red
32 */
33
34#ifndef COMPILED_SIM_CONTROLLER_HH
35#define COMPILED_SIM_CONTROLLER_HH
36
38#include "PluginTools.hh"
39#include <boost/shared_ptr.hpp>
41
44
45namespace TTAProgram {
46 class Program;
47}
48
49/**
50 * A Simulation controller that uses the compiled simulation techniques.
51 */
53public:
58 bool leaveDirty=false);
59
60 virtual ~CompiledSimController();
61
62 virtual void step(double count = 1);
63
64 virtual void next(int count = 1);
65
66 virtual void run();
67
68 virtual void runUntil(UIntWord address);
69
70 virtual void reset();
71
72 virtual InstructionAddress programCounter() const;
74 virtual ClockCycleCount clockCount() const;
75
76 virtual boost::shared_ptr<CompiledSimulation> compiledSimulation();
77
78 virtual void deleteGeneratedFiles();
79
80 /// Function type for the getSimulation() function
83 InstructionAddress entryAddress,
84 InstructionAddress lastInstruction,
86 CompiledSimController& controller,
88 bool dynamicCompilation,
89 ProcedureBBRelations& procedureBBRelations);
90
91 virtual std::string registerFileValue(
92 const std::string& rfName,
93 int registerIndex = -1);
94
96 const std::string& iuName, int index = -1);
97
98 virtual SimValue FUPortValue(
99 const std::string& fuName,
100 const std::string& portName);
101
102 virtual void prepareToStop(StopReason reason);
103
105 const TTAProgram::Program& program() const;
106
107private:
108 /// Copying not allowed.
110 /// Assignment not allowed.
112
113 /// Used for loading the compiled simulation plugin
115
116 /// Pointer to the loaded simulation
117 boost::shared_ptr<CompiledSimulation> simulation_;
118
119 /// Path to the generated simulation files
121
122 /// True, if the simulation should leave all the generated code files
124
125 /// A map containing the basic blocks' start..end pairs
127 /// A struct for tracking basic blocks and their relation to their procedures
129 /// The unique identifier for this simulation engine. Used for
130 /// enabling multiple compiled engines in the same process while
131 /// still having ccache hits (which would not happen when using
132 /// the object address as the id).
134};
135
136#endif
Word UIntWord
Definition BaseType.hh:144
UInt32 InstructionAddress
Definition BaseType.hh:175
TTAMachine::Machine * machine
the architecture definition of the estimated processor
CycleCount ClockCycleCount
Alias for ClockCycleCount.
StopReason
The reasons to stop simulation.
std::map< InstructionAddress, InstructionAddress > AddressMap
A type for storing address-to-address combinations.
virtual void next(int count=1)
int instanceId_
The unique identifier for this simulation engine. Used for enabling multiple compiled engines in the ...
CompiledSimController & operator=(const CompiledSimController &)
Assignment not allowed.
ProcedureBBRelations procedureBBRelations_
A struct for tracking basic blocks and their relation to their procedures.
boost::shared_ptr< CompiledSimulation > simulation_
Pointer to the loaded simulation.
virtual InstructionAddress lastExecutedInstruction() const
CompiledSimulation *() SimulationGetterFunction(const TTAMachine::Machine &machine, InstructionAddress entryAddress, InstructionAddress lastInstruction, SimulatorFrontend &frontend, CompiledSimController &controller, MemorySystem &memorySystem, bool dynamicCompilation, ProcedureBBRelations &procedureBBRelations)
Function type for the getSimulation() function.
virtual void step(double count=1)
virtual boost::shared_ptr< CompiledSimulation > compiledSimulation()
virtual SimValue FUPortValue(const std::string &fuName, const std::string &portName)
virtual void prepareToStop(StopReason reason)
CompiledSimController(const CompiledSimController &)
Copying not allowed.
bool leaveDirty_
True, if the simulation should leave all the generated code files.
virtual SimValue immediateUnitRegisterValue(const std::string &iuName, int index=-1)
const TTAProgram::Program & program() const
virtual ClockCycleCount clockCount() const
virtual std::string registerFileValue(const std::string &rfName, int registerIndex=-1)
virtual InstructionAddress programCounter() const
InstructionAddress basicBlockStart(InstructionAddress address) const
virtual void runUntil(UIntWord address)
std::string compiledSimulationPath_
Path to the generated simulation files.
PluginTools pluginTools_
Used for loading the compiled simulation plugin.
CompiledSimCodeGenerator::AddressMap basicBlocks_
A map containing the basic blocks' start..end pairs.
virtual SimulatorFrontend & frontend()
virtual MemorySystem & memorySystem(int coreId=-1)
A struct for tracking basic blocks and their relation to their procedures.