OpenASIP  2.0
NullMachine.hh
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  * Declaration of NullMachine class.
28  *
29  * @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30  * @note rating: yellow
31  */
32 
33 #ifndef TTA_NULL_MACHINE_HH
34 #define TTA_NULL_MACHINE_HH
35 
36 #include "Machine.hh"
37 
38 namespace TTAMachine {
39 
40 /**
41  * A singleton class which represents a null machine.
42  */
43 class NullMachine : public Machine {
44 public:
45  static NullMachine& instance();
46 
47  virtual void addBus(Bus& bus);
48  virtual void addSocket(Socket& socket);
49  void addUnit(Unit& unit);
50  virtual void addFunctionUnit(FunctionUnit& unit);
51  virtual void addImmediateUnit(ImmediateUnit& unit);
52  virtual void addRegisterFile(RegisterFile& unit);
53  virtual void addAddressSpace(AddressSpace& as);
54  virtual void addBridge(Bridge& bridge);
55  virtual void addInstructionTemplate(InstructionTemplate& instrTempl);
56  virtual void setGlobalControl(ControlUnit& unit);
57  virtual void unsetGlobalControl();
58 
59  virtual ControlUnit* controlUnit() const;
60 
61  virtual void removeBus(Bus& bus);
62  virtual void removeSocket(Socket& socket);
63  virtual void removeUnit(Unit& unit);
64  virtual void removeFunctionUnit(FunctionUnit& unit);
65  virtual void removeImmediateUnit(ImmediateUnit& unit);
66  virtual void removeRegisterFile(RegisterFile& unit);
67  virtual void deleteBridge(Bridge& bridge);
68  virtual void deleteInstructionTemplate(InstructionTemplate& instrTempl);
69  virtual void deleteAddressSpace(AddressSpace& as);
70 
71  virtual BusNavigator busNavigator() const;
72  virtual SocketNavigator socketNavigator() const;
75  virtual BridgeNavigator bridgeNavigator() const;
78  const;
80 
81  // functions inherited from Serializable interface
82  virtual void loadState(const ObjectState* state);
83  virtual ObjectState* saveState() const;
84 
85 private:
86  NullMachine();
87  virtual ~NullMachine();
88 
89  /// The only instance of NullMachine.
91 };
92 }
93 
94 #endif
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
TTAMachine::Unit
Definition: Unit.hh:51
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::Socket
Definition: Socket.hh:53
TTAMachine::NullMachine::addInstructionTemplate
virtual void addInstructionTemplate(InstructionTemplate &instrTempl)
Definition: NullMachine.cc:153
Machine.hh
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::NullMachine::addressSpaceNavigator
virtual AddressSpaceNavigator addressSpaceNavigator() const
Definition: NullMachine.cc:321
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::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