OpenASIP  2.0
NullMachine.cc
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 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 NullMachine.hh
26  *
27  * Implementation of NullMachine class.
28  *
29  * @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30  * @note rating: yellow
31  */
32 
33 #include "NullMachine.hh"
34 
35 namespace TTAMachine {
36 
37 NullMachine NullMachine::machine_;
38 
39 
40 /**
41  * The constructor.
42  */
44 }
45 
46 
47 /**
48  * The destructor.
49  */
51 }
52 
53 
54 /**
55  * Returns the only instance of NullMachine class.
56  *
57  * @return The only instance of NullMachine class.
58  */
61  return machine_;
62 }
63 
64 
65 /**
66  * Aborts the program with an error message.
67  *
68  * @exception ComponentAlreadyExists Never thrown.
69  */
70 void
72  abortWithError("NullMachine::addBus");
73 }
74 
75 /**
76  * Aborts the program with an error message.
77  *
78  * @exception ComponentAlreadyExists Never thrown.
79  */
80 void
82  abortWithError("NullMachine::addSocket");
83 }
84 
85 /**
86  * Aborts the program with an error message.
87  *
88  * @exception ComponentAlreadyExists Never thrown.
89  * @exception IllegalParameters Never thrown.
90  */
91 void
93  abortWithError("NullMachine::addUnit");
94 }
95 
96 /**
97  * Aborts the program with an error message.
98  *
99  * @exception ComponentAlreadyExists Never thrown.
100  * @exception IllegalParameters Never thrown.
101  */
102 void
104  abortWithError("NullMachine::addFunctionUnit");
105 }
106 
107 /**
108  * Aborts the program with an error message.
109  *
110  * @exception ComponentAlreadyExists Never thrown.
111  */
112 void
114  abortWithError("NullMachine::addImmediateUnit");
115 }
116 
117 /**
118  * Aborts the program with an error message.
119  *
120  * @exception ComponentAlreadyExists Never thrown.
121  */
122 void
124  abortWithError("NullMachine::addRegisterFile");
125 }
126 
127 /**
128  * Aborts the program with an error message.
129  *
130  * @exception ComponentAlreadyExists Never thrown.
131  */
132 void
134  abortWithError("NullMachine::addAddressSpace");
135 }
136 
137 /**
138  * Aborts the program with an error message.
139  *
140  * @exception ComponentAlreadyExists Never thrown.
141  */
142 void
144  abortWithError("NullMachine::addBridge");
145 }
146 
147 /**
148  * Aborts the program with an error message.
149  *
150  * @exception ComponentAlreadyExists Never thrown.
151  */
152 void
154  abortWithError("NullMachine::addInstructionTemplate");
155 }
156 
157 /**
158  * Aborts the program with an error message.
159  *
160  * @exception ComponentAlreadyExists Never thrown.
161  */
162 void
164  abortWithError("NullMachine::setGlobalControl");
165 }
166 
167 /**
168  * Aborts the program with an error message.
169  */
170 void
172  abortWithError("NullMachine::unsetGlobalControl");
173 }
174 
175 
176 /**
177  * Aborts the program with an error message.
178  *
179  * @return Never returns.
180  */
183  abortWithError("NullMachine::controlUnit");
184  return NULL;
185 }
186 
187 
188 /**
189  * Aborts the program with an error message.
190  *
191  * @exception InstanceNotFound Never thrown.
192  */
193 void
195  abortWithError("NullMachine::removeBus");
196 }
197 
198 /**
199  * Aborts the program with an error message.
200  *
201  * @exception InstanceNotFound Never thrown.
202  */
203 void
205  abortWithError("NullMachine::removeSocket");
206 }
207 
208 /**
209  * Aborts the program with an error message.
210  *
211  * @exception InstanceNotFound Never thrown.
212  * @exception IllegalParameters Never thrown.
213  */
214 void
216  abortWithError("NullMachine::removeUnit");
217 }
218 
219 /**
220  * Aborts the program with an error message.
221  *
222  * @exception InstanceNotFound Never thrown.
223  */
224 void
226  abortWithError("NullMachine::removeFunctionUnit");
227 }
228 
229 /**
230  * Aborts the program with an error message.
231  *
232  * @exception InstanceNotFound Never thrown.
233  */
234 void
236  abortWithError("NullMachine::removeImmediateUnit");
237 }
238 
239 /**
240  * Aborts the program with an error message.
241  *
242  * @exception InstanceNotFound Never thrown.
243  */
244 void
246  abortWithError("NullMachine::removeRegisterFile");
247 }
248 
249 /**
250  * Aborts the program with an error message.
251  *
252  * @exception InstanceNotFound Never thrown.
253  */
254 void
256  abortWithError("NullMachine::deleteBridge");
257 }
258 
259 /**
260  * Aborts the program with an error message.
261  *
262  * @exception InstanceNotFound Never thrown.
263  */
264 void
266  abortWithError("NullMachine::deleteInstructionTemplate");
267 }
268 
269 /**
270  * Aborts the program with an error message.
271  *
272  * @exception InstanceNotFound Never thrown.
273  */
274 void
276  abortWithError("NullMachine::deleteAddressSpace");
277 }
278 
279 /**
280  * Aborts the program with an error message.
281  *
282  * @return Never returns.
283  */
286  abortWithError("NullMachine::busNavigator");
287  return Machine::busNavigator();
288 }
289 
290 
291 /**
292  * Aborts the program with an error message.
293  *
294  * @return Never returns.
295  */
298  abortWithError("NullMachine::socketNavigator");
299  return Machine::socketNavigator();
300 }
301 
302 
303 /**
304  * Aborts the program with an error message.
305  *
306  * @return Never returns.
307  */
310  abortWithError("NullMachine::functionUnitNavigator");
312 }
313 
314 
315 /**
316  * Aborts the program with an error message.
317  *
318  * @return Never returns.
319  */
322  abortWithError("NullMachine::addressSpaceNavigator");
324 }
325 
326 
327 /**
328  * Aborts the program with an error message.
329  *
330  * @return Never returns.
331  */
334  abortWithError("NullMachine::bridgeNavigator");
335  return Machine::bridgeNavigator();
336 }
337 
338 
339 /**
340  * Aborts the program with an error message.
341  *
342  * @return Never returns.
343  */
346  abortWithError("NullMachine::immediateUnitNavigator");
348 }
349 
350 
351 /**
352  * Aborts the program with an error message.
353  *
354  * @return Never returns.
355  */
358  abortWithError("NullMachine::instructionTemplateNavigator");
360 }
361 
362 
363 /**
364  * Aborts the program with an error message.
365  *
366  * @return Never returns.
367  */
370  abortWithError("NullMachine::registerFileNavigator");
372 }
373 
374 
375 /**
376  * Aborts the program with an error message.
377  *
378  * @exception ObjectStateLoadingException Never thrown.
379  */
380 void
382  abortWithError("NullMachine::loadState");
383 }
384 
385 /**
386  * Aborts the program with an error message.
387  *
388  * @return Never returns.
389  */
392  abortWithError("NullMachine::saveState");
393  return NULL;
394 }
395 
396 }
TTAMachine::NullMachine::removeRegisterFile
virtual void removeRegisterFile(RegisterFile &unit)
Definition: NullMachine.cc:245
TTAMachine::NullMachine::addUnit
void addUnit(Unit &unit)
Definition: NullMachine.cc:92
TTAMachine::NullMachine::busNavigator
virtual BusNavigator busNavigator() const
Definition: NullMachine.cc:285
TTAMachine::NullMachine::registerFileNavigator
virtual RegisterFileNavigator registerFileNavigator() const
Definition: NullMachine.cc:369
TTAMachine::NullMachine::removeBus
virtual void removeBus(Bus &bus)
Definition: NullMachine.cc:194
TTAMachine::NullMachine::setGlobalControl
virtual void setGlobalControl(ControlUnit &unit)
Definition: NullMachine.cc:163
TTAMachine::NullMachine::removeUnit
virtual void removeUnit(Unit &unit)
Definition: NullMachine.cc:215
TTAMachine::NullMachine::removeFunctionUnit
virtual void removeFunctionUnit(FunctionUnit &unit)
Definition: NullMachine.cc:225
TTAMachine::AddressSpace
Definition: AddressSpace.hh:51
TTAMachine::Bridge
Definition: Bridge.hh:51
TTAMachine::Bus
Definition: Bus.hh:53
TTAMachine::NullMachine::addBus
virtual void addBus(Bus &bus)
Definition: NullMachine.cc:71
TTAMachine::NullMachine::deleteInstructionTemplate
virtual void deleteInstructionTemplate(InstructionTemplate &instrTempl)
Definition: NullMachine.cc:265
TTAMachine::NullMachine::addFunctionUnit
virtual void addFunctionUnit(FunctionUnit &unit)
Definition: NullMachine.cc:103
TTAMachine::NullMachine::bridgeNavigator
virtual BridgeNavigator bridgeNavigator() const
Definition: NullMachine.cc:333
ObjectState
Definition: ObjectState.hh:59
TTAMachine::NullMachine::instructionTemplateNavigator
virtual InstructionTemplateNavigator instructionTemplateNavigator() const
Definition: NullMachine.cc:357
TTAMachine::NullMachine::loadState
virtual void loadState(const ObjectState *state)
Definition: NullMachine.cc:381
TTAMachine::NullMachine::removeImmediateUnit
virtual void removeImmediateUnit(ImmediateUnit &unit)
Definition: NullMachine.cc:235
TTAMachine::InstructionTemplate
Definition: InstructionTemplate.hh:49
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
TTAMachine::NullMachine::machine_
static NullMachine machine_
The only instance of NullMachine.
Definition: NullMachine.hh:90
TTAMachine::NullMachine::unsetGlobalControl
virtual void unsetGlobalControl()
Definition: NullMachine.cc:171
NullMachine.hh
abortWithError
#define abortWithError(message)
Definition: Application.hh:72
TTAMachine::Unit
Definition: Unit.hh:51
TTAMachine::Machine::bridgeNavigator
virtual BridgeNavigator bridgeNavigator() const
Definition: Machine.cc:404
TTAMachine::Machine::immediateUnitNavigator
virtual ImmediateUnitNavigator immediateUnitNavigator() const
Definition: Machine.cc:416
TTAMachine::ControlUnit
Definition: ControlUnit.hh:50
TTAMachine::NullMachine
Definition: NullMachine.hh:43
TTAMachine::NullMachine::saveState
virtual ObjectState * saveState() const
Definition: NullMachine.cc:391
TTAMachine::NullMachine::addRegisterFile
virtual void addRegisterFile(RegisterFile &unit)
Definition: NullMachine.cc:123
TTAMachine::Machine::functionUnitNavigator
virtual FunctionUnitNavigator functionUnitNavigator() const
Definition: Machine.cc:380
TTAMachine::Socket
Definition: Socket.hh:53
TTAMachine::NullMachine::addInstructionTemplate
virtual void addInstructionTemplate(InstructionTemplate &instrTempl)
Definition: NullMachine.cc:153
TTAMachine::Machine::addressSpaceNavigator
virtual AddressSpaceNavigator addressSpaceNavigator() const
Definition: Machine.cc:392
TTAMachine::Machine::socketNavigator
virtual SocketNavigator socketNavigator() const
Definition: Machine.cc:368
TTAMachine::NullMachine::NullMachine
NullMachine()
Definition: NullMachine.cc:43
TTAMachine::NullMachine::immediateUnitNavigator
virtual ImmediateUnitNavigator immediateUnitNavigator() const
Definition: NullMachine.cc:345
TTAMachine::NullMachine::instance
static NullMachine & instance()
Definition: NullMachine.cc:60
TTAMachine::NullMachine::addBridge
virtual void addBridge(Bridge &bridge)
Definition: NullMachine.cc:143
TTAMachine::Machine::registerFileNavigator
virtual RegisterFileNavigator registerFileNavigator() const
Definition: Machine.cc:450
TTAMachine::NullMachine::addressSpaceNavigator
virtual AddressSpaceNavigator addressSpaceNavigator() const
Definition: NullMachine.cc:321
TTAMachine::Machine::busNavigator
virtual BusNavigator busNavigator() const
Definition: Machine.cc:356
TTAMachine::NullMachine::functionUnitNavigator
virtual FunctionUnitNavigator functionUnitNavigator() const
Definition: NullMachine.cc:309
TTAMachine::NullMachine::socketNavigator
virtual SocketNavigator socketNavigator() const
Definition: NullMachine.cc:297
TTAMachine::NullMachine::addSocket
virtual void addSocket(Socket &socket)
Definition: NullMachine.cc:81
TTAMachine::NullMachine::deleteAddressSpace
virtual void deleteAddressSpace(AddressSpace &as)
Definition: NullMachine.cc:275
TTAMachine::NullMachine::removeSocket
virtual void removeSocket(Socket &socket)
Definition: NullMachine.cc:204
TTAMachine::RegisterFile
Definition: RegisterFile.hh:47
TTAMachine
Definition: Assembler.hh:48
TTAMachine::NullMachine::controlUnit
virtual ControlUnit * controlUnit() const
Definition: NullMachine.cc:182
TTAMachine::Machine::instructionTemplateNavigator
virtual InstructionTemplateNavigator instructionTemplateNavigator() const
Definition: Machine.cc:428
TTAMachine::NullMachine::~NullMachine
virtual ~NullMachine()
Definition: NullMachine.cc:50
TTAMachine::NullMachine::deleteBridge
virtual void deleteBridge(Bridge &bridge)
Definition: NullMachine.cc:255
TTAMachine::NullMachine::addImmediateUnit
virtual void addImmediateUnit(ImmediateUnit &unit)
Definition: NullMachine.cc:113
TTAMachine::Machine::Navigator
Definition: Machine.hh:186
TTAMachine::Machine
Definition: Machine.hh:73
TTAMachine::ImmediateUnit
Definition: ImmediateUnit.hh:50
TTAMachine::NullMachine::addAddressSpace
virtual void addAddressSpace(AddressSpace &as)
Definition: NullMachine.cc:133