OpenASIP 2.2
Loading...
Searching...
No Matches
GCUState.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 GCUState.hh
26 *
27 * Declaration of GCUState class.
28 *
29 * @author Jussi Nykänen 2004 (nykanen-no.spam-cs.tut.fi)
30 * @author Pekka Jääskeläinen 2005 (pjaaskel-no.spam-cs.tut.fi)
31 * @note rating: red
32 */
33
34#ifndef TTA_GCU_STATE_HH
35#define TTA_GCU_STATE_HH
36
37#include <vector>
38
39#include "FUState.hh"
40#include "SimValue.hh"
41#include "SimulatorConstants.hh"
42
43/**
44 * Models the global control unit state.
45 */
46class GCUState : public FUState {
47public:
49 int latency,
50 int nww,
51 int cuDelaySlots,
52 int instructionAddressIncrement = 1);
53 virtual ~GCUState();
54
57
61
62 virtual void advanceClock();
63 virtual void reset();
64
65 virtual OperationContext& context();
66
67private:
68 /// Copying not allowed.
70 /// Assignment not allowed.
72 /// Natural word width as minimum addressable units.
74 /// The return address register.
76 /// Program counter.
78 /// In case an control flow operation is pending, this variable
79 /// contains the program counter value that should be updated
80 /// when the control stage counter goes down.
82 /// The delay of the control flow operations to take place.
84 /// The delay of branch operations in the pipeline, as opposed to this unit
86 /// If this this is true, there's a control flow operation pending.
88 /// This indicates how many cycles the operation has been pending,
89 /// when this reaches the latency, the PC is updated with the
90 /// new value.
92 /// The operation context for this FU.
94 /// The increment to instruction address to retrieve next instruction.
96};
97
98#include "GCUState.icc"
99
100#endif
UInt32 InstructionAddress
Definition BaseType.hh:175
GCUState(const GCUState &)
Copying not allowed.
virtual void advanceClock()
Definition GCUState.cc:98
void setReturnAddress(const InstructionAddress &value)
GCUState & operator=(const GCUState &)
Assignment not allowed.
int operationPendingTime_
This indicates how many cycles the operation has been pending, when this reaches the latency,...
Definition GCUState.hh:91
InstructionAddress newProgramCounter_
In case an control flow operation is pending, this variable contains the program counter value that s...
Definition GCUState.hh:81
virtual void reset()
this is called at (re)initialization of the simulation
Definition GCUState.cc:65
SimValue returnAddressRegister_
The return address register.
Definition GCUState.hh:75
virtual ~GCUState()
Definition GCUState.cc:76
OperationContext operationContext_
The operation context for this FU.
Definition GCUState.hh:93
int latency_
The delay of the control flow operations to take place.
Definition GCUState.hh:83
InstructionAddress programCounter_
Program counter.
Definition GCUState.hh:77
void setProgramCounter(const InstructionAddress &value)
InstructionAddress & programCounter()
int instructionAddressIncrement_
The increment to instruction address to retrieve next instruction.
Definition GCUState.hh:95
int naturalWordWidth_
Natural word width as minimum addressable units.
Definition GCUState.hh:73
void setReturnAddress()
bool operationPending_
If this this is true, there's a control flow operation pending.
Definition GCUState.hh:87
int branchDelayCycles_
The delay of branch operations in the pipeline, as opposed to this unit.
Definition GCUState.hh:85
SimValue & returnAddressRegister()
virtual OperationContext & context()
Definition GCUState.cc:88