gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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  * Authors: Andrew Bardsley
38  */
39 
46 #ifndef __CPU_MINOR_FUNC_UNIT_HH__
47 #define __CPU_MINOR_FUNC_UNIT_HH__
48 
49 #include "cpu/minor/buffers.hh"
50 #include "cpu/minor/dyn_inst.hh"
51 #include "cpu/func_unit.hh"
52 #include "cpu/timing_expr.hh"
53 #include "params/MinorFU.hh"
54 #include "params/MinorFUPool.hh"
55 #include "params/MinorOpClass.hh"
56 #include "params/MinorOpClassSet.hh"
57 #include "sim/clocked_object.hh"
58 
61 class MinorOpClass : public SimObject
62 {
63  public:
64  OpClass opClass;
65 
66  public:
67  MinorOpClass(const MinorOpClassParams *params) :
68  SimObject(params),
69  opClass(params->opClass)
70  { }
71 };
72 
74 class MinorOpClassSet : public SimObject
75 {
76  public:
78 
82 
83  public:
84  MinorOpClassSet(const MinorOpClassSetParams *params);
85 
86  public:
88  bool provides(OpClass op_class) { return capabilityList[op_class]; }
89 };
90 
95 class MinorFUTiming: public SimObject
96 {
97  public:
100  uint64_t mask;
101  uint64_t match;
102 
104  std::string description;
105 
108  bool suppress;
109 
114 
120 
129 
132 
133  public:
134  MinorFUTiming(const MinorFUTimingParams *params);
135 
136  public:
138  bool provides(OpClass op_class) { return opClasses->provides(op_class); }
139 };
140 
149 class MinorFU : public SimObject
150 {
151  public:
153 
157 
161 
165 
168 
169  public:
170  MinorFU(const MinorFUParams *params) :
171  SimObject(params),
172  opClasses(params->opClasses),
173  opLat(params->opLat),
174  issueLat(params->issueLat),
176  timings(params->timings)
177  { }
178 };
179 
181 class MinorFUPool : public SimObject
182 {
183  public:
185 
186  public:
187  MinorFUPool(const MinorFUPoolParams *params) :
188  SimObject(params),
189  funcUnits(params->funcUnits)
190  { }
191 };
192 
193 namespace Minor
194 {
195 
199 {
200  public:
202 
203  public:
205  inst(inst_)
206  { }
207 
208  public:
210  void reportData(std::ostream &os) const;
211  bool isBubble() const { return inst->isBubble(); }
212 
214  { return QueuedInst(MinorDynInst::bubble()); }
215 };
216 
220 typedef SelfStallingPipeline<QueuedInst,
222 
224 class FUPipeline : public FUPipelineBase, public FuncUnit
225 {
226  public:
229 
232 
234  std::bitset<Num_OpClasses> capabilityList;
235 
239 
240  public:
245 
246  public:
247  FUPipeline(const std::string &name, const MinorFU &description_,
248  ClockedObject &timeSource_);
249 
250  public:
254 
256  bool canInsert() const;
257 
260  MinorFUTiming *findTiming(const StaticInstPtr &inst);
261 
263  void advance();
264 };
265 
266 }
267 
268 #endif /* __CPU_MINOR_FUNC_UNIT_HH__ */
...ReportTraits are trait classes with the same functionality as ReportIF, but with elements explicit...
Definition: buffers.hh:92
uint64_t match
Definition: func_unit.hh:101
Wrapper for a matchable set of op classes.
Definition: func_unit.hh:74
Container class to box instructions in the FUs to make those queues have correct bubble behaviour whe...
Definition: func_unit.hh:198
const std::string & name() const
Definition: trace.hh:149
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:83
MinorOpClassSet * opClasses
Definition: func_unit.hh:152
MinorOpClass(const MinorOpClassParams *params)
Definition: func_unit.hh:67
MinorOpClassSet(const MinorOpClassSetParams *params)
Definition: func_unit.cc:79
A collection of MinorFUs.
Definition: func_unit.hh:181
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:244
const Params * params() const
Definition: sim_object.hh:111
A functional unit that can execute any of opClasses operations with a single op(eration)Lat(ency) and...
Definition: func_unit.hh:149
Cycles opLat
Delay from issuing the operation, to it reaching the end of the associated pipeline.
Definition: func_unit.hh:156
Cycles extraAssumedLat
Extra delay that results should show in the scoreboard after leaving the pipeline.
Definition: func_unit.hh:119
const MinorFU & description
Functional unit description that this pipeline implements.
Definition: func_unit.hh:228
Bitfield< 17 > os
Definition: misc.hh:804
bool isBubble() const
Definition: func_unit.hh:211
bool provides(OpClass op_class)
Does this set support the given op class.
Definition: func_unit.hh:88
std::vector< MinorFU * > funcUnits
Definition: func_unit.hh:184
std::vector< MinorFUTiming * > timings
Extra timing info to give timings to individual ops.
Definition: func_unit.hh:167
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
ClockedObject declaration and implementation.
ClockedObject & timeSource
An FUPipeline needs access to curCycle, use this timing source.
Definition: func_unit.hh:231
MinorFU(const MinorFUParams *params)
Definition: func_unit.hh:170
MinorFUTiming(const MinorFUTimingParams *params)
Definition: func_unit.cc:90
void reportData(std::ostream &os) const
Report and bubble interfaces.
Definition: func_unit.cc:108
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:128
Classes for buffer, queue and FIFO behaviour.
Extra timing capability to allow individual ops to have their source register dependency latencies tw...
Definition: func_unit.hh:95
MinorFUTiming * findTiming(const StaticInstPtr &inst)
Find the extra timing information for this instruction.
Definition: func_unit.cc:203
std::vector< bool > capabilityList
Convenience packing of opClasses into a bit vector for easier testing.
Definition: func_unit.hh:81
std::vector< unsigned int > cantForwardFromFUIndices
FUs which this pipeline can't receive a forwarded (i.e.
Definition: func_unit.hh:164
std::bitset< Num_OpClasses > capabilityList
Set of operation classes supported by this FU.
Definition: func_unit.hh:234
bool suppress
If true, instructions matching this mask/match should not be issued in this FU.
Definition: func_unit.hh:108
bool provides(OpClass op_class)
Does the extra decode in this object support the given op class.
Definition: func_unit.hh:138
TimingExpr * extraCommitLatExpr
Definition: func_unit.hh:113
OpClass opClass
Definition: func_unit.hh:64
Cycles cyclesBeforeInsert()
How many cycles must from curCycle before insertion into the pipeline is allowed. ...
Definition: func_unit.cc:170
Boxing for MinorOpClass to get around a build problem with C++11 but also allow for future additions ...
Definition: func_unit.hh:61
void advance()
Step the pipeline.
Definition: func_unit.cc:185
static MinorDynInstPtr bubble()
There is a single bubble inst.
Definition: dyn_inst.hh:244
The dynamic instruction and instruction/line id (sequence numbers) definition for Minor...
uint64_t mask
Mask off the ExtMachInst of an instruction before comparing with match.
Definition: func_unit.hh:100
A pipeline simulating class that will stall (not advance when advance() is called) if a non-bubble va...
Definition: buffers.hh:285
QueuedInst(MinorDynInstPtr inst_=MinorDynInst::bubble())
Definition: func_unit.hh:204
MinorFUPool(const MinorFUPoolParams *params)
Definition: func_unit.hh:187
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:221
std::vector< MinorOpClass * > opClasses
Definition: func_unit.hh:77
MinorOpClassSet * opClasses
Extra opClasses check (after the FU one)
Definition: func_unit.hh:131
Cycles extraCommitLat
Extra latency that the instruction should spend at the end of the pipeline.
Definition: func_unit.hh:112
FUPipeline(const std::string &name, const MinorFU &description_, ClockedObject &timeSource_)
Definition: func_unit.cc:113
bool canInsert() const
Can an instruction be inserted now?
Definition: func_unit.cc:179
std::vector< bool > cantForwardFromFUIndices
FUs which this pipeline can't receive a forwarded (i.e.
Definition: func_unit.hh:238
Cycles issueLat
Delay after issuing an operation before the next operation can be issued.
Definition: func_unit.hh:160
Abstract superclass for simulation objects.
Definition: sim_object.hh:94
MinorDynInstPtr inst
Definition: func_unit.hh:201
A functional unit configured from a MinorFU object.
Definition: func_unit.hh:224
static QueuedInst bubble()
Definition: func_unit.hh:213
std::string description
Textual description of the decode's purpose.
Definition: func_unit.hh:104

Generated on Fri Jun 9 2017 13:03:42 for gem5 by doxygen 1.8.6