OpenASIP 2.2
Loading...
Searching...
No Matches
SimpleSimulatorFrontend.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2013 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 SimpleSimulatorFrontend.hh
26 *
27 * Declaration of SimpleSimulatorFrontend class.
28 *
29 * @author Pekka Jääskeläinen 2010-2013 (pjaaskel-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_SIMPLE_SIMULATOR_FRONTEND
34#define TTA_SIMPLE_SIMULATOR_FRONTEND
35
36#include <stdint.h>
37
38#include "TCEString.hh"
39
43class MemorySystem;
44class Listener;
45namespace TTAMachine {
46 class Machine;
47 class AddressSpace;
48}
49
50namespace TTAProgram {
51 class Program;
52}
53/**
54 * Simplified simulator frontend e.g. for calling from system level simulators
55 * without needing to include the huge SimulatorFrontend.hh with lots of
56 * include deps.
57 */
59public:
60 SimpleSimulatorFrontend(TCEString machineFile, bool useCompiledSimulation=false);
62 TCEString machineFile, TCEString programFile,
63 bool useCompiledSimulation=false,
64 bool useDetailedSimulation=false);
68
70
71 void step();
72 void run();
73 void stop();
74
75 uint64_t cycleCount() const;
76
77 bool isInitialized() const;
78 bool isStopped() const;
79 bool isRunning() const;
80 bool isFinished() const;
81 bool hadRuntimeError() const;
82
83 virtual void setOperationSimulator(
84 const TCEString& fuName, DetailedOperationSimulator& sim);
85
87 void initializeDataMemories(const TTAMachine::AddressSpace* onlyOne=NULL);
88
89 void loadProgram(const std::string& fileName);
90 const TTAMachine::Machine& machine() const;
91 const TTAProgram::Program& program() const;
92
94
95 virtual bool registerEventListener(int event, Listener* listener);
96 virtual bool unregisterEventListener(int event, Listener* listener);
97
98private:
100};
101
102#endif
const TTAMachine::Machine & machine() const
virtual bool registerEventListener(int event, Listener *listener)
void loadProgram(const std::string &fileName)
const TTAProgram::Program & program() const
virtual void setOperationSimulator(const TCEString &fuName, DetailedOperationSimulator &sim)
virtual bool unregisterEventListener(int event, Listener *listener)
void initializeDataMemories(const TTAMachine::AddressSpace *onlyOne=NULL)