OpenASIP  2.0
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 
40 class SimulatorFrontend;
41 class OperationExecutor;
43 class MemorySystem;
44 class Listener;
45 namespace TTAMachine {
46  class Machine;
47  class AddressSpace;
48 }
49 
50 namespace 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  */
59 public:
60  SimpleSimulatorFrontend(TCEString machineFile, bool useCompiledSimulation=false);
62  TCEString machineFile, TCEString programFile,
63  bool useCompiledSimulation=false,
64  bool useDetailedSimulation=false);
68 
69  virtual ~SimpleSimulatorFrontend();
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 
98 private:
100 };
101 
102 #endif
TTAProgram
Definition: Estimator.hh:65
TTAProgram::Program
Definition: Program.hh:63
SimpleSimulatorFrontend::stop
void stop()
Definition: SimpleSimulatorFrontend.cc:122
SimpleSimulatorFrontend::frontend
SimulatorFrontend & frontend()
Definition: SimpleSimulatorFrontend.hh:93
TTAMachine::AddressSpace
Definition: AddressSpace.hh:51
SimpleSimulatorFrontend::isInitialized
bool isInitialized() const
Definition: SimpleSimulatorFrontend.cc:136
Listener
Definition: Listener.hh:40
SimpleSimulatorFrontend::run
void run()
Definition: SimpleSimulatorFrontend.cc:111
DetailedOperationSimulator
Definition: DetailedOperationSimulator.hh:49
SimpleSimulatorFrontend::memorySystem
MemorySystem & memorySystem()
Definition: SimpleSimulatorFrontend.cc:176
SimpleSimulatorFrontend::simFront_
SimulatorFrontend * simFront_
Definition: SimpleSimulatorFrontend.hh:99
TCEString.hh
SimpleSimulatorFrontend::machine
const TTAMachine::Machine & machine() const
Definition: SimpleSimulatorFrontend.cc:166
SimpleSimulatorFrontend::cycleCount
uint64_t cycleCount() const
Definition: SimpleSimulatorFrontend.cc:212
SimpleSimulatorFrontend
Definition: SimpleSimulatorFrontend.hh:58
SimpleSimulatorFrontend::isFinished
bool isFinished() const
Definition: SimpleSimulatorFrontend.cc:155
SimpleSimulatorFrontend::unregisterEventListener
virtual bool unregisterEventListener(int event, Listener *listener)
Definition: SimpleSimulatorFrontend.cc:206
MemorySystem
Definition: MemorySystem.hh:55
OperationExecutor
Definition: OperationExecutor.hh:49
SimpleSimulatorFrontend::registerEventListener
virtual bool registerEventListener(int event, Listener *listener)
Definition: SimpleSimulatorFrontend.cc:201
SimpleSimulatorFrontend::isStopped
bool isStopped() const
Definition: SimpleSimulatorFrontend.cc:145
SimpleSimulatorFrontend::isRunning
bool isRunning() const
Definition: SimpleSimulatorFrontend.cc:150
SimpleSimulatorFrontend::loadProgram
void loadProgram(const std::string &fileName)
Definition: SimpleSimulatorFrontend.cc:127
TCEString
Definition: TCEString.hh:53
SimpleSimulatorFrontend::hadRuntimeError
bool hadRuntimeError() const
Definition: SimpleSimulatorFrontend.cc:160
SimpleSimulatorFrontend::~SimpleSimulatorFrontend
virtual ~SimpleSimulatorFrontend()
Definition: SimpleSimulatorFrontend.cc:100
TTAMachine
Definition: Assembler.hh:48
SimulatorFrontend
Definition: SimulatorFrontend.hh:89
SimpleSimulatorFrontend::program
const TTAProgram::Program & program() const
Definition: SimpleSimulatorFrontend.cc:171
SimpleSimulatorFrontend::initializeDataMemories
void initializeDataMemories(const TTAMachine::AddressSpace *onlyOne=NULL)
Definition: SimpleSimulatorFrontend.cc:217
SimpleSimulatorFrontend::step
void step()
Definition: SimpleSimulatorFrontend.cc:105
SimpleSimulatorFrontend::SimpleSimulatorFrontend
SimpleSimulatorFrontend(TCEString machineFile, bool useCompiledSimulation=false)
Definition: SimpleSimulatorFrontend.cc:38
SimpleSimulatorFrontend::setOperationSimulator
virtual void setOperationSimulator(const TCEString &fuName, DetailedOperationSimulator &sim)
Definition: SimpleSimulatorFrontend.cc:185
TTAMachine::Machine
Definition: Machine.hh:73