gem5  v22.0.0.1
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 {
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__
gem5::statistics::Scalar
This is a simple scalar statistic, like a counter.
Definition: statistics.hh:1930
gem5::BusyExec
@ BusyExec
Definition: exec_stage.hh:55
gem5::statistics::Distribution
A simple distribution stat.
Definition: statistics.hh:2084
group.hh
gem5::ScheduleToExecute
Communication interface between Schedule and Execute stages.
Definition: comm.hh:98
gem5::ExecStage::thisTimeInstExecuted
bool thisTimeInstExecuted
Definition: exec_stage.hh:94
gem5::ExecStage::ExecStageStats::numCyclesWithNoInstrTypeIssued
statistics::Vector numCyclesWithNoInstrTypeIssued
Definition: exec_stage.hh:121
gem5::SKIP
@ SKIP
Definition: exec_stage.hh:63
gem5::ExecStage::lastTimeInstExecuted
bool lastTimeInstExecuted
Definition: exec_stage.hh:93
gem5::ExecStage
Definition: exec_stage.hh:73
gem5::EXREADY
@ EXREADY
Definition: exec_stage.hh:62
gem5::statistics::Vector
A vector of scalar stats.
Definition: statistics.hh:2006
gem5::ExecStage::stats
gem5::ExecStage::ExecStageStats stats
gem5::ExecStage::ExecStageStats::idleDur
statistics::Distribution idleDur
Definition: exec_stage.hh:114
gem5::ExecStage::~ExecStage
~ExecStage()
Definition: exec_stage.hh:78
gem5::ExecStage::ExecStageStats::numCyclesWithInstrTypeIssued
statistics::Vector numCyclesWithInstrTypeIssued
Definition: exec_stage.hh:117
gem5::ExecStage::executionResourcesUsed
int executionResourcesUsed
Definition: exec_stage.hh:96
gem5::ExecStage::computeUnit
ComputeUnit & computeUnit
Definition: exec_stage.hh:90
gem5::ExecStage::ExecStageStats::spc
statistics::Distribution spc
Definition: exec_stage.hh:112
gem5::ArmISA::j
Bitfield< 24 > j
Definition: misc_types.hh:57
gem5::ComputeUnit
Definition: compute_unit.hh:201
gem5::ExecStage::name
const std::string & name() const
Definition: exec_stage.hh:85
gem5::ExecStage::dispStatusToStr
std::string dispStatusToStr(int j)
Definition: exec_stage.cc:111
gem5::VegaISA::p
Bitfield< 54 > p
Definition: pagetable.hh:70
statistics.hh
gem5::ExecStage::ExecStageStats::numCyclesWithInstrIssued
statistics::Scalar numCyclesWithInstrIssued
Definition: exec_stage.hh:110
gem5::EMPTY
@ EMPTY
Definition: exec_stage.hh:61
gem5::ExecStage::idle_dur
uint64_t idle_dur
Definition: exec_stage.hh:97
gem5::ExecStage::ExecStage
ExecStage(const ComputeUnitParams &p, ComputeUnit &cu, ScheduleToExecute &from_schedule)
Definition: exec_stage.cc:45
gem5::ExecStage::collectStatistics
void collectStatistics(enum STAT_STATUS stage, int unitId)
Definition: exec_stage.cc:65
gem5::ExecStage::init
void init()
Definition: exec_stage.cc:59
gem5::IdleExec
@ IdleExec
Definition: exec_stage.hh:54
gem5::ExecStage::ExecStageStats
Definition: exec_stage.hh:101
gem5::DISPATCH_STATUS
DISPATCH_STATUS
Definition: exec_stage.hh:59
gem5::ExecStage::fromSchedule
ScheduleToExecute & fromSchedule
Definition: exec_stage.hh:91
gem5::ExecStage::_name
const std::string _name
Definition: exec_stage.hh:98
gem5::ExecStage::ExecStageStats::ExecStageStats
ExecStageStats(statistics::Group *parent)
Definition: exec_stage.cc:201
gem5::STAT_STATUS
STAT_STATUS
Definition: exec_stage.hh:52
gem5::ExecStage::ExecStageStats::numCyclesWithNoIssue
statistics::Scalar numCyclesWithNoIssue
Definition: exec_stage.hh:108
gem5::ExecStage::initStatistics
void initStatistics()
Definition: exec_stage.cc:103
gem5::ExecStage::ExecStageStats::numTransActiveIdle
statistics::Scalar numTransActiveIdle
Definition: exec_stage.hh:106
gem5::statistics::Group
Statistics container.
Definition: group.hh:93
gem5::PostExec
@ PostExec
Definition: exec_stage.hh:56
gem5::ExecStage::exec
void exec()
Definition: exec_stage.cc:152
gem5::ExecStage::dumpDispList
void dumpDispList()
Definition: exec_stage.cc:129
gem5::ExecStage::instrExecuted
bool instrExecuted
Definition: exec_stage.hh:95
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37

Generated on Sat Jun 18 2022 08:12:26 for gem5 by doxygen 1.8.17