gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
exec_stage.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2015 Advanced Micro Devices, Inc.
3  * All rights reserved.
4  *
5  * For use for simulation and test purposes only
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright notice,
11  * this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  * this list of conditions and the following disclaimer in the documentation
15  * and/or other materials provided with the distribution.
16  *
17  * 3. Neither the name of the copyright holder nor the names of its
18  * contributors may be used to endorse or promote products derived from this
19  * software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  *
33  * Authors: John Kalamatianos,
34  * Sooraj Puthoor
35  */
36 
37 #ifndef __EXEC_STAGE_HH__
38 #define __EXEC_STAGE_HH__
39 
40 #include <string>
41 #include <utility>
42 #include <vector>
43 
44 #include "sim/stats.hh"
45 
46 class ComputeUnit;
47 class Wavefront;
48 struct ComputeUnitParams;
49 
51 {
55 };
56 
58 {
59  EMPTY = 0,
61 };
62 
63 // Execution stage.
64 // Each execution resource executes the
65 // wave which is in its dispatch list.
66 // The schedule stage is responsible for
67 // adding a wave into each execution resource's
68 // dispatch list.
69 
70 class ExecStage
71 {
72  public:
73  ExecStage(const ComputeUnitParams* params);
74  ~ExecStage() { }
75  void init(ComputeUnit *cu);
76  void exec();
77 
78  std::string name() { return _name; }
79  void regStats();
80  // number of idle cycles
82  // number of busy cycles
84  // number of cycles (per execution unit) during which at least one
85  // instruction was issued to that unit
87  // number of idle cycles (per execution unit) during which the unit issued
88  // no instruction targeting that unit, even though there is at least one
89  // Wavefront with such an instruction as the oldest
91  // SIMDs active per cycle
93 
94  private:
95  void collectStatistics(enum STAT_STATUS stage, int unitId);
96  void initStatistics();
98  uint32_t numSIMDs;
99 
100  // Number of memory execution resources;
101  // both global and local memory execution resources in CU
102  uint32_t numMemUnits;
103 
104  // List of waves which will be dispatched to
105  // each execution resource. A FILLED implies
106  // dispatch list is non-empty and
107  // execution unit has something to execute
108  // this cycle. Currently, the dispatch list of
109  // an execution resource can hold only one wave because
110  // an execution resource can execute only one wave in a cycle.
111  // dispatchList is used to communicate between schedule
112  // and exec stage
114  // flag per vector SIMD unit that is set when there is at least one
115  // WV that has a vector ALU instruction as the oldest in its
116  // Instruction Buffer
126  uint64_t idle_dur;
127  std::string _name;
128 };
129 
130 #endif // __EXEC_STAGE_HH__
uint32_t executionResourcesUsed
Definition: exec_stage.hh:125
uint32_t numSIMDs
Definition: exec_stage.hh:98
std::string _name
Definition: exec_stage.hh:127
Stats::Distribution idleDur
Definition: exec_stage.hh:124
A vector of scalar stats.
Definition: statistics.hh:2550
Stats::Vector numCyclesWithInstrTypeIssued
Definition: exec_stage.hh:86
Stats::Scalar numCyclesWithInstrIssued
Definition: exec_stage.hh:83
std::string name()
Definition: exec_stage.hh:78
Stats::Distribution spc
Definition: exec_stage.hh:92
ExecStage(const ComputeUnitParams *params)
Definition: exec_stage.cc:42
void collectStatistics(enum STAT_STATUS stage, int unitId)
Definition: exec_stage.cc:66
This is a simple scalar statistic, like a counter.
Definition: statistics.hh:2508
STL vector class.
Definition: stl.hh:40
ComputeUnit * computeUnit
Definition: exec_stage.hh:97
DISPATCH_STATUS
Definition: exec_stage.hh:57
uint64_t idle_dur
Definition: exec_stage.hh:126
A simple distribution stat.
Definition: statistics.hh:2592
bool lastTimeInstExecuted
Definition: exec_stage.hh:120
Stats::Scalar numCyclesWithNoIssue
Definition: exec_stage.hh:81
void exec()
Definition: exec_stage.cc:129
bool instrExecuted
Definition: exec_stage.hh:122
void init(ComputeUnit *cu)
Definition: exec_stage.cc:54
Stats::Vector numCyclesWithNoInstrTypeIssued
Definition: exec_stage.hh:90
int * glbMemInstAvail
Definition: exec_stage.hh:118
STAT_STATUS
Definition: exec_stage.hh:50
std::vector< std::pair< Wavefront *, DISPATCH_STATUS > > * dispatchList
Definition: exec_stage.hh:113
void initStatistics()
Definition: exec_stage.cc:121
Stats::Scalar numTransActiveIdle
Definition: exec_stage.hh:123
std::vector< bool > * vectorAluInstAvail
Definition: exec_stage.hh:117
int * shrMemInstAvail
Definition: exec_stage.hh:119
uint32_t numMemUnits
Definition: exec_stage.hh:102
void regStats()
Definition: exec_stage.cc:153
bool thisTimeInstExecuted
Definition: exec_stage.hh:121

Generated on Fri Feb 28 2020 16:27:01 for gem5 by doxygen 1.8.13