OpenASIP  2.0
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 
44 class MachineState;
45 class MemorySystem;
46 class StateLocator;
47 class FUState;
48 class GlobalLock;
49 class SimValue;
50 class OperationExecutor;
51 
52 namespace TTAMachine {
53  class Machine;
54  class BaseFUPort;
55  class FunctionUnit;
56  class HWOperation;
57 }
58 
59 /**
60  * Builds MachineState from Machine Object Model.
61  */
63 public:
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 
82 private:
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,
102  TTAMachine::BaseFUPort* port,
103  FUState* state,
105  StateLocator& locator,
106  SimValue& sharedRegister);
107 
108  void bindPortsToOperands(
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
MachineStateBuilder::~MachineStateBuilder
virtual ~MachineStateBuilder()
Definition: MachineStateBuilder.cc:92
machine
TTAMachine::Machine * machine
the architecture definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:59
TTAMachine::HWOperation
Definition: HWOperation.hh:52
Exception.hh
FUConflictDetectorIndex.hh
MachineStateBuilder::addVirtualOpcodeSettingPortsToFU
void addVirtualOpcodeSettingPortsToFU(MachineState &machineState, FUState &state, TTAMachine::FunctionUnit &unit)
Definition: MachineStateBuilder.cc:368
TTAMachine::BaseFUPort
Definition: BaseFUPort.hh:44
FUConflictDetectorIndex
std::map< std::string, FUResourceConflictDetector * > FUConflictDetectorIndex
Definition: FUConflictDetectorIndex.hh:45
MachineStateBuilder::bindPortsToOperands
void bindPortsToOperands(OperationExecutor &executor, TTAMachine::HWOperation &hwOperation, MachineState &machineState, FUState &state, TTAMachine::FunctionUnit &unit)
Definition: MachineStateBuilder.cc:667
MachineStateBuilder::MachineStateBuilder
MachineStateBuilder(bool detailedSimulationModel=false)
Definition: MachineStateBuilder.cc:84
SimValue
Definition: SimValue.hh:96
SimulatorConstants.hh
FUState
Definition: FUState.hh:58
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
MachineState
Definition: MachineState.hh:61
MachineStateBuilder::throwWhenConflict_
bool throwWhenConflict_
True in case the built model should throw an exception in case of a resource conflict.
Definition: MachineStateBuilder.hh:124
MachineStateBuilder::buildMachineState
MachineState * buildMachineState(const TTAMachine::Machine &machine, MemorySystem &memSys, StateLocator &locator)
Definition: MachineStateBuilder.cc:168
MachineStateBuilder::operator=
MachineStateBuilder & operator=(const MachineStateBuilder &)
Assignment not allowed.
MachineStateBuilder
Definition: MachineStateBuilder.hh:62
StateLocator
Definition: StateLocator.hh:51
MemorySystem
Definition: MemorySystem.hh:55
OperationExecutor
Definition: OperationExecutor.hh:49
MachineStateBuilder::detailedSimulationModel_
bool detailedSimulationModel_
Set to true in case should build a detailed model which simulates FU stages, possibly with an externa...
Definition: MachineStateBuilder.hh:128
MachineStateBuilder::build
MachineState * build(const TTAMachine::Machine &machine, MemorySystem &memSys)
Definition: MachineStateBuilder.cc:104
MachineStateBuilder::detectors_
FUConflictDetectorIndex * detectors_
The FU resource conflict detectors. They are needed while building the machine state model.
Definition: MachineStateBuilder.hh:120
TTAMachine
Definition: Assembler.hh:48
OperationPool.hh
MachineStateBuilder::addPortToFU
void addPortToFU(MachineState *machineState, TTAMachine::BaseFUPort *port, FUState *state, TTAMachine::FunctionUnit *fu, StateLocator &locator)
Definition: MachineStateBuilder.cc:644
TTAMachine::Machine
Definition: Machine.hh:73