gem5  v20.1.0.0
comm.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011, 2016-2017 ARM Limited
3  * Copyright (c) 2013 Advanced Micro Devices, Inc.
4  * All rights reserved
5  *
6  * The license below extends only to copyright in the software and shall
7  * not be construed as granting a license to any other intellectual
8  * property including but not limited to intellectual property relating
9  * to a hardware implementation of the functionality of the software
10  * licensed hereunder. You may use the software subject to the license
11  * terms below provided that you ensure that this notice is replicated
12  * unmodified and in its entirety in all distributions of the software,
13  * modified or unmodified, in source code or in binary form.
14  *
15  * Copyright (c) 2004-2006 The Regents of The University of Michigan
16  * All rights reserved.
17  *
18  * Redistribution and use in source and binary forms, with or without
19  * modification, are permitted provided that the following conditions are
20  * met: redistributions of source code must retain the above copyright
21  * notice, this list of conditions and the following disclaimer;
22  * redistributions in binary form must reproduce the above copyright
23  * notice, this list of conditions and the following disclaimer in the
24  * documentation and/or other materials provided with the distribution;
25  * neither the name of the copyright holders nor the names of its
26  * contributors may be used to endorse or promote products derived from
27  * this software without specific prior written permission.
28  *
29  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  */
41 
42 #ifndef __CPU_O3_COMM_HH__
43 #define __CPU_O3_COMM_HH__
44 
45 #include <vector>
46 
47 #include "arch/types.hh"
48 #include "base/types.hh"
49 #include "cpu/inst_seq.hh"
50 #include "sim/faults.hh"
51 
53 template<class Impl>
55  typedef typename Impl::DynInstPtr DynInstPtr;
56 
57  int size;
58 
59  DynInstPtr insts[Impl::MaxWidth];
63 };
64 
66 template<class Impl>
68  typedef typename Impl::DynInstPtr DynInstPtr;
69 
70  int size;
71 
72  DynInstPtr insts[Impl::MaxWidth];
73 };
74 
76 template<class Impl>
78  typedef typename Impl::DynInstPtr DynInstPtr;
79 
80  int size;
81 
82  DynInstPtr insts[Impl::MaxWidth];
83 };
84 
86 template<class Impl>
88  typedef typename Impl::DynInstPtr DynInstPtr;
89 
90  int size;
91 
92  DynInstPtr insts[Impl::MaxWidth];
93  DynInstPtr mispredictInst[Impl::MaxThreads];
94  Addr mispredPC[Impl::MaxThreads];
95  InstSeqNum squashedSeqNum[Impl::MaxThreads];
96  TheISA::PCState pc[Impl::MaxThreads];
97 
98  bool squash[Impl::MaxThreads];
99  bool branchMispredict[Impl::MaxThreads];
100  bool branchTaken[Impl::MaxThreads];
101  bool includeSquashInst[Impl::MaxThreads];
102 };
103 
104 template<class Impl>
105 struct IssueStruct {
106  typedef typename Impl::DynInstPtr DynInstPtr;
107 
108  int size;
109 
110  DynInstPtr insts[Impl::MaxWidth];
111 };
112 
114 template<class Impl>
116  typedef typename Impl::DynInstPtr DynInstPtr;
117  struct decodeComm {
123  uint64_t branchAddr;
124  unsigned branchCount;
125  bool squash;
129  };
130 
131  decodeComm decodeInfo[Impl::MaxThreads];
132 
133  struct renameComm {
134  };
135 
136  renameComm renameInfo[Impl::MaxThreads];
137 
138  struct iewComm {
139  // Also eventually include skid buffer space.
140  unsigned freeIQEntries;
141  unsigned freeLQEntries;
142  unsigned freeSQEntries;
143  unsigned dispatchedToLQ;
144  unsigned dispatchedToSQ;
145 
146  unsigned iqCount;
147  unsigned ldstqCount;
148 
149  unsigned dispatched;
150  bool usedIQ;
151  bool usedLSQ;
152  };
153 
154  iewComm iewInfo[Impl::MaxThreads];
155 
156  struct commitComm {
158  // This code has been re-structured for better packing of variables
159  // instead of by stage which is the more logical way to arrange the
160  // data.
161  // F = Fetch
162  // D = Decode
163  // I = IEW
164  // R = Rename
165  // As such each member is annotated with who consumes it
166  // e.g. bool variable name // *F,R for Fetch and Rename
168 
173 
177 
180 
184 
188 
193 
195  unsigned freeROBEntries; // *R
196 
197  bool squash; // *F, D, R, I
198  bool robSquashing; // *F, D, R, I
199 
201  bool usedROB; // *R
202 
204  bool emptyROB; // *R
205 
207  bool branchTaken; // *F
209  bool interruptPending; // *F
211  bool clearInterrupt; // *F
212 
215  bool strictlyOrdered; // *I
216 
217  };
218 
219  commitComm commitInfo[Impl::MaxThreads];
220 
221  bool decodeBlock[Impl::MaxThreads];
222  bool decodeUnblock[Impl::MaxThreads];
223  bool renameBlock[Impl::MaxThreads];
224  bool renameUnblock[Impl::MaxThreads];
225  bool iewBlock[Impl::MaxThreads];
226  bool iewUnblock[Impl::MaxThreads];
227 };
228 
229 #endif //__CPU_O3_COMM_HH__
TimeBufStruct::renameBlock
bool renameBlock[Impl::MaxThreads]
Definition: comm.hh:223
DefaultFetchDefaultDecode::fetchFault
Fault fetchFault
Definition: comm.hh:60
TimeBufStruct::iewComm::freeSQEntries
unsigned freeSQEntries
Definition: comm.hh:142
TimeBufStruct::commitComm::doneSeqNum
InstSeqNum doneSeqNum
Represents the instruction that has either been retired or squashed.
Definition: comm.hh:192
TimeBufStruct::commitComm::emptyROB
bool emptyROB
Notify Rename that the ROB is empty.
Definition: comm.hh:204
TimeBufStruct::decodeComm::branchMispredict
bool branchMispredict
Definition: comm.hh:127
TimeBufStruct::decodeComm::branchAddr
uint64_t branchAddr
Definition: comm.hh:123
TimeBufStruct::commitComm::clearInterrupt
bool clearInterrupt
If the interrupt ended up being cleared before being handled.
Definition: comm.hh:211
DefaultIEWDefaultCommit::branchMispredict
bool branchMispredict[Impl::MaxThreads]
Definition: comm.hh:99
TimeBufStruct::decodeComm::mispredPC
Addr mispredPC
Definition: comm.hh:122
DefaultIEWDefaultCommit::size
int size
Definition: comm.hh:90
DefaultDecodeDefaultRename
Struct that defines the information passed from decode to rename.
Definition: comm.hh:67
TimeBufStruct::decodeComm::branchTaken
bool branchTaken
Definition: comm.hh:128
TimeBufStruct::iewComm::usedIQ
bool usedIQ
Definition: comm.hh:150
TimeBufStruct::decodeComm
Definition: comm.hh:117
DefaultIEWDefaultCommit::DynInstPtr
Impl::DynInstPtr DynInstPtr
Definition: comm.hh:88
DefaultFetchDefaultDecode::insts
DynInstPtr insts[Impl::MaxWidth]
Definition: comm.hh:59
TimeBufStruct::renameInfo
renameComm renameInfo[Impl::MaxThreads]
Definition: comm.hh:136
TimeBufStruct::commitInfo
commitComm commitInfo[Impl::MaxThreads]
Definition: comm.hh:219
TimeBufStruct::commitComm::freeROBEntries
unsigned freeROBEntries
Tell Rename how many free entries it has in the ROB.
Definition: comm.hh:195
faults.hh
TimeBufStruct::decodeComm::nextPC
TheISA::PCState nextPC
Definition: comm.hh:118
TimeBufStruct::decodeComm::predIncorrect
bool predIncorrect
Definition: comm.hh:126
TimeBufStruct::renameComm
Definition: comm.hh:133
DefaultIEWDefaultCommit::pc
TheISA::PCState pc[Impl::MaxThreads]
Definition: comm.hh:96
TimeBufStruct::commitComm::nonSpecSeqNum
InstSeqNum nonSpecSeqNum
Communication specifically to the IQ to tell the IQ that it can schedule a non-speculative instructio...
Definition: comm.hh:187
TimeBufStruct::decodeComm::mispredictInst
DynInstPtr mispredictInst
Definition: comm.hh:119
IssueStruct::DynInstPtr
Impl::DynInstPtr DynInstPtr
Definition: comm.hh:106
TimeBufStruct::commitComm::squashInst
DynInstPtr squashInst
Instruction that caused the a non-mispredict squash.
Definition: comm.hh:179
DefaultIEWDefaultCommit::mispredPC
Addr mispredPC[Impl::MaxThreads]
Definition: comm.hh:94
DefaultFetchDefaultDecode::fetchFaultSN
InstSeqNum fetchFaultSN
Definition: comm.hh:61
TimeBufStruct::commitComm::strictlyOrdered
bool strictlyOrdered
Hack for now to send back an strictly ordered access to the IEW stage.
Definition: comm.hh:215
TimeBufStruct::DynInstPtr
Impl::DynInstPtr DynInstPtr
Definition: comm.hh:116
TimeBufStruct::renameUnblock
bool renameUnblock[Impl::MaxThreads]
Definition: comm.hh:224
DefaultFetchDefaultDecode::size
int size
Definition: comm.hh:57
IssueStruct::size
int size
Definition: comm.hh:108
inst_seq.hh
TimeBufStruct::iewComm
Definition: comm.hh:138
TimeBufStruct::commitComm::pc
TheISA::PCState pc
The pc of the next instruction to execute.
Definition: comm.hh:172
TimeBufStruct::iewComm::usedLSQ
bool usedLSQ
Definition: comm.hh:151
TimeBufStruct::decodeComm::doneSeqNum
InstSeqNum doneSeqNum
Definition: comm.hh:121
TimeBufStruct::iewComm::iqCount
unsigned iqCount
Definition: comm.hh:146
Fault
std::shared_ptr< FaultBase > Fault
Definition: types.hh:240
DefaultIEWDefaultCommit::squashedSeqNum
InstSeqNum squashedSeqNum[Impl::MaxThreads]
Definition: comm.hh:95
DefaultRenameDefaultIEW
Struct that defines the information passed from rename to IEW.
Definition: comm.hh:77
DefaultIEWDefaultCommit::squash
bool squash[Impl::MaxThreads]
Definition: comm.hh:98
DefaultIEWDefaultCommit::mispredictInst
DynInstPtr mispredictInst[Impl::MaxThreads]
Definition: comm.hh:93
TimeBufStruct::iewComm::ldstqCount
unsigned ldstqCount
Definition: comm.hh:147
IssueStruct
Definition: comm.hh:105
DefaultDecodeDefaultRename::size
int size
Definition: comm.hh:70
IssueStruct::insts
DynInstPtr insts[Impl::MaxWidth]
Definition: comm.hh:110
DefaultIEWDefaultCommit::includeSquashInst
bool includeSquashInst[Impl::MaxThreads]
Definition: comm.hh:101
TimeBufStruct::commitComm::squash
bool squash
Definition: comm.hh:197
TimeBufStruct::iewBlock
bool iewBlock[Impl::MaxThreads]
Definition: comm.hh:225
TimeBufStruct::commitComm::robSquashing
bool robSquashing
Definition: comm.hh:198
TimeBufStruct::commitComm
Definition: comm.hh:156
TimeBufStruct::decodeComm::squashInst
DynInstPtr squashInst
Definition: comm.hh:120
InstSeqNum
uint64_t InstSeqNum
Definition: inst_seq.hh:37
DefaultRenameDefaultIEW::size
int size
Definition: comm.hh:80
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
DefaultIEWDefaultCommit::branchTaken
bool branchTaken[Impl::MaxThreads]
Definition: comm.hh:100
TimeBufStruct
Struct that defines all backwards communication.
Definition: comm.hh:115
TimeBufStruct::iewComm::freeIQEntries
unsigned freeIQEntries
Definition: comm.hh:140
TimeBufStruct::iewComm::dispatchedToLQ
unsigned dispatchedToLQ
Definition: comm.hh:143
TimeBufStruct::decodeInfo
decodeComm decodeInfo[Impl::MaxThreads]
Definition: comm.hh:131
DefaultIEWDefaultCommit
Struct that defines the information passed from IEW to commit.
Definition: comm.hh:87
TimeBufStruct::decodeUnblock
bool decodeUnblock[Impl::MaxThreads]
Definition: comm.hh:222
TimeBufStruct::commitComm::strictlyOrderedLoad
DynInstPtr strictlyOrderedLoad
Hack for now to send back a strictly ordered access to the IEW stage.
Definition: comm.hh:183
DefaultRenameDefaultIEW::DynInstPtr
Impl::DynInstPtr DynInstPtr
Definition: comm.hh:78
TimeBufStruct::commitComm::usedROB
bool usedROB
Rename should re-read number of free rob entries.
Definition: comm.hh:201
MipsISA::PCState
GenericISA::DelaySlotPCState< MachInst > PCState
Definition: types.hh:41
types.hh
TimeBufStruct::decodeComm::branchCount
unsigned branchCount
Definition: comm.hh:124
TimeBufStruct::decodeComm::squash
bool squash
Definition: comm.hh:125
TimeBufStruct::commitComm::interruptPending
bool interruptPending
If an interrupt is pending and fetch should stall.
Definition: comm.hh:209
TimeBufStruct::iewInfo
iewComm iewInfo[Impl::MaxThreads]
Definition: comm.hh:154
TimeBufStruct::iewComm::freeLQEntries
unsigned freeLQEntries
Definition: comm.hh:141
DefaultDecodeDefaultRename::insts
DynInstPtr insts[Impl::MaxWidth]
Definition: comm.hh:72
DefaultRenameDefaultIEW::insts
DynInstPtr insts[Impl::MaxWidth]
Definition: comm.hh:82
TimeBufStruct::decodeBlock
bool decodeBlock[Impl::MaxThreads]
Definition: comm.hh:221
TimeBufStruct::iewUnblock
bool iewUnblock[Impl::MaxThreads]
Definition: comm.hh:226
TimeBufStruct::commitComm::mispredictInst
DynInstPtr mispredictInst
Provide fetch the instruction that mispredicted, if this pointer is not-null a misprediction occured.
Definition: comm.hh:176
DefaultIEWDefaultCommit::insts
DynInstPtr insts[Impl::MaxWidth]
Definition: comm.hh:92
DefaultDecodeDefaultRename::DynInstPtr
Impl::DynInstPtr DynInstPtr
Definition: comm.hh:68
TimeBufStruct::commitComm::branchTaken
bool branchTaken
Was the branch taken or not.
Definition: comm.hh:207
TimeBufStruct::iewComm::dispatchedToSQ
unsigned dispatchedToSQ
Definition: comm.hh:144
TimeBufStruct::iewComm::dispatched
unsigned dispatched
Definition: comm.hh:149
DefaultFetchDefaultDecode::DynInstPtr
Impl::DynInstPtr DynInstPtr
Definition: comm.hh:55
DefaultFetchDefaultDecode::clearFetchFault
bool clearFetchFault
Definition: comm.hh:62
DefaultFetchDefaultDecode
Struct that defines the information passed from fetch to decode.
Definition: comm.hh:54

Generated on Wed Sep 30 2020 14:02:09 for gem5 by doxygen 1.8.17