gem5  v20.1.0.0
func_unit.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2014 ARM Limited
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions are
16  * met: redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer;
18  * redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution;
21  * neither the name of the copyright holders nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  */
37 
44 #ifndef __CPU_MINOR_FUNC_UNIT_HH__
45 #define __CPU_MINOR_FUNC_UNIT_HH__
46 
47 #include "cpu/minor/buffers.hh"
48 #include "cpu/minor/dyn_inst.hh"
49 #include "cpu/func_unit.hh"
50 #include "cpu/timing_expr.hh"
51 #include "params/MinorFU.hh"
52 #include "params/MinorFUPool.hh"
53 #include "params/MinorOpClass.hh"
54 #include "params/MinorOpClassSet.hh"
55 #include "sim/clocked_object.hh"
56 
59 class MinorOpClass : public SimObject
60 {
61  public:
62  OpClass opClass;
63 
64  public:
65  MinorOpClass(const MinorOpClassParams *params) :
68  { }
69 };
70 
72 class MinorOpClassSet : public SimObject
73 {
74  public:
76 
80 
81  public:
82  MinorOpClassSet(const MinorOpClassSetParams *params);
83 
84  public:
86  bool provides(OpClass op_class) { return capabilityList[op_class]; }
87 };
88 
93 class MinorFUTiming: public SimObject
94 {
95  public:
98  uint64_t mask;
99  uint64_t match;
100 
102  std::string description;
103 
106  bool suppress;
107 
112 
118 
127 
130 
131  public:
132  MinorFUTiming(const MinorFUTimingParams *params);
133 
134  public:
136  bool provides(OpClass op_class) { return opClasses->provides(op_class); }
137 };
138 
147 class MinorFU : public SimObject
148 {
149  public:
151 
155 
159 
163 
166 
167  public:
168  MinorFU(const MinorFUParams *params) :
169  SimObject(params),
171  opLat(params->opLat),
175  { }
176 };
177 
179 class MinorFUPool : public SimObject
180 {
181  public:
183 
184  public:
185  MinorFUPool(const MinorFUPoolParams *params) :
186  SimObject(params),
188  { }
189 };
190 
191 namespace Minor
192 {
193 
197 {
198  public:
200 
201  public:
203  inst(inst_)
204  { }
205 
206  public:
208  void reportData(std::ostream &os) const;
209  bool isBubble() const { return inst->isBubble(); }
210 
212  { return QueuedInst(MinorDynInst::bubble()); }
213 };
214 
218 typedef SelfStallingPipeline<QueuedInst,
220 
222 class FUPipeline : public FUPipelineBase, public FuncUnit
223 {
224  public:
227 
230 
232  std::bitset<Num_OpClasses> capabilityList;
233 
237 
238  public:
243 
244  public:
245  FUPipeline(const std::string &name, const MinorFU &description_,
246  ClockedObject &timeSource_);
247 
248  public:
252 
254  bool canInsert() const;
255 
258  MinorFUTiming *findTiming(const StaticInstPtr &inst);
259 
261  void advance();
262 };
263 
264 }
265 
266 #endif /* __CPU_MINOR_FUNC_UNIT_HH__ */
MinorFUTiming::MinorFUTiming
MinorFUTiming(const MinorFUTimingParams *params)
Definition: func_unit.cc:88
dyn_inst.hh
MinorFUTiming::srcRegsRelativeLats
std::vector< Cycles > srcRegsRelativeLats
Cycle offsets from the scoreboard delivery times of register values for each of this instruction's so...
Definition: func_unit.hh:126
X86ISA::os
Bitfield< 17 > os
Definition: misc.hh:803
Minor::QueuedInst::reportData
void reportData(std::ostream &os) const
Report and bubble interfaces.
Definition: func_unit.cc:106
Minor::QueuedInst::QueuedInst
QueuedInst(MinorDynInstPtr inst_=MinorDynInst::bubble())
Definition: func_unit.hh:202
MinorFUTiming
Extra timing capability to allow individual ops to have their source register dependency latencies tw...
Definition: func_unit.hh:93
Minor::FUPipeline::capabilityList
std::bitset< Num_OpClasses > capabilityList
Set of operation classes supported by this FU.
Definition: func_unit.hh:232
Minor::FUPipeline::nextInsertCycle
Cycles nextInsertCycle
When can a new instruction be inserted into the pipeline? This is an absolute cycle time unless it is...
Definition: func_unit.hh:242
MinorFUTiming::provides
bool provides(OpClass op_class)
Does the extra decode in this object support the given op class.
Definition: func_unit.hh:136
timing_expr.hh
Minor::FUPipeline::canInsert
bool canInsert() const
Can an instruction be inserted now?
Definition: func_unit.cc:177
MinorFUPool::funcUnits
std::vector< MinorFU * > funcUnits
Definition: func_unit.hh:182
MinorFUTiming::description
std::string description
Textual description of the decode's purpose.
Definition: func_unit.hh:102
std::vector< MinorOpClass * >
Minor::FUPipeline::cyclesBeforeInsert
Cycles cyclesBeforeInsert()
How many cycles must from curCycle before insertion into the pipeline is allowed.
Definition: func_unit.cc:168
MinorFUTiming::suppress
bool suppress
If true, instructions matching this mask/match should not be issued in this FU.
Definition: func_unit.hh:106
TimingExpr
Definition: timing_expr.hh:88
Minor
Definition: activity.cc:44
ClockedObject
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
Definition: clocked_object.hh:231
MinorFU::opLat
Cycles opLat
Delay from issuing the operation, to it reaching the end of the associated pipeline.
Definition: func_unit.hh:154
Minor::FUPipeline::FUPipeline
FUPipeline(const std::string &name, const MinorFU &description_, ClockedObject &timeSource_)
Definition: func_unit.cc:111
MinorOpClassSet::MinorOpClassSet
MinorOpClassSet(const MinorOpClassSetParams *params)
Definition: func_unit.cc:77
Minor::ReportTraitsAdaptor
...ReportTraits are trait classes with the same functionality as ReportIF, but with elements explicit...
Definition: buffers.hh:90
Minor::SelfStallingPipeline
A pipeline simulating class that will stall (not advance when advance() is called) if a non-bubble va...
Definition: buffers.hh:287
MinorFUTiming::extraAssumedLat
Cycles extraAssumedLat
Extra delay that results should show in the scoreboard after leaving the pipeline.
Definition: func_unit.hh:117
Minor::FUPipeline::cantForwardFromFUIndices
std::vector< bool > cantForwardFromFUIndices
FUs which this pipeline can't receive a forwarded (i.e.
Definition: func_unit.hh:236
Minor::MinorDynInst::bubble
static MinorDynInstPtr bubble()
There is a single bubble inst.
Definition: dyn_inst.hh:248
MinorFU::MinorFU
MinorFU(const MinorFUParams *params)
Definition: func_unit.hh:168
func_unit.hh
Minor::FUPipeline::advance
void advance()
Step the pipeline.
Definition: func_unit.cc:183
MinorOpClassSet::provides
bool provides(OpClass op_class)
Does this set support the given op class.
Definition: func_unit.hh:86
MinorOpClassSet::opClasses
std::vector< MinorOpClass * > opClasses
Definition: func_unit.hh:75
Minor::FUPipelineBase
SelfStallingPipeline< QueuedInst, ReportTraitsAdaptor< QueuedInst > > FUPipelineBase
Functional units have pipelines which stall when an inst gets to their ends allowing Execute::commit ...
Definition: func_unit.hh:219
FuncUnit::name
std::string name
Definition: func_unit.hh:94
MinorFUTiming::mask
uint64_t mask
Mask off the ExtMachInst of an instruction before comparing with match.
Definition: func_unit.hh:98
MinorFU::timings
std::vector< MinorFUTiming * > timings
Extra timing info to give timings to individual ops.
Definition: func_unit.hh:165
MinorFU::issueLat
Cycles issueLat
Delay after issuing an operation before the next operation can be issued.
Definition: func_unit.hh:158
MinorFUTiming::opClasses
MinorOpClassSet * opClasses
Extra opClasses check (after the FU one)
Definition: func_unit.hh:129
MinorOpClass::MinorOpClass
MinorOpClass(const MinorOpClassParams *params)
Definition: func_unit.hh:65
MinorFUPool::MinorFUPool
MinorFUPool(const MinorFUPoolParams *params)
Definition: func_unit.hh:185
Minor::FUPipeline::timeSource
ClockedObject & timeSource
An FUPipeline needs access to curCycle, use this timing source.
Definition: func_unit.hh:229
Minor::QueuedInst::inst
MinorDynInstPtr inst
Definition: func_unit.hh:199
SimObject::params
const Params * params() const
Definition: sim_object.hh:119
Minor::QueuedInst::bubble
static QueuedInst bubble()
Definition: func_unit.hh:211
Minor::FUPipeline
A functional unit configured from a MinorFU object.
Definition: func_unit.hh:222
MinorFUTiming::match
uint64_t match
Definition: func_unit.hh:99
MinorFU
A functional unit that can execute any of opClasses operations with a single op(eration)Lat(ency) and...
Definition: func_unit.hh:147
clocked_object.hh
MinorFUTiming::extraCommitLat
Cycles extraCommitLat
Extra latency that the instruction should spend at the end of the pipeline.
Definition: func_unit.hh:110
MinorOpClass
Boxing for MinorOpClass to get around a build problem with C++11 but also allow for future additions ...
Definition: func_unit.hh:59
Cycles
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:83
Minor::QueuedInst
Container class to box instructions in the FUs to make those queues have correct bubble behaviour whe...
Definition: func_unit.hh:196
buffers.hh
Minor::FUPipeline::description
const MinorFU & description
Functional unit description that this pipeline implements.
Definition: func_unit.hh:226
RefCountingPtr< MinorDynInst >
MinorFUPool
A collection of MinorFUs.
Definition: func_unit.hh:179
MinorFUTiming::extraCommitLatExpr
TimingExpr * extraCommitLatExpr
Definition: func_unit.hh:111
MinorFU::opClasses
MinorOpClassSet * opClasses
Definition: func_unit.hh:150
MinorOpClassSet
Wrapper for a matchable set of op classes.
Definition: func_unit.hh:72
Minor::FUPipeline::findTiming
MinorFUTiming * findTiming(const StaticInstPtr &inst)
Find the extra timing information for this instruction.
Definition: func_unit.cc:201
MinorFU::cantForwardFromFUIndices
std::vector< unsigned int > cantForwardFromFUIndices
FUs which this pipeline can't receive a forwarded (i.e.
Definition: func_unit.hh:162
FuncUnit
Definition: func_unit.hh:83
MinorOpClass::opClass
OpClass opClass
Definition: func_unit.hh:62
MinorOpClassSet::capabilityList
std::vector< bool > capabilityList
Convenience packing of opClasses into a bit vector for easier testing.
Definition: func_unit.hh:79
Minor::QueuedInst::isBubble
bool isBubble() const
Definition: func_unit.hh:209
SimObject
Abstract superclass for simulation objects.
Definition: sim_object.hh:92

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