gem5  v21.1.0.2
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 <cstdint>
48 #include <ostream>
49 #include <string>
50 #include <vector>
51 
52 #include "base/types.hh"
53 #include "cpu/func_unit.hh"
54 #include "cpu/minor/buffers.hh"
55 #include "cpu/minor/dyn_inst.hh"
56 #include "cpu/timing_expr.hh"
57 #include "params/MinorFU.hh"
58 #include "params/MinorFUPool.hh"
59 #include "params/MinorOpClass.hh"
60 #include "params/MinorOpClassSet.hh"
61 #include "sim/clocked_object.hh"
62 #include "sim/sim_object.hh"
63 
64 namespace gem5
65 {
66 
69 class MinorOpClass : public SimObject
70 {
71  public:
72  OpClass opClass;
73 
74  public:
75  MinorOpClass(const MinorOpClassParams &params) :
78  { }
79 };
80 
82 class MinorOpClassSet : public SimObject
83 {
84  public:
86 
90 
91  public:
92  MinorOpClassSet(const MinorOpClassSetParams &params);
93 
94  public:
96  bool provides(OpClass op_class) { return capabilityList[op_class]; }
97 };
98 
104 {
105  public:
108  uint64_t mask;
109  uint64_t match;
110 
112  std::string description;
113 
116  bool suppress;
117 
122 
128 
137 
140 
141  public:
142  MinorFUTiming(const MinorFUTimingParams &params);
143 
144  public:
146  bool provides(OpClass op_class) { return opClasses->provides(op_class); }
147 };
148 
157 class MinorFU : public SimObject
158 {
159  public:
161 
165 
169 
173 
176 
177  public:
178  MinorFU(const MinorFUParams &params) :
179  SimObject(params),
181  opLat(params.opLat),
185  { }
186 };
187 
189 class MinorFUPool : public SimObject
190 {
191  public:
193 
194  public:
195  MinorFUPool(const MinorFUPoolParams &params) :
196  SimObject(params),
198  { }
199 };
200 
202 namespace minor
203 {
204 
208 {
209  public:
211 
212  public:
214  inst(inst_)
215  { }
216 
217  public:
219  void reportData(std::ostream &os) const;
220  bool isBubble() const { return inst->isBubble(); }
221 
223  { return QueuedInst(MinorDynInst::bubble()); }
224 };
225 
229 typedef SelfStallingPipeline<QueuedInst,
231 
233 class FUPipeline : public FUPipelineBase, public FuncUnit
234 {
235  public:
238 
241 
243  std::bitset<Num_OpClasses> capabilityList;
244 
248 
249  public:
254 
255  public:
256  FUPipeline(const std::string &name, const MinorFU &description_,
257  ClockedObject &timeSource_);
258 
259  public:
263 
265  bool canInsert() const;
266 
269  MinorFUTiming *findTiming(const StaticInstPtr &inst);
270 
272  void advance();
273 };
274 
275 } // namespace minor
276 } // namespace gem5
277 
278 #endif /* __CPU_MINOR_FUNC_UNIT_HH__ */
dyn_inst.hh
gem5::MinorOpClass::opClass
OpClass opClass
Definition: func_unit.hh:72
gem5::minor::QueuedInst::inst
MinorDynInstPtr inst
Definition: func_unit.hh:210
gem5::MinorFUTiming::opClasses
MinorOpClassSet * opClasses
Extra opClasses check (after the FU one)
Definition: func_unit.hh:139
gem5::MinorFUPool
A collection of MinorFUs.
Definition: func_unit.hh:189
gem5::MinorFUTiming::extraAssumedLat
Cycles extraAssumedLat
Extra delay that results should show in the scoreboard after leaving the pipeline.
Definition: func_unit.hh:127
gem5::minor::FUPipeline::FUPipeline
FUPipeline(const std::string &name, const MinorFU &description_, ClockedObject &timeSource_)
Definition: func_unit.cc:87
timing_expr.hh
minor
gem5::minor::FUPipeline::advance
void advance()
Step the pipeline.
Definition: func_unit.cc:159
std::vector
STL vector class.
Definition: stl.hh:37
gem5::minor::QueuedInst
Container class to box instructions in the FUs to make those queues have correct bubble behaviour whe...
Definition: func_unit.hh:207
gem5::MinorFUTiming::description
std::string description
Textual description of the decode's purpose.
Definition: func_unit.hh:112
gem5::MinorFUTiming
Extra timing capability to allow individual ops to have their source register dependency latencies tw...
Definition: func_unit.hh:103
gem5::MinorOpClass::MinorOpClass
MinorOpClass(const MinorOpClassParams &params)
Definition: func_unit.hh:75
gem5::MinorFU::issueLat
Cycles issueLat
Delay after issuing an operation before the next operation can be issued.
Definition: func_unit.hh:168
gem5::minor::FUPipeline::timeSource
ClockedObject & timeSource
An FUPipeline needs access to curCycle, use this timing source.
Definition: func_unit.hh:240
gem5::MinorFU::cantForwardFromFUIndices
std::vector< unsigned int > cantForwardFromFUIndices
FUs which this pipeline can't receive a forwarded (i.e.
Definition: func_unit.hh:172
gem5::MinorOpClassSet::provides
bool provides(OpClass op_class)
Does this set support the given op class.
Definition: func_unit.hh:96
gem5::RefCountingPtr< MinorDynInst >
gem5::MinorOpClassSet::opClasses
std::vector< MinorOpClass * > opClasses
Definition: func_unit.hh:85
gem5::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:253
gem5::Cycles
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:78
gem5::minor::QueuedInst::isBubble
bool isBubble() const
Definition: func_unit.hh:220
gem5::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:230
gem5::minor::ReportTraitsAdaptor
...ReportTraits are trait classes with the same functionality as ReportIF, but with elements explicit...
Definition: buffers.hh:97
gem5::minor::QueuedInst::reportData
void reportData(std::ostream &os) const
Report and bubble interfaces.
Definition: func_unit.cc:82
gem5::MinorOpClassSet
Wrapper for a matchable set of op classes.
Definition: func_unit.hh:82
gem5::SimObject::params
const Params & params() const
Definition: sim_object.hh:176
sim_object.hh
func_unit.hh
gem5::MinorFU
A functional unit that can execute any of opClasses operations with a single op(eration)Lat(ency) and...
Definition: func_unit.hh:157
gem5::TimingExpr
Definition: timing_expr.hh:91
gem5::MinorOpClass
Boxing for MinorOpClass to get around a build problem with C++11 but also allow for future additions ...
Definition: func_unit.hh:69
gem5::minor::QueuedInst::bubble
static QueuedInst bubble()
Definition: func_unit.hh:222
gem5::minor::MinorDynInst::bubble
static MinorDynInstPtr bubble()
There is a single bubble inst.
Definition: dyn_inst.hh:257
gem5::minor::FUPipeline::capabilityList
std::bitset< Num_OpClasses > capabilityList
Set of operation classes supported by this FU.
Definition: func_unit.hh:243
gem5::SimObject
Abstract superclass for simulation objects.
Definition: sim_object.hh:146
gem5::MinorFUTiming::provides
bool provides(OpClass op_class)
Does the extra decode in this object support the given op class.
Definition: func_unit.hh:146
gem5::MinorFUTiming::mask
uint64_t mask
Mask off the ExtMachInst of an instruction before comparing with match.
Definition: func_unit.hh:108
gem5::MinorFUTiming::extraCommitLatExpr
TimingExpr * extraCommitLatExpr
Definition: func_unit.hh:121
gem5::GEM5_DEPRECATED_NAMESPACE
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
gem5::MinorFUPool::funcUnits
std::vector< MinorFU * > funcUnits
Definition: func_unit.hh:192
gem5::ClockedObject
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
Definition: clocked_object.hh:234
gem5::FuncUnit
Definition: func_unit.hh:102
gem5::MinorFUTiming::MinorFUTiming
MinorFUTiming(const MinorFUTimingParams &params)
Definition: func_unit.cc:63
gem5::minor::FUPipeline
A functional unit configured from a MinorFU object.
Definition: func_unit.hh:233
gem5::MinorFU::opLat
Cycles opLat
Delay from issuing the operation, to it reaching the end of the associated pipeline.
Definition: func_unit.hh:164
gem5::MinorFUPool::MinorFUPool
MinorFUPool(const MinorFUPoolParams &params)
Definition: func_unit.hh:195
gem5::minor::FUPipeline::description
const MinorFU & description
Functional unit description that this pipeline implements.
Definition: func_unit.hh:237
types.hh
gem5::X86ISA::os
Bitfield< 17 > os
Definition: misc.hh:809
clocked_object.hh
gem5::MinorOpClassSet::MinorOpClassSet
MinorOpClassSet(const MinorOpClassSetParams &params)
Definition: func_unit.cc:52
gem5::minor::FUPipeline::canInsert
bool canInsert() const
Can an instruction be inserted now?
Definition: func_unit.cc:153
gem5::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:136
gem5::minor::FUPipeline::cantForwardFromFUIndices
std::vector< bool > cantForwardFromFUIndices
FUs which this pipeline can't receive a forwarded (i.e.
Definition: func_unit.hh:247
buffers.hh
gem5::MinorFUTiming::extraCommitLat
Cycles extraCommitLat
Extra latency that the instruction should spend at the end of the pipeline.
Definition: func_unit.hh:120
gem5::MinorFU::MinorFU
MinorFU(const MinorFUParams &params)
Definition: func_unit.hh:178
gem5::FuncUnit::name
std::string name
Definition: func_unit.hh:113
gem5::minor::FUPipeline::cyclesBeforeInsert
Cycles cyclesBeforeInsert()
How many cycles must from curCycle before insertion into the pipeline is allowed.
Definition: func_unit.cc:144
gem5::MinorOpClassSet::capabilityList
std::vector< bool > capabilityList
Convenience packing of opClasses into a bit vector for easier testing.
Definition: func_unit.hh:89
gem5::MinorFUTiming::suppress
bool suppress
If true, instructions matching this mask/match should not be issued in this FU.
Definition: func_unit.hh:116
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::MinorFU::opClasses
MinorOpClassSet * opClasses
Definition: func_unit.hh:160
gem5::minor::SelfStallingPipeline
A pipeline simulating class that will stall (not advance when advance() is called) if a non-bubble va...
Definition: buffers.hh:294
gem5::MinorFU::timings
std::vector< MinorFUTiming * > timings
Extra timing info to give timings to individual ops.
Definition: func_unit.hh:175
gem5::MinorFUTiming::match
uint64_t match
Definition: func_unit.hh:109
gem5::minor::QueuedInst::QueuedInst
QueuedInst(MinorDynInstPtr inst_=MinorDynInst::bubble())
Definition: func_unit.hh:213
gem5::minor::FUPipeline::findTiming
MinorFUTiming * findTiming(const StaticInstPtr &inst)
Find the extra timing information for this instruction.
Definition: func_unit.cc:177

Generated on Tue Sep 21 2021 12:25:00 for gem5 by doxygen 1.8.17