gem5  v22.1.0.0
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  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its
16  * contributors may be used to endorse or promote products derived from this
17  * software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 #ifndef __EXEC_STAGE_HH__
33 #define __EXEC_STAGE_HH__
34 
35 #include <string>
36 #include <unordered_map>
37 #include <utility>
38 #include <vector>
39 
40 #include "base/statistics.hh"
41 #include "base/stats/group.hh"
42 
43 namespace gem5
44 {
45 
46 class ComputeUnit;
47 class ScheduleToExecute;
48 class Wavefront;
49 
50 struct ComputeUnitParams;
51 
53 {
56  PostExec
57 };
58 
60 {
61  EMPTY = 0, // no wave present in dispatchList slot
62  EXREADY, // wave ready for execution
63  SKIP, // extra memory resource needed, Shared Mem. only
64 };
65 
66 // Execution stage.
67 // Each execution resource executes the
68 // wave which is in its dispatch list.
69 // The schedule stage is responsible for
70 // adding a wave into each execution resource's
71 // dispatch list.
72 
73 class ExecStage
74 {
75  public:
76  ExecStage(const ComputeUnitParams &p, ComputeUnit &cu,
77  ScheduleToExecute &from_schedule);
78  ~ExecStage() { }
79  void init();
80  void exec();
81 
82  std::string dispStatusToStr(int j);
83  void dumpDispList();
84 
85  const std::string& name() const { return _name; }
86 
87  private:
88  void collectStatistics(enum STAT_STATUS stage, int unitId);
89  void initStatistics();
92 
97  uint64_t idle_dur;
98  const std::string _name;
99 
100  protected:
102  {
104 
105  // number of transitions from active to idle
107  // number of idle cycles
109  // number of busy cycles
111  // SIMDs active per cycle
113  // duration of idle periods in cycles
115  // number of cycles during which at least one
116  // instruction was issued to an execution resource type
118  // number of idle cycles during which the scheduler
119  // issued no instructions targeting a specific
120  // execution resource type
122  } stats;
123 };
124 
125 } // namespace gem5
126 
127 #endif // __EXEC_STAGE_HH__
void initStatistics()
Definition: exec_stage.cc:103
uint64_t idle_dur
Definition: exec_stage.hh:97
bool thisTimeInstExecuted
Definition: exec_stage.hh:94
ScheduleToExecute & fromSchedule
Definition: exec_stage.hh:91
ComputeUnit & computeUnit
Definition: exec_stage.hh:90
int executionResourcesUsed
Definition: exec_stage.hh:96
bool lastTimeInstExecuted
Definition: exec_stage.hh:93
void dumpDispList()
Definition: exec_stage.cc:129
const std::string & name() const
Definition: exec_stage.hh:85
void collectStatistics(enum STAT_STATUS stage, int unitId)
Definition: exec_stage.cc:65
const std::string _name
Definition: exec_stage.hh:98
gem5::ExecStage::ExecStageStats stats
std::string dispStatusToStr(int j)
Definition: exec_stage.cc:111
ExecStage(const ComputeUnitParams &p, ComputeUnit &cu, ScheduleToExecute &from_schedule)
Definition: exec_stage.cc:45
Communication interface between Schedule and Execute stages.
Definition: comm.hh:99
A simple distribution stat.
Definition: statistics.hh:2085
Statistics container.
Definition: group.hh:94
This is a simple scalar statistic, like a counter.
Definition: statistics.hh:1931
A vector of scalar stats.
Definition: statistics.hh:2007
Bitfield< 24 > j
Definition: misc_types.hh:57
Bitfield< 54 > p
Definition: pagetable.hh:70
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
STAT_STATUS
Definition: exec_stage.hh:53
@ IdleExec
Definition: exec_stage.hh:54
@ BusyExec
Definition: exec_stage.hh:55
@ PostExec
Definition: exec_stage.hh:56
DISPATCH_STATUS
Definition: exec_stage.hh:60
@ EXREADY
Definition: exec_stage.hh:62
@ EMPTY
Definition: exec_stage.hh:61
@ SKIP
Definition: exec_stage.hh:63
Declaration of Statistics objects.
statistics::Distribution idleDur
Definition: exec_stage.hh:114
statistics::Scalar numCyclesWithInstrIssued
Definition: exec_stage.hh:110
statistics::Distribution spc
Definition: exec_stage.hh:112
statistics::Scalar numCyclesWithNoIssue
Definition: exec_stage.hh:108
statistics::Scalar numTransActiveIdle
Definition: exec_stage.hh:106
statistics::Vector numCyclesWithNoInstrTypeIssued
Definition: exec_stage.hh:121
statistics::Vector numCyclesWithInstrTypeIssued
Definition: exec_stage.hh:117
ExecStageStats(statistics::Group *parent)
Definition: exec_stage.cc:201

Generated on Wed Dec 21 2022 10:22:35 for gem5 by doxygen 1.9.1