OpenASIP  2.0
SimulatorFrontend.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 SimulatorFrontend.hh
26  *
27  * Declaration of SimulatorFrontend class
28  *
29  * @author Pekka Jääskeläinen 2005-2010 (pjaaskel-no.spam-cs.tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_SIMULATOR_FRONTEND
34 #define TTA_SIMULATOR_FRONTEND
35 
36 #include <fstream>
37 #include <string>
38 #include <iostream>
39 #include <ostream>
40 #include <ctime>
41 
42 #include <boost/timer.hpp>
43 #include <set>
44 
45 #include "Exception.hh"
46 #include "SimulationController.hh"
47 #include "RemoteController.hh"
48 #include "SimulatorConstants.hh"
49 #include "BaseType.hh"
50 #include "CallPathTracker.hh"
51 
52 class SimValue;
53 class StateData;
54 class MachineState;
55 class POMDisassembler;
56 class ExecutionTracker;
57 class ExecutionTrace;
58 class StopPointManager;
59 class MemorySystem;
60 class UtilizationStats;
61 class RFAccessTracker;
62 class BusTracker;
66 namespace TPEF {
67  class Binary;
68 }
69 
70 namespace TTAProgram {
71  class Program;
72  class Procedure;
73 }
74 
75 namespace TTAMachine {
76  class AddressSpace;
77 }
78 
79 /**
80  * Frontend to simulator functionality.
81  *
82  * User interfaces use this class as the access point to simulation
83  * functionality. It acts as a "facade" hiding the complexity of simulator
84  * engine. Error messages of exceptions thrown by the methods of this
85  * class are generated using SimulatorTextGenerator, thus they can be used
86  * in user interfaces directly.
87  *
88  */
90 public:
91 
92  /// The severities of runtime errors.
93  typedef enum {
94  RES_MINOR, ///< Minor runtime error, no abort necessary.
95  RES_FATAL ///< Fatal runtime error, there is a serious error in the
96  /// simulated program, thus it makes no sense to go on
97  /// with the simulation.
99 
100  /// Which type of simulation this SimulatorFrontend controls or connects to.
101  typedef enum {
102  SIM_NORMAL, ///< Default, interpreted simulation (debugging engine).
103  SIM_COMPILED, ///< Compiled, faster simulation.
104  SIM_REMOTE, ///< Remote debugger, not a simulator at all
105  SIM_CUSTOM, ///< User-implemented remote HW debugger
106  SIM_OTA ///< Simulation with operation-triggered implicit data
107  /// transports.
108  } SimulationType;
109 
111  virtual ~SimulatorFrontend();
112 
113  virtual void loadProgram(const std::string& fileName);
114 
115  virtual void loadMachine(const std::string& fileName);
116 
118 
120 
121  void loadProcessorConfiguration(const std::string& fileName);
122 
123  const TTAMachine::Machine& machine() const;
124  const TTAProgram::Program& program() const;
125 
126  const SimValue& stateValue(std::string searchString);
127 
128  StateData& state(std::string searchString);
129 
130  MachineState& machineState(int core=-1);
131 
132  virtual void next(int count = 1);
133  virtual void step(double count = 1);
134  virtual void run();
135 
136  virtual void runUntil(UIntWord address);
137 
138  void prepareToStop(StopReason reason);
139  unsigned int stopReasonCount() const;
140  StopReason stopReason(unsigned int index) const;
141  bool stoppedByUser() const;
142  virtual void killSimulation();
143 
145  MemorySystem& memorySystem(int coreId=-1);
146 
147  bool isSimulationInitialized() const;
148  bool isSimulationRunning() const;
149  bool isSimulationStopped() const;
150  bool isProgramLoaded() const;
151  bool isMachineLoaded() const;
152  bool hasSimulationEnded() const;
153 
154  bool isCompiledSimulation() const;
155  bool isTCEDebugger() const;
156  bool isCustomDebugger() const;
158  leaveCompiledDirty_ = dirty;
159  }
160 
161  bool executionTracing() const;
162  bool busTracing() const;
163  bool rfAccessTracing() const;
164  bool procedureTransferTracing() const;
165  bool profileDataSaving() const;
166  bool utilizationDataSaving() const;
167  bool staticCompilation() const;
168 
169  const RFAccessTracker& rfAccessTracker() const;
170 
171  void setCompiledSimulation(bool value);
172  void setExecutionTracing(bool value);
173  void setBusTracing(bool value);
174  void setRFAccessTracing(bool value);
175  void setProcedureTransferTracing(bool value);
176  void setProfileDataSaving(bool value);
177  void setUtilizationDataSaving(bool value);
178  void forceTraceDBFileName(const std::string& fileName) {
179  forcedTraceDBFileName_ = fileName;
180  }
181  void setTimeout(unsigned int value);
182  void setStaticCompilation(bool value);
183 
184  std::ostream& outputStream();
185  void setOutputStream(std::ostream& stream);
186 
187  std::string disassembleInstruction(UIntWord instructionAddress) const;
188 
189  std::string programLocationDescription() const;
191  virtual InstructionAddress lastExecutedInstruction(int coreId=-1) const;
192  ClockCycleCount cycleCount() const;
194 
195  virtual std::string registerFileValue(
196  const std::string& rfName,
197  int registerIndex = -1);
198 
200  const std::string& iuName,
201  int index = -1);
202 
203  virtual SimValue FUPortValue(
204  const std::string& fuName,
205  const std::string& portName);
206 
207  StateData& findRegister(const std::string& rfName, int registerIndex);
208 
210 
211  StateData& findPort(const std::string& fuName, const std::string& portName);
212 
213  const UtilizationStats& utilizationStatistics(int core=-1);
216  InstructionAddress address) const;
217 
218  bool automaticFinishImpossible() const;
219 
220  void setFUResourceConflictDetection(bool value);
221  bool fuResourceConflictDetection() const;
222 
223  void setNextInstructionPrinting(bool value);
224  bool nextInstructionPrinting() const;
225 
226  void setSimulationTimeStatistics(bool value);
227  bool simulationTimeStatistics() const;
228 
229  ExecutionTrace* lastTraceDB(int core=-1);
230 
231  void setMemoryAccessTracking(bool value);
232  bool memoryAccessTracking() const;
233  void finishSimulation();
234 
236  { zeroFillMemoriesOnReset_ = val; }
237 
238  void setDetailedSimulation(bool val)
239  { detailedSimulation_ = val; }
240 
242 
244 
245  double lastRunTime() const;
246 
248  RuntimeErrorSeverity severity, const std::string& description);
249  std::string programErrorReport(
250  RuntimeErrorSeverity severity, std::size_t index);
251  std::size_t programErrorReportCount(
252  RuntimeErrorSeverity severity);
254 
255  friend void timeoutThread(unsigned int timeout, SimulatorFrontend* simFE);
256 
257  int selectedCore() const {
258  return 0;
259  }
260  void selectCore(int core) {
261  if (core != 0) {
262  abortWithError("WiP.");
263  }
264  }
265  bool compareState(SimulatorFrontend& other, std::ostream* differences=NULL);
266 
267  std::size_t callHistoryLength() const { return callHistoryLength_; }
268  void setCallHistoryLength(std::size_t length);
269  const CallPathTracker& callPathTracker(int core=-1) const;
270  void initializeDataMemories(const TTAMachine::AddressSpace* onlyOne=NULL);
271 
272 protected:
273  virtual void initializeSimulation();
274 
275  void initializeTracing();
276  void initializeDisassembler() const;
277  void initializeMemorySystem();
279  bool hasStopReason(StopReason reason) const;
280 
281  void startTimer();
282  void stopTimer();
283 
285 
286  /// A type for storing a program error description.
287  typedef std::pair<RuntimeErrorSeverity, std::string>
289  /// Container for simulated program error descriptions.
290  typedef std::vector<ProgramErrorDescription> ProgramErrorDescriptionList;
291 
292  /// Machine to run simulation with.
294  /// If simulation is initialized, this contains a pointer to the
295  /// simulation controller.
297  /// Is the machine owned by SimulatorFrontend or by the client?
299  /// Program to be simulated.
301  /// The source file of the program to be simulated. Used to generate
302  /// the file name of the trace data base.
303  std::string programFileName_;
304  /// Is the program owned by SimulatorFrontend or by the client?
306  /// Type of "backend" this Frontend has
308  /// The disassembler used to print out instructions. This is
309  /// initialized on demand.
311  /// Is execution tracing, i.e., storing the executed instruction
312  /// addresses to the trace database, enabled.
314  /// Is bus tracing, i.e., storing the values of buses in each
315  /// clock cycle enabled.
317  /// Is register file (concurrent) access tracking enabled.
319  /// Is procedure transfer access tracking enabled.
321  /// Is saving of profile data to TraceDB enabled.
323  /// Is saving of utilization data to TraceDB enabled.
325  /// The database to use for execution trace data.
326  std::vector<ExecutionTrace*> traceDBs_;
327  /// Whether traceDB at index is owned by simulator
328  /// (or taken away by client using lastTraceDB())
329  std::vector<bool> traceDBOwned_;
330 
331  /// The simple execution tracker for storing trace of executed
332  /// instructions.
333  std::vector<ExecutionTracker*> executionTrackers_;
334 
335  /// The tracker for saving bus trace.
336  std::vector<BusTracker*> busTrackers_;
337 
338  /// The register file access tracker.
339  std::vector<RFAccessTracker*> rfAccessTrackers_;
340 
341  /// The procedure transfer tracker.
342  std::vector<ProcedureTransferTracker*> procedureTransferTrackers_;
343 
344  /// The breakpoint manager to be used to bookkeep breakpoints.
346 
347  /// Processor utilization statistics.
348  std::vector<UtilizationStats*> utilizationStats_;
349 
350  /// The source TPEF file.
352  /// If this is enabled before initialization, FU resource conflicts are
353  /// detected (slows down simulation).
355  /// If true, the next simulated instructions is printed to stdout when
356  /// simulation stops.
358  /// True if the simulation time statistics should be printed out
360  /// True if the compiled simulation should use static compilation
362  /// Flag that indicates is the trace file name set by user.
364  /// Default output stream
365  std::ostream* outputStream_;
366 
367  /// If this is enabled before initialization, memory access tracking is
368  /// enabled. (slows down simulation)
370  /// Per simulation instance of SimulationEventHandler.
372  /// The cycle count of the last non-interrupted simulation phase.
374  /// The wall clock time of the last non-interrupted simulation phase in
375  /// seconds.
376  double lastRunTime_;
377  /// The time of the last simulation start. Used to compute simulation speed.
378  std::time_t startTime_;
379  /// The cycle count when the latest simulation was started. Used to
380  /// compute simulation speed.
382  /// Simulation timeout in seconds
383  unsigned int simulationTimeout_;
384  /// Runtime error reports.
386  /// True in case the compilation simulation should not cleanup at
387  /// destruction the engine source files.
389  /// The length of call history to store in memory for the commands that
390  /// need it.
391  std::size_t callHistoryLength_;
392  /// The call path trackers for each core, in case tracking is enabled.
393  std::vector<CallPathTracker*> callPathTrackers_;
394  /// If set, forces the SQLite filename of trace DB to this name.
396  /// The simulation models of the memories in the currently loaded machine
397  /// for each core.
398  std::vector<MemorySystem*> memorySystems_;
399  /// Set to true in case the memories should be set to zero at reset.
401  /// Set to true in case should build a detailed model which simulates
402  /// FU stages, possibly with an external system-level model.
404 };
405 #endif
SimulatorFrontend::callPathTracker
const CallPathTracker & callPathTracker(int core=-1) const
Definition: SimulatorFrontend.cc:2393
SimulatorFrontend::lastRunTime_
double lastRunTime_
The wall clock time of the last non-interrupted simulation phase in seconds.
Definition: SimulatorFrontend.hh:376
SimulatorFrontend::saveProfileData_
bool saveProfileData_
Is saving of profile data to TraceDB enabled.
Definition: SimulatorFrontend.hh:322
CallPathTracker.hh
SimulatorFrontend::simulationTimeStatistics
bool simulationTimeStatistics() const
Definition: SimulatorFrontend.cc:2097
SimulatorFrontend::printNextInstruction_
bool printNextInstruction_
If true, the next simulated instructions is printed to stdout when simulation stops.
Definition: SimulatorFrontend.hh:357
TTAProgram
Definition: Estimator.hh:65
UIntWord
Word UIntWord
Definition: BaseType.hh:144
SimulatorFrontend::traceDBOwned_
std::vector< bool > traceDBOwned_
Whether traceDB at index is owned by simulator (or taken away by client using lastTraceDB())
Definition: SimulatorFrontend.hh:329
SimulatorFrontend::setControllerForMemories
void setControllerForMemories(RemoteController *con)
Definition: SimulatorFrontend.cc:634
TTAProgram::Program
Definition: Program.hh:63
ProcedureTransferTracker
Definition: ProcedureTransferTracker.hh:51
ExecutableInstruction
Definition: ExecutableInstruction.hh:49
SimulatorFrontend::utilizationStats_
std::vector< UtilizationStats * > utilizationStats_
Processor utilization statistics.
Definition: SimulatorFrontend.hh:348
SimulatorFrontend::setProcedureTransferTracing
void setProcedureTransferTracing(bool value)
Definition: SimulatorFrontend.cc:1930
InstructionAddress
UInt32 InstructionAddress
Definition: BaseType.hh:175
SimulatorFrontend::setMemoryAccessTracking
void setMemoryAccessTracking(bool value)
Definition: SimulatorFrontend.cc:2047
SimulatorFrontend::SimulatorFrontend
SimulatorFrontend(SimulationType backend=SIM_NORMAL)
Definition: SimulatorFrontend.cc:120
SimulatorFrontend::memoryAccessTracking
bool memoryAccessTracking() const
Definition: SimulatorFrontend.cc:2057
SimulatorFrontend::SIM_REMOTE
@ SIM_REMOTE
Remote debugger, not a simulator at all.
Definition: SimulatorFrontend.hh:104
BaseType.hh
SimulatorFrontend::procedureTransferTracing_
bool procedureTransferTracing_
Is procedure transfer access tracking enabled.
Definition: SimulatorFrontend.hh:320
SimulatorFrontend::simCon_
TTASimulationController * simCon_
If simulation is initialized, this contains a pointer to the simulation controller.
Definition: SimulatorFrontend.hh:296
SimulatorFrontend::program
const TTAProgram::Program & program() const
Definition: SimulatorFrontend.cc:276
SimulatorFrontend::SIM_COMPILED
@ SIM_COMPILED
Compiled, faster simulation.
Definition: SimulatorFrontend.hh:103
SimulatorFrontend::initializeMemorySystem
void initializeMemorySystem()
Definition: SimulatorFrontend.cc:1699
SimulatorFrontend::rfAccessTracing
bool rfAccessTracing() const
Definition: SimulatorFrontend.cc:1818
SimulatorFrontend::procedureTransferTracing
bool procedureTransferTracing() const
Definition: SimulatorFrontend.cc:1827
TTAMachine::AddressSpace
Definition: AddressSpace.hh:51
Exception.hh
SimulatorFrontend::selectCore
void selectCore(int core)
Definition: SimulatorFrontend.hh:260
SimulatorFrontend::currentBackend_
SimulationType currentBackend_
Type of "backend" this Frontend has.
Definition: SimulatorFrontend.hh:307
SimulatorFrontend::busTracing_
bool busTracing_
Is bus tracing, i.e., storing the values of buses in each clock cycle enabled.
Definition: SimulatorFrontend.hh:316
SimulatorFrontend::forcedTraceDBFileName_
std::string forcedTraceDBFileName_
If set, forces the SQLite filename of trace DB to this name.
Definition: SimulatorFrontend.hh:395
SimulatorFrontend::profileDataSaving
bool profileDataSaving() const
Definition: SimulatorFrontend.cc:1837
SimulatorFrontend::timeoutThread
friend void timeoutThread(unsigned int timeout, SimulatorFrontend *simFE)
Definition: SimulatorFrontend.cc:951
SimulatorFrontend::machine
const TTAMachine::Machine & machine() const
Definition: SimulatorFrontend.cc:263
TPEF::Binary
Definition: Binary.hh:49
SimulatorFrontend::immediateUnitRegisterValue
virtual SimValue immediateUnitRegisterValue(const std::string &iuName, int index=-1)
Definition: SimulatorFrontend.cc:752
SimulatorFrontend::zeroFillMemoriesOnReset_
bool zeroFillMemoriesOnReset_
Set to true in case the memories should be set to zero at reset.
Definition: SimulatorFrontend.hh:400
SimulatorFrontend::stoppedByUser
bool stoppedByUser() const
Definition: SimulatorFrontend.cc:1394
SimulatorFrontend::callHistoryLength
std::size_t callHistoryLength() const
Definition: SimulatorFrontend.hh:267
SimulationEventHandler
Definition: SimulationEventHandler.hh:41
SimulatorFrontend::traceDBs_
std::vector< ExecutionTrace * > traceDBs_
The database to use for execution trace data.
Definition: SimulatorFrontend.hh:326
SimulatorFrontend::ProgramErrorDescriptionList
std::vector< ProgramErrorDescription > ProgramErrorDescriptionList
Container for simulated program error descriptions.
Definition: SimulatorFrontend.hh:290
SimulatorFrontend::outputStream
std::ostream & outputStream()
Definition: SimulatorFrontend.cc:1987
SimulatorFrontend::finishSimulation
void finishSimulation()
Definition: SimulatorFrontend.cc:1538
SimulatorFrontend::fuResourceConflictDetection
bool fuResourceConflictDetection() const
Definition: SimulatorFrontend.cc:2032
SimulatorFrontend::isSimulationStopped
bool isSimulationStopped() const
Definition: SimulatorFrontend.cc:1271
SimulatorFrontend::next
virtual void next(int count=1)
Definition: SimulatorFrontend.cc:1052
SimulatorFrontend::setStaticCompilation
void setStaticCompilation(bool value)
Definition: SimulatorFrontend.cc:1977
RemoteController
Definition: RemoteController.hh:48
SimulatorFrontend::procedureTransferTrackers_
std::vector< ProcedureTransferTracker * > procedureTransferTrackers_
The procedure transfer tracker.
Definition: SimulatorFrontend.hh:342
SimulatorFrontend::setOutputStream
void setOutputStream(std::ostream &stream)
Definition: SimulatorFrontend.cc:1998
SimulatorFrontend::initializeDataMemories
void initializeDataMemories(const TTAMachine::AddressSpace *onlyOne=NULL)
Definition: SimulatorFrontend.cc:440
SimulatorFrontend::run
virtual void run()
Definition: SimulatorFrontend.cc:997
SimulatorFrontend::printSimulationTimeStatistics_
bool printSimulationTimeStatistics_
True if the simulation time statistics should be printed out.
Definition: SimulatorFrontend.hh:359
SimulatorFrontend::isMachineLoaded
bool isMachineLoaded() const
Definition: SimulatorFrontend.cc:1250
SimulatorFrontend::startTimer
void startTimer()
Definition: SimulatorFrontend.cc:928
SimulatorFrontend::loadProcessorConfiguration
void loadProcessorConfiguration(const std::string &fileName)
Definition: SimulatorFrontend.cc:600
SimulatorFrontend::busTracing
bool busTracing() const
Definition: SimulatorFrontend.cc:1808
SimulatorFrontend::stopPointManager_
StopPointManager * stopPointManager_
The breakpoint manager to be used to bookkeep breakpoints.
Definition: SimulatorFrontend.hh:345
SimulatorFrontend::staticCompilation
bool staticCompilation() const
Definition: SimulatorFrontend.cc:1857
RFAccessTracker
Definition: RFAccessTracker.hh:52
SimulatorFrontend::stopReasonCount
unsigned int stopReasonCount() const
Definition: SimulatorFrontend.cc:1344
RemoteController.hh
SimulatorFrontend::findBooleanRegister
StateData & findBooleanRegister()
Definition: SimulatorFrontend.cc:709
SimulatorFrontend::ProgramErrorDescription
std::pair< RuntimeErrorSeverity, std::string > ProgramErrorDescription
A type for storing a program error description.
Definition: SimulatorFrontend.hh:288
SimulatorFrontend::setTimeout
void setTimeout(unsigned int value)
Definition: SimulatorFrontend.cc:1965
SimValue
Definition: SimValue.hh:96
SimulatorFrontend::selectedCore
int selectedCore() const
Definition: SimulatorFrontend.hh:257
SimulatorConstants.hh
SimulatorFrontend::currentProgram_
const TTAProgram::Program * currentProgram_
Program to be simulated.
Definition: SimulatorFrontend.hh:300
SimulatorFrontend::SimulationType
SimulationType
Which type of simulation this SimulatorFrontend controls or connects to.
Definition: SimulatorFrontend.hh:101
CallPathTracker
Definition: CallPathTracker.hh:51
SimulatorFrontend::initializeDisassembler
void initializeDisassembler() const
Definition: SimulatorFrontend.cc:1152
SimulatorFrontend::programCounter
InstructionAddress programCounter() const
Definition: SimulatorFrontend.cc:1169
SimulatorFrontend::loadMachine
virtual void loadMachine(const std::string &fileName)
Definition: SimulatorFrontend.cc:534
SimulatorFrontend::outputStream_
std::ostream * outputStream_
Default output stream.
Definition: SimulatorFrontend.hh:365
SimulatorFrontend::simulationTimeout_
unsigned int simulationTimeout_
Simulation timeout in seconds.
Definition: SimulatorFrontend.hh:383
SimulatorFrontend::findRegister
StateData & findRegister(const std::string &rfName, int registerIndex)
Definition: SimulatorFrontend.cc:785
SimulatorFrontend::setCallHistoryLength
void setCallHistoryLength(std::size_t length)
Definition: SimulatorFrontend.cc:2372
SimulatorFrontend::callHistoryLength_
std::size_t callHistoryLength_
The length of call history to store in memory for the commands that need it.
Definition: SimulatorFrontend.hh:391
TTASimulationController
Definition: TTASimulationController.hh:69
MachineState
Definition: MachineState.hh:61
SimulatorFrontend::fuResourceConflictDetection_
bool fuResourceConflictDetection_
If this is enabled before initialization, FU resource conflicts are detected (slows down simulation).
Definition: SimulatorFrontend.hh:354
abortWithError
#define abortWithError(message)
Definition: Application.hh:72
SimulatorFrontend::tpef_
TPEF::Binary * tpef_
The source TPEF file.
Definition: SimulatorFrontend.hh:351
SimulatorFrontend::programOwnedByFrontend_
bool programOwnedByFrontend_
Is the program owned by SimulatorFrontend or by the client?
Definition: SimulatorFrontend.hh:305
SimulatorFrontend::initializeTracing
void initializeTracing()
Definition: SimulatorFrontend.cc:1414
SimulatorFrontend::lastRunCycleCount_
ClockCycleCount lastRunCycleCount_
The cycle count of the last non-interrupted simulation phase.
Definition: SimulatorFrontend.hh:373
SimulatorFrontend::utilizationStatistics
const UtilizationStats & utilizationStatistics(int core=-1)
Definition: SimulatorFrontend.cc:2155
StopPointManager
Definition: StopPointManager.hh:50
ExecutionTrace
Definition: ExecutionTrace.hh:56
SimulatorFrontend::compareState
bool compareState(SimulatorFrontend &other, std::ostream *differences=NULL)
Definition: SimulatorFrontend.cc:2415
POMDisassembler
Definition: POMDisassembler.hh:70
SimulatorFrontend::executableInstructionAt
const ExecutableInstruction & executableInstructionAt(InstructionAddress address) const
Definition: SimulatorFrontend.cc:2208
SimulatorFrontend::stateValue
const SimValue & stateValue(std::string searchString)
Definition: SimulatorFrontend.cc:878
SimulatorFrontend::programErrorReport
std::string programErrorReport(RuntimeErrorSeverity severity, std::size_t index)
Definition: SimulatorFrontend.cc:2321
ExecutionTracker
Definition: ExecutionTracker.hh:46
SimulatorFrontend::busTrackers_
std::vector< BusTracker * > busTrackers_
The tracker for saving bus trace.
Definition: SimulatorFrontend.hh:336
SimulatorFrontend::loadProgram
virtual void loadProgram(const std::string &fileName)
Definition: SimulatorFrontend.cc:299
SimulatorFrontend::~SimulatorFrontend
virtual ~SimulatorFrontend()
Definition: SimulatorFrontend.cc:149
SimulatorFrontend::SIM_OTA
@ SIM_OTA
Simulation with operation-triggered implicit data transports.
Definition: SimulatorFrontend.hh:106
StopReason
StopReason
The reasons to stop simulation.
Definition: SimulatorConstants.hh:60
SimulatorFrontend::callPathTrackers_
std::vector< CallPathTracker * > callPathTrackers_
The call path trackers for each core, in case tracking is enabled.
Definition: SimulatorFrontend.hh:393
SimulatorFrontend::traceFileNameSetByUser_
bool traceFileNameSetByUser_
Flag that indicates is the trace file name set by user.
Definition: SimulatorFrontend.hh:363
SimulatorFrontend::setProfileDataSaving
void setProfileDataSaving(bool value)
Definition: SimulatorFrontend.cc:1940
SimulatorFrontend::RES_MINOR
@ RES_MINOR
Minor runtime error, no abort necessary.
Definition: SimulatorFrontend.hh:94
SimulatorFrontend::RES_FATAL
@ RES_FATAL
Fatal runtime error, there is a serious error in the simulated program, thus it makes no sense to go ...
Definition: SimulatorFrontend.hh:95
SimulatorFrontend::isCompiledSimulation
bool isCompiledSimulation() const
Definition: SimulatorFrontend.cc:1295
SimulatorFrontend::lastExecutedInstruction
virtual InstructionAddress lastExecutedInstruction(int coreId=-1) const
Definition: SimulatorFrontend.cc:1182
SimulatorFrontend::hasStopReason
bool hasStopReason(StopReason reason) const
Definition: SimulatorFrontend.cc:1369
MemorySystem
Definition: MemorySystem.hh:55
SimulatorFrontend::programErrorReportCount
std::size_t programErrorReportCount(RuntimeErrorSeverity severity)
Definition: SimulatorFrontend.cc:2344
SimulatorFrontend::FUPortValue
virtual SimValue FUPortValue(const std::string &fuName, const std::string &portName)
Definition: SimulatorFrontend.cc:767
SimulatorFrontend::leaveCompiledDirty_
bool leaveCompiledDirty_
True in case the compilation simulation should not cleanup at destruction the engine source files.
Definition: SimulatorFrontend.hh:388
SimulatorFrontend::findPort
StateData & findPort(const std::string &fuName, const std::string &portName)
Definition: SimulatorFrontend.cc:819
SimulatorFrontend::programErrorReports_
ProgramErrorDescriptionList programErrorReports_
Runtime error reports.
Definition: SimulatorFrontend.hh:385
SimulatorFrontend::startTime_
std::time_t startTime_
The time of the last simulation start. Used to compute simulation speed.
Definition: SimulatorFrontend.hh:378
SimulatorFrontend::setupCallHistoryTracking
void setupCallHistoryTracking()
Definition: SimulatorFrontend.cc:2378
SimulatorFrontend::SIM_CUSTOM
@ SIM_CUSTOM
User-implemented remote HW debugger.
Definition: SimulatorFrontend.hh:105
SimulatorFrontend::forceTraceDBFileName
void forceTraceDBFileName(const std::string &fileName)
Definition: SimulatorFrontend.hh:178
SimulatorFrontend::isSimulationRunning
bool isSimulationRunning() const
Definition: SimulatorFrontend.cc:1260
SimulatorFrontend::state
StateData & state(std::string searchString)
Definition: SimulatorFrontend.cc:894
SimulatorFrontend::killSimulation
virtual void killSimulation()
Definition: SimulatorFrontend.cc:1784
SimulatorFrontend::clearProgramErrorReports
void clearProgramErrorReports()
Definition: SimulatorFrontend.cc:2360
SimulatorFrontend::isCustomDebugger
bool isCustomDebugger() const
Definition: SimulatorFrontend.cc:1317
SimulatorFrontend::currentProcedure
const TTAProgram::Procedure & currentProcedure() const
Definition: SimulatorFrontend.cc:1210
SimulatorFrontend::setRFAccessTracing
void setRFAccessTracing(bool value)
Definition: SimulatorFrontend.cc:1920
SimulatorFrontend::stopTimer
void stopTimer()
Definition: SimulatorFrontend.cc:938
SimulatorFrontend::isProgramLoaded
bool isProgramLoaded() const
Definition: SimulatorFrontend.cc:1240
SimulatorFrontend::currentMachine_
const TTAMachine::Machine * currentMachine_
Machine to run simulation with.
Definition: SimulatorFrontend.hh:293
SimulatorFrontend::cycleCount
ClockCycleCount cycleCount() const
Definition: SimulatorFrontend.cc:1194
SimulatorFrontend::step
virtual void step(double count=1)
Definition: SimulatorFrontend.cc:1034
SimulatorFrontend::disassembler_
POMDisassembler * disassembler_
The disassembler used to print out instructions. This is initialized on demand.
Definition: SimulatorFrontend.hh:310
SimulatorFrontend::setUtilizationDataSaving
void setUtilizationDataSaving(bool value)
Definition: SimulatorFrontend.cc:2008
SimulatorFrontend::memorySystem
MemorySystem & memorySystem(int coreId=-1)
Definition: SimulatorFrontend.cc:2121
SimulatorFrontend::eventHandler
SimulationEventHandler & eventHandler()
Definition: SimulatorFrontend.cc:2260
SimulatorFrontend::executionTracing_
bool executionTracing_
Is execution tracing, i.e., storing the executed instruction addresses to the trace database,...
Definition: SimulatorFrontend.hh:313
SimulatorFrontend::rfAccessTrackers_
std::vector< RFAccessTracker * > rfAccessTrackers_
The register file access tracker.
Definition: SimulatorFrontend.hh:339
CycleCount
long long CycleCount
Type for storing simulation cycle counts.
Definition: BaseType.hh:187
SimulatorFrontend::machineState
MachineState & machineState(int core=-1)
Definition: SimulatorFrontend.cc:2138
SimulatorFrontend::setExecutionTracing
void setExecutionTracing(bool value)
Definition: SimulatorFrontend.cc:1900
SimulatorFrontend::utilizationDataSaving
bool utilizationDataSaving() const
Definition: SimulatorFrontend.cc:1847
SimulatorFrontend::rfAccessTracker
const RFAccessTracker & rfAccessTracker() const
Definition: SimulatorFrontend.cc:1869
SimulatorFrontend::memoryAccessTracking_
bool memoryAccessTracking_
If this is enabled before initialization, memory access tracking is enabled. (slows down simulation)
Definition: SimulatorFrontend.hh:369
SimulatorFrontend::setZeroFillMemoriesOnReset
void setZeroFillMemoriesOnReset(bool val)
Definition: SimulatorFrontend.hh:235
SimulatorFrontend::machineOwnedByFrontend_
bool machineOwnedByFrontend_
Is the machine owned by SimulatorFrontend or by the client?
Definition: SimulatorFrontend.hh:298
SimulatorFrontend::setSimulationTimeStatistics
void setSimulationTimeStatistics(bool value)
Definition: SimulatorFrontend.cc:2088
SimulatorFrontend::lastRunCycleCount
CycleCount lastRunCycleCount() const
Definition: SimulatorFrontend.cc:2276
SimulatorFrontend::initializeSimulation
virtual void initializeSimulation()
Definition: SimulatorFrontend.cc:657
SimulatorFrontend::setDetailedSimulation
void setDetailedSimulation(bool val)
Definition: SimulatorFrontend.hh:238
SimulatorFrontend::startCycleCount_
CycleCount startCycleCount_
The cycle count when the latest simulation was started. Used to compute simulation speed.
Definition: SimulatorFrontend.hh:381
SimulatorFrontend::detailedSimulation_
bool detailedSimulation_
Set to true in case should build a detailed model which simulates FU stages, possibly with an externa...
Definition: SimulatorFrontend.hh:403
SimulatorFrontend::runUntil
virtual void runUntil(UIntWord address)
Definition: SimulatorFrontend.cc:1014
SimulatorFrontend::setCompiledSimulationLeaveDirty
void setCompiledSimulationLeaveDirty(bool dirty)
Definition: SimulatorFrontend.hh:157
SimulatorFrontend::disassembleInstruction
std::string disassembleInstruction(UIntWord instructionAddress) const
Definition: SimulatorFrontend.cc:1073
SimulatorFrontend::stopReason
StopReason stopReason(unsigned int index) const
Definition: SimulatorFrontend.cc:1356
SimulatorFrontend::lastRunTime
double lastRunTime() const
Definition: SimulatorFrontend.cc:2289
SimulatorFrontend::staticCompilation_
bool staticCompilation_
True if the compiled simulation should use static compilation.
Definition: SimulatorFrontend.hh:361
BusTracker
Definition: BusTracker.hh:53
StateData
Definition: StateData.hh:44
ClockCycleCount
CycleCount ClockCycleCount
Alias for ClockCycleCount.
Definition: SimulatorConstants.hh:57
SimulatorFrontend::saveUtilizationData_
bool saveUtilizationData_
Is saving of utilization data to TraceDB enabled.
Definition: SimulatorFrontend.hh:324
SimulatorFrontend::executionTracing
bool executionTracing() const
Definition: SimulatorFrontend.cc:1798
SimulatorFrontend::programLocationDescription
std::string programLocationDescription() const
Definition: SimulatorFrontend.cc:1108
SimulatorFrontend::setNextInstructionPrinting
void setNextInstructionPrinting(bool value)
Definition: SimulatorFrontend.cc:2069
SimulationController.hh
SimulatorFrontend::executionTrackers_
std::vector< ExecutionTracker * > executionTrackers_
The simple execution tracker for storing trace of executed instructions.
Definition: SimulatorFrontend.hh:333
SimulatorFrontend::registerFileValue
virtual std::string registerFileValue(const std::string &rfName, int registerIndex=-1)
Definition: SimulatorFrontend.cc:738
SimulatorFrontend::hasSimulationEnded
bool hasSimulationEnded() const
Definition: SimulatorFrontend.cc:1283
SimulatorFrontend::nextInstructionPrinting
bool nextInstructionPrinting() const
Definition: SimulatorFrontend.cc:2080
SimulatorFrontend::setFUResourceConflictDetection
void setFUResourceConflictDetection(bool value)
Definition: SimulatorFrontend.cc:2022
SimulatorFrontend::eventHandler_
SimulationEventHandler * eventHandler_
Per simulation instance of SimulationEventHandler.
Definition: SimulatorFrontend.hh:371
SimulatorFrontend::memorySystems_
std::vector< MemorySystem * > memorySystems_
The simulation models of the memories in the currently loaded machine for each core.
Definition: SimulatorFrontend.hh:398
SimulatorFrontend::isTCEDebugger
bool isTCEDebugger() const
Definition: SimulatorFrontend.cc:1306
SimulatorFrontend::reportSimulatedProgramError
void reportSimulatedProgramError(RuntimeErrorSeverity severity, const std::string &description)
Definition: SimulatorFrontend.cc:2304
TTAMachine
Definition: Assembler.hh:48
SimulatorFrontend::lastExecInstruction
const ExecutableInstruction & lastExecInstruction() const
Definition: SimulatorFrontend.cc:2194
TTAProgram::Procedure
Definition: Procedure.hh:55
SimulatorFrontend
Definition: SimulatorFrontend.hh:89
SimulatorFrontend::isSimulationInitialized
bool isSimulationInitialized() const
Definition: SimulatorFrontend.cc:1228
SimulatorFrontend::programFileName_
std::string programFileName_
The source file of the program to be simulated. Used to generate the file name of the trace data base...
Definition: SimulatorFrontend.hh:303
SimulatorFrontend::stopPointManager
StopPointManager & stopPointManager()
Definition: SimulatorFrontend.cc:2108
UtilizationStats
Definition: UtilizationStats.hh:50
SimulatorFrontend::setBusTracing
void setBusTracing(bool value)
Definition: SimulatorFrontend.cc:1910
SimulatorFrontend::RuntimeErrorSeverity
RuntimeErrorSeverity
The severities of runtime errors.
Definition: SimulatorFrontend.hh:93
SimulatorFrontend::setCompiledSimulation
void setCompiledSimulation(bool value)
Definition: SimulatorFrontend.cc:1883
SimulatorFrontend::automaticFinishImpossible
bool automaticFinishImpossible() const
Definition: SimulatorFrontend.cc:2230
TPEF
Definition: Assembler.hh:43
TTAMachine::Machine
Definition: Machine.hh:73
SimulatorFrontend::lastTraceDB
ExecutionTrace * lastTraceDB(int core=-1)
Definition: SimulatorFrontend.cc:2243
SimulatorFrontend::rfAccessTracing_
bool rfAccessTracing_
Is register file (concurrent) access tracking enabled.
Definition: SimulatorFrontend.hh:318
SimulatorFrontend::prepareToStop
void prepareToStop(StopReason reason)
Definition: SimulatorFrontend.cc:1331
SimulatorFrontend::SIM_NORMAL
@ SIM_NORMAL
Default, interpreted simulation (debugging engine).
Definition: SimulatorFrontend.hh:102