OpenASIP 2.2
Loading...
Searching...
No Matches
MachineStateBuilder.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2015 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 MachineStateBuilder.hh
26 *
27 * Declaration of MachineStateBuilder class.
28 *
29 * @author Jussi Nykänen 2004 (nykanen-no.spam-cs.tut.fi)
30 * @author Pekka Jääskeläinen 2005,2015 (pjaaskel-no.spam-cs.tut.fi)
31 * @note rating: red
32 */
33
34#ifndef TTA_MACHINE_STATE_BUILDER_HH
35#define TTA_MACHINE_STATE_BUILDER_HH
36
37#include <string>
38
39#include "Exception.hh"
40#include "OperationPool.hh"
42#include "SimulatorConstants.hh"
43
44class MachineState;
45class MemorySystem;
46class StateLocator;
47class FUState;
48class GlobalLock;
49class SimValue;
51
52namespace TTAMachine {
53 class Machine;
54 class BaseFUPort;
55 class FunctionUnit;
56 class HWOperation;
57}
58
59/**
60 * Builds MachineState from Machine Object Model.
61 */
63public:
64 MachineStateBuilder(bool detailedSimulationModel=false);
65 virtual ~MachineStateBuilder();
66
69 MemorySystem& memSys);
70
73 MemorySystem& memSys,
74 FUConflictDetectorIndex& detectors,
75 bool throwWhenConflict=true);
76
79 MemorySystem& memSys,
80 StateLocator& locator);
81
82private:
83 /// Copying not allowed.
85 /// Assignment not allowed.
87
90 MemorySystem& memSys,
91 StateLocator& locator);
92
93 void addPortToFU(
94 MachineState* machineState,
96 FUState* state,
98 StateLocator& locator);
99
100 void addPortToFU(
101 MachineState* machineState,
103 FUState* state,
105 StateLocator& locator,
106 SimValue& sharedRegister);
107
109 OperationExecutor& executor, TTAMachine::HWOperation& hwOperation,
110 MachineState& machineState, FUState& state,
112
114 MachineState& machineState,
115 FUState& state,
117
118 /// The FU resource conflict detectors. They are needed while building
119 /// the machine state model.
121
122 /// True in case the built model should throw an exception in case of
123 /// a resource conflict.
125
126 /// Set to true in case should build a detailed model which simulates
127 /// FU stages, possibly with an external system-level model.
129};
130
131#endif
TTAMachine::Machine * machine
the architecture definition of the estimated processor
std::map< std::string, FUResourceConflictDetector * > FUConflictDetectorIndex
MachineState * buildMachineState(const TTAMachine::Machine &machine, MemorySystem &memSys, StateLocator &locator)
MachineStateBuilder & operator=(const MachineStateBuilder &)
Assignment not allowed.
MachineState * build(const TTAMachine::Machine &machine, MemorySystem &memSys)
void addPortToFU(MachineState *machineState, TTAMachine::BaseFUPort *port, FUState *state, TTAMachine::FunctionUnit *fu, StateLocator &locator)
bool detailedSimulationModel_
Set to true in case should build a detailed model which simulates FU stages, possibly with an externa...
FUConflictDetectorIndex * detectors_
The FU resource conflict detectors. They are needed while building the machine state model.
void bindPortsToOperands(OperationExecutor &executor, TTAMachine::HWOperation &hwOperation, MachineState &machineState, FUState &state, TTAMachine::FunctionUnit &unit)
void addVirtualOpcodeSettingPortsToFU(MachineState &machineState, FUState &state, TTAMachine::FunctionUnit &unit)
bool throwWhenConflict_
True in case the built model should throw an exception in case of a resource conflict.
MachineStateBuilder(const MachineStateBuilder &)
Copying not allowed.