OpenASIP 2.2
Loading...
Searching...
No Matches
UniversalMachine.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2011 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 UniversalMachine.hh
26 *
27 * Declaration of UniversalMachine class.
28 *
29 * @author Lasse Laasonen 2004 (lasse.laasonen-no.spam-tut.fi)
30 * @author Pekka Jääskeläinen 2006,2011 (pekka.jaaskelainen-no.spam-tut.fi)
31 * @note rating: yellow
32 */
33
34#ifndef TTA_UNIVERSAL_MACHINE_HH
35#define TTA_UNIVERSAL_MACHINE_HH
36
37#include "Machine.hh"
38#include "OperationPool.hh"
39
42
43// the size of the data address space in bytes (MAUs) is 4GB.
44#define DATA_MEMORY_SIZE (static_cast<unsigned int>(4096)*1024*1024)
45
46/**
47 * UniversalMachine is used to mark unassigned/unscheduled resources.
48 *
49 * In the old versions of TCE, UniversalMachine represented a TTA processor
50 * which used to model an imaginary target for the old "sequential code",
51 * an intermediate format from the old gcc frontend. Previously, one UM
52 * instance per Program was created but from now one, the singleton object
53 * should be used everywhere because UM resources are just used to mark
54 * unscheduled parts of the program.
55 */
57public:
58 virtual ~UniversalMachine();
59
60 virtual bool isUniversalMachine() const;
69
70 virtual void addBus(TTAMachine::Bus& bus);
71 virtual void addSocket(TTAMachine::Socket& socket);
72 virtual void addFunctionUnit(TTAMachine::FunctionUnit& unit);
74 virtual void addRegisterFile(TTAMachine::RegisterFile& unit);
76 virtual void addBridge(TTAMachine::Bridge& bridge);
78 virtual void setGlobalControl(TTAMachine::ControlUnit& unit);
79
80 virtual void removeBus(TTAMachine::Bus& bus);
81 virtual void removeSocket(TTAMachine::Socket& socket);
85 virtual void unsetGlobalControl();
86
87 virtual void loadState(const ObjectState* state);
88
89 static UniversalMachine& instance();
90
91private:
93
94 void construct();
95
96 /// Indicates whether the UniversalMachine is built completely.
98 /// The operation pool instance to use for finding operations.
100 /// The singleton instance. Use this instance everywhere. Creating
101 /// multiple instances of UM is deprecated.
103};
104
105/// Machine component names reserved for the universal machine.
106#define UM_BUS_NAME "universal_bus"
107#define UM_SEGMENT_NAME "universal_segment"
108#define UM_INPUT_SOCKET_NAME "universal_input_socket"
109#define UM_OUTPUT_SOCKET_NAME "universal_output_socket"
110#define UM_BOOLEAN_RF_NAME "universal_boolean_rf"
111#define UM_BOOLEAN_RF_WRITE_PORT "universal_boolean_write_port"
112#define UM_BOOLEAN_RF_READ_PORT "universal_boolean_read_port"
113#define UM_INTEGER_URF_NAME "universal_integer_rf"
114#define UM_INTEGER_URF_WRITE_PORT "universal_rf_write_port"
115#define UM_INTEGER_URF_READ_PORT "universal_rf_read_port"
116#define UM_DOUBLE_URF_NAME "universal_double_rf"
117#define UM_DOUBLE_URF_WRITE_PORT "universal_drf_write"
118#define UM_DOUBLE_URF_READ_PORT "universal_drf_read"
119#define UM_SPECIAL_RF_NAME "universal_special_rf_return_value"
120#define UM_SPECIAL_RF_WRITE_PORT "universal_special_rf_write"
121#define UM_SPECIAL_RF_READ_PORT "universal_special_rf_read"
122#define UM_UNIVERSAL_FU_NAME "universal_fu"
123#define UM_IMEM_NAME "universal_instructions"
124#define UM_DMEM_NAME "universal_data"
125#define UM_GCU_NAME "universal_gcu"
126
127#endif
virtual void addSocket(TTAMachine::Socket &socket)
virtual void addRegisterFile(TTAMachine::RegisterFile &unit)
virtual void addBridge(TTAMachine::Bridge &bridge)
TTAMachine::AddressSpace & dataAddressSpace() const
virtual void removeSocket(TTAMachine::Socket &socket)
virtual void removeBus(TTAMachine::Bus &bus)
virtual void addAddressSpace(TTAMachine::AddressSpace &as)
virtual void unsetGlobalControl()
TTAMachine::AddressSpace & instructionAddressSpace() const
virtual void addBus(TTAMachine::Bus &bus)
TTAMachine::RegisterFile & booleanRegisterFile() const
OperationPool opPool
The operation pool instance to use for finding operations.
virtual void addFunctionUnit(TTAMachine::FunctionUnit &unit)
virtual void removeFunctionUnit(TTAMachine::FunctionUnit &unit)
virtual void addInstructionTemplate(TTAMachine::InstructionTemplate &iTemp)
static UniversalMachine & instance()
TTAMachine::RegisterFile & specialRegisterFile() const
UniversalFunctionUnit & universalFunctionUnit() const
virtual void removeRegisterFile(TTAMachine::RegisterFile &unit)
UnboundedRegisterFile & integerRegisterFile() const
TTAMachine::Bus & universalBus() const
bool isBuilt_
Indicates whether the UniversalMachine is built completely.
virtual void deleteAddressSpace(TTAMachine::AddressSpace &as)
virtual bool isUniversalMachine() const
static UniversalMachine * instance_
The singleton instance. Use this instance everywhere. Creating multiple instances of UM is deprecated...
virtual void setGlobalControl(TTAMachine::ControlUnit &unit)
virtual void addImmediateUnit(TTAMachine::ImmediateUnit &unit)
UnboundedRegisterFile & doubleRegisterFile() const
virtual void loadState(const ObjectState *state)