gem5  v21.1.0.2
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 
34 #ifndef __EXEC_STAGE_HH__
35 #define __EXEC_STAGE_HH__
36 
37 #include <string>
38 #include <unordered_map>
39 #include <utility>
40 #include <vector>
41 
42 #include "base/statistics.hh"
43 #include "base/stats/group.hh"
44 
45 namespace gem5
46 {
47 
48 class ComputeUnit;
49 class ScheduleToExecute;
50 class Wavefront;
51 
52 struct ComputeUnitParams;
53 
55 {
59 };
60 
62 {
63  EMPTY = 0, // no wave present in dispatchList slot
64  EXREADY, // wave ready for execution
65  SKIP, // extra memory resource needed, Shared Mem. only
66 };
67 
68 // Execution stage.
69 // Each execution resource executes the
70 // wave which is in its dispatch list.
71 // The schedule stage is responsible for
72 // adding a wave into each execution resource's
73 // dispatch list.
74 
75 class ExecStage
76 {
77  public:
78  ExecStage(const ComputeUnitParams &p, ComputeUnit &cu,
79  ScheduleToExecute &from_schedule);
80  ~ExecStage() { }
81  void init();
82  void exec();
83 
84  std::string dispStatusToStr(int j);
85  void dumpDispList();
86 
87  const std::string& name() const { return _name; }
88 
89  private:
90  void collectStatistics(enum STAT_STATUS stage, int unitId);
91  void initStatistics();
94 
99  uint64_t idle_dur;
100  const std::string _name;
101 
102  protected:
104  {
106 
107  // number of transitions from active to idle
109  // number of idle cycles
111  // number of busy cycles
113  // SIMDs active per cycle
115  // duration of idle periods in cycles
117  // number of cycles during which at least one
118  // instruction was issued to an execution resource type
120  // number of idle cycles during which the scheduler
121  // issued no instructions targeting a specific
122  // execution resource type
124  } stats;
125 };
126 
127 } // namespace gem5
128 
129 #endif // __EXEC_STAGE_HH__
gem5::statistics::Scalar
This is a simple scalar statistic, like a counter.
Definition: statistics.hh:1927
gem5::BusyExec
@ BusyExec
Definition: exec_stage.hh:57
gem5::statistics::Distribution
A simple distribution stat.
Definition: statistics.hh:2081
group.hh
gem5::ScheduleToExecute
Communication interface between Schedule and Execute stages.
Definition: comm.hh:100
gem5::ExecStage::thisTimeInstExecuted
bool thisTimeInstExecuted
Definition: exec_stage.hh:96
gem5::ExecStage::ExecStageStats::numCyclesWithNoInstrTypeIssued
statistics::Vector numCyclesWithNoInstrTypeIssued
Definition: exec_stage.hh:123
gem5::SKIP
@ SKIP
Definition: exec_stage.hh:65
gem5::ExecStage::lastTimeInstExecuted
bool lastTimeInstExecuted
Definition: exec_stage.hh:95
gem5::ExecStage
Definition: exec_stage.hh:75
gem5::EXREADY
@ EXREADY
Definition: exec_stage.hh:64
gem5::statistics::Vector
A vector of scalar stats.
Definition: statistics.hh:2003
gem5::ExecStage::stats
gem5::ExecStage::ExecStageStats stats
gem5::ExecStage::ExecStageStats::idleDur
statistics::Distribution idleDur
Definition: exec_stage.hh:116
gem5::ExecStage::~ExecStage
~ExecStage()
Definition: exec_stage.hh:80
gem5::ExecStage::ExecStageStats::numCyclesWithInstrTypeIssued
statistics::Vector numCyclesWithInstrTypeIssued
Definition: exec_stage.hh:119
gem5::ExecStage::executionResourcesUsed
int executionResourcesUsed
Definition: exec_stage.hh:98
gem5::ExecStage::computeUnit
ComputeUnit & computeUnit
Definition: exec_stage.hh:92
gem5::ExecStage::ExecStageStats::spc
statistics::Distribution spc
Definition: exec_stage.hh:114
gem5::ArmISA::j
Bitfield< 24 > j
Definition: misc_types.hh:57
gem5::ComputeUnit
Definition: compute_unit.hh:203
gem5::ExecStage::name
const std::string & name() const
Definition: exec_stage.hh:87
gem5::ExecStage::dispStatusToStr
std::string dispStatusToStr(int j)
Definition: exec_stage.cc:113
gem5::MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:326
statistics.hh
gem5::ExecStage::ExecStageStats::numCyclesWithInstrIssued
statistics::Scalar numCyclesWithInstrIssued
Definition: exec_stage.hh:112
gem5::EMPTY
@ EMPTY
Definition: exec_stage.hh:63
gem5::ExecStage::idle_dur
uint64_t idle_dur
Definition: exec_stage.hh:99
gem5::ExecStage::ExecStage
ExecStage(const ComputeUnitParams &p, ComputeUnit &cu, ScheduleToExecute &from_schedule)
Definition: exec_stage.cc:47
gem5::ExecStage::collectStatistics
void collectStatistics(enum STAT_STATUS stage, int unitId)
Definition: exec_stage.cc:67
gem5::ExecStage::init
void init()
Definition: exec_stage.cc:61
gem5::IdleExec
@ IdleExec
Definition: exec_stage.hh:56
gem5::ExecStage::ExecStageStats
Definition: exec_stage.hh:103
gem5::DISPATCH_STATUS
DISPATCH_STATUS
Definition: exec_stage.hh:61
gem5::ExecStage::fromSchedule
ScheduleToExecute & fromSchedule
Definition: exec_stage.hh:93
gem5::ExecStage::_name
const std::string _name
Definition: exec_stage.hh:100
gem5::ExecStage::ExecStageStats::ExecStageStats
ExecStageStats(statistics::Group *parent)
Definition: exec_stage.cc:203
gem5::STAT_STATUS
STAT_STATUS
Definition: exec_stage.hh:54
gem5::ExecStage::ExecStageStats::numCyclesWithNoIssue
statistics::Scalar numCyclesWithNoIssue
Definition: exec_stage.hh:110
gem5::ExecStage::initStatistics
void initStatistics()
Definition: exec_stage.cc:105
gem5::ExecStage::ExecStageStats::numTransActiveIdle
statistics::Scalar numTransActiveIdle
Definition: exec_stage.hh:108
gem5::statistics::Group
Statistics container.
Definition: group.hh:93
gem5::PostExec
@ PostExec
Definition: exec_stage.hh:58
gem5::ExecStage::exec
void exec()
Definition: exec_stage.cc:154
gem5::ExecStage::dumpDispList
void dumpDispList()
Definition: exec_stage.cc:131
gem5::ExecStage::instrExecuted
bool instrExecuted
Definition: exec_stage.hh:97
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40

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