OpenASIP  2.0
CustomDBGController.cc
Go to the documentation of this file.
1 /*
2  This file is part of TTA-Based Codesign Environment (TCE).
3 
4  Permission is hereby granted, free of charge, to any person obtaining a
5  copy of this software and associated documentation files (the "Software"),
6  to deal in the Software without restriction, including without limitation
7  the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  and/or sell copies of the Software, and to permit persons to whom the
9  Software is furnished to do so, subject to the following conditions:
10 
11  The above copyright notice and this permission notice shall be included in
12  all copies or substantial portions of the Software.
13 
14  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20  DEALINGS IN THE SOFTWARE.
21 */
22 
23 /**
24  * @file CustomDBGController.cc
25  * @author Kalle Raiskila 2014
26  *
27  * Stub file for user's custom debugger control
28  */
29 
30 #include "CustomDBGController.hh"
31 #include "SimValue.hh"
32 #include "SimulatorFrontend.hh"
33 #include <cstdio>
34 
35 #define DEBUG_REMOTE_DEBUGGER_CONTROLLER
36 #ifdef DEBUG_REMOTE_DEBUGGER_CONTROLLER
37 #define DPRINT(...) printf(__VA_ARGS__)
38 #define _WHERE() printf("%s:%d - %s\n", __FILE__, __LINE__, __func__)
39 #else
40 #define _WHERE()
41 #define DPRINT()
42 #endif
43 
45 
47  SimulatorFrontend& frontend,
49  const TTAProgram::Program& program) :
50  RemoteController(frontend, machine, program) {
51  _WHERE();
52  // Write instructions to TTA memory. This is not done by TCE in the
53  // simulator modes. At some later point in time TCE fills the global
54  // data memory.
55 }
56 
57 void
59  Word /*address*/,
60  MAU /*data*/,
61  const AddressSpace& /*space*/) {
62  _WHERE();
63  abortWithError("Unimplemented.");
64 }
65 
66 MAU
68  Word /*address*/,
69  const AddressSpace& /*space*/) {
70  abortWithError("Unimplemented.");
71  return 0;
72 }
73 
74 void
76  const char* /*buff*/,
77  int /*size*/) {
78  _WHERE();
79  abortWithError("Unimplemented.");
80 }
81 
82 void
83 CustomDBGController::step(double /*count = 1*/) {
84  _WHERE();
85  abortWithError("Unimplemented.");
86 }
87 
88 void
89 CustomDBGController::next(int /*count = 1*/) {
90  _WHERE();
91  abortWithError("Unimplemented.");
92 }
93 
94 void
96  _WHERE();
97  abortWithError("Unimplemented.");
98 }
99 
100 void
102  _WHERE();
103  abortWithError("Unimplemented.");
104 }
105 
106 void
108  _WHERE();
109  abortWithError("Unimplemented.");
110 }
111 
112 std::string
114  const std::string& /*rfName*/,
115  int /*registerIndex*/ ) {
116  std::string rv="hello";
117  _WHERE();
118  abortWithError("Unimplemented.");
119  return rv;
120 }
121 
122 SimValue
124  const std::string& /*iuName*/,
125  int /*index*/) {
126  SimValue rv;
127  return rv;
128 }
129 
130 SimValue
132  const std::string& /*fuName*/,
133  const std::string& /*portName*/) {
134  SimValue rv;
135  return rv;
136 }
137 
140  _WHERE();
141  abortWithError("Unimplemented.");
142  return 0;
143 }
144 
145 /* vim: set ts=4 expandtab: */
CustomDBGController::writeIMem
virtual void writeIMem(const char *data, int size)
Definition: CustomDBGController.cc:75
UIntWord
Word UIntWord
Definition: BaseType.hh:144
TTAProgram::Program
Definition: Program.hh:63
CustomDBGController::MAU
MinimumAddressableUnit MAU
Definition: CustomDBGController.hh:37
InstructionAddress
UInt32 InstructionAddress
Definition: BaseType.hh:175
CustomDBGController::next
virtual void next(int count=1)
Definition: CustomDBGController.cc:89
CustomDBGController::step
virtual void step(double count=1)
Definition: CustomDBGController.cc:83
machine
TTAMachine::Machine * machine
the architecture definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:59
TTAMachine::AddressSpace
Definition: AddressSpace.hh:51
CustomDBGController::run
virtual void run()
Definition: CustomDBGController.cc:95
RemoteController
Definition: RemoteController.hh:48
CustomDBGController.hh
_WHERE
#define _WHERE()
Definition: CustomDBGController.cc:38
SimValue
Definition: SimValue.hh:96
CustomDBGController::reset
virtual void reset()
Definition: CustomDBGController.cc:107
CustomDBGController::writeMem
virtual void writeMem(Word address, MAU data, const AddressSpace &)
Definition: CustomDBGController.cc:58
CustomDBGController::immediateUnitRegisterValue
virtual SimValue immediateUnitRegisterValue(const std::string &iuName, int index=-1)
Definition: CustomDBGController.cc:123
abortWithError
#define abortWithError(message)
Definition: Application.hh:72
MinimumAddressableUnit
Word MinimumAddressableUnit
Type for storing a MAU (must be unsigned type!). This limits the maximum size of the simulated minimu...
Definition: BaseType.hh:184
CustomDBGController::FUPortValue
virtual SimValue FUPortValue(const std::string &fuName, const std::string &portName)
Definition: CustomDBGController.cc:131
CustomDBGController::runUntil
virtual void runUntil(UIntWord address)
Definition: CustomDBGController.cc:101
CustomDBGController::registerFileValue
virtual std::string registerFileValue(const std::string &rfName, int registerIndex=-1)
Definition: CustomDBGController.cc:113
MAU
MinimumAddressableUnit MAU
Definition: CustomDBGController.cc:44
SimulatorFrontend.hh
CustomDBGController::programCounter
virtual InstructionAddress programCounter() const
Definition: CustomDBGController.cc:139
SimValue.hh
CustomDBGController::readMem
virtual MAU readMem(Word address, const AddressSpace &)
Definition: CustomDBGController.cc:67
CustomDBGController::CustomDBGController
CustomDBGController(SimulatorFrontend &frontend, const TTAMachine::Machine &machine, const TTAProgram::Program &program)
Definition: CustomDBGController.cc:46
program
find Finds info of the inner loops in the program
Definition: InnerLoopFinder.cc:80
SimulatorFrontend
Definition: SimulatorFrontend.hh:89
TTAMachine::Machine
Definition: Machine.hh:73