gem5  v20.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  * 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 "sim/stats.hh"
43 
44 class ComputeUnit;
45 class ScheduleToExecute;
46 class Wavefront;
47 
48 struct ComputeUnitParams;
49 
51 {
55 };
56 
58 {
59  EMPTY = 0, // no wave present in dispatchList slot
60  EXREADY, // wave ready for execution
61  SKIP, // extra memory resource needed, Shared Mem. only
62 };
63 
64 // Execution stage.
65 // Each execution resource executes the
66 // wave which is in its dispatch list.
67 // The schedule stage is responsible for
68 // adding a wave into each execution resource's
69 // dispatch list.
70 
71 class ExecStage
72 {
73  public:
74  ExecStage(const ComputeUnitParams* p, ComputeUnit &cu,
75  ScheduleToExecute &from_schedule);
76  ~ExecStage() { }
77  void init();
78  void exec();
79 
80  std::string dispStatusToStr(int j);
81  void dumpDispList();
82 
83  const std::string& name() const { return _name; }
84  void regStats();
85  // number of idle cycles
87  // number of busy cycles
89  // number of cycles during which at least one
90  // instruction was issued to an execution resource type
92  // number of idle cycles during which the scheduler
93  // issued no instructions targeting a specific
94  // execution resource type
96  // SIMDs active per cycle
98 
99  private:
100  void collectStatistics(enum STAT_STATUS stage, int unitId);
101  void initStatistics();
104 
111  uint64_t idle_dur;
112  const std::string _name;
113 };
114 
115 #endif // __EXEC_STAGE_HH__
ExecStage::~ExecStage
~ExecStage()
Definition: exec_stage.hh:76
ExecStage
Definition: exec_stage.hh:71
STAT_STATUS
STAT_STATUS
Definition: exec_stage.hh:50
ExecStage::thisTimeInstExecuted
bool thisTimeInstExecuted
Definition: exec_stage.hh:106
ExecStage::collectStatistics
void collectStatistics(enum STAT_STATUS stage, int unitId)
Definition: exec_stage.cc:63
EMPTY
@ EMPTY
Definition: exec_stage.hh:59
ExecStage::idle_dur
uint64_t idle_dur
Definition: exec_stage.hh:111
ExecStage::numCyclesWithInstrIssued
Stats::Scalar numCyclesWithInstrIssued
Definition: exec_stage.hh:88
ExecStage::dispStatusToStr
std::string dispStatusToStr(int j)
Definition: exec_stage.cc:109
ExecStage::init
void init()
Definition: exec_stage.cc:57
ExecStage::exec
void exec()
Definition: exec_stage.cc:150
ExecStage::idleDur
Stats::Distribution idleDur
Definition: exec_stage.hh:109
ExecStage::initStatistics
void initStatistics()
Definition: exec_stage.cc:101
Stats::Vector
A vector of scalar stats.
Definition: statistics.hh:2575
ExecStage::lastTimeInstExecuted
bool lastTimeInstExecuted
Definition: exec_stage.hh:105
SKIP
@ SKIP
Definition: exec_stage.hh:61
Stats::Scalar
This is a simple scalar statistic, like a counter.
Definition: statistics.hh:2533
ComputeUnit
Definition: compute_unit.hh:198
stats.hh
ArmISA::j
Bitfield< 24 > j
Definition: miscregs_types.hh:54
ScheduleToExecute
Communication interface between Schedule and Execute stages.
Definition: comm.hh:99
ExecStage::numCyclesWithInstrTypeIssued
Stats::Vector numCyclesWithInstrTypeIssued
Definition: exec_stage.hh:91
BusyExec
@ BusyExec
Definition: exec_stage.hh:53
ExecStage::_name
const std::string _name
Definition: exec_stage.hh:112
ExecStage::ExecStage
ExecStage(const ComputeUnitParams *p, ComputeUnit &cu, ScheduleToExecute &from_schedule)
Definition: exec_stage.cc:44
ExecStage::fromSchedule
ScheduleToExecute & fromSchedule
Definition: exec_stage.hh:103
Stats::Distribution
A simple distribution stat.
Definition: statistics.hh:2617
EXREADY
@ EXREADY
Definition: exec_stage.hh:60
ExecStage::numCyclesWithNoInstrTypeIssued
Stats::Vector numCyclesWithNoInstrTypeIssued
Definition: exec_stage.hh:95
ExecStage::numCyclesWithNoIssue
Stats::Scalar numCyclesWithNoIssue
Definition: exec_stage.hh:86
ExecStage::executionResourcesUsed
int executionResourcesUsed
Definition: exec_stage.hh:110
IdleExec
@ IdleExec
Definition: exec_stage.hh:52
ExecStage::spc
Stats::Distribution spc
Definition: exec_stage.hh:97
Wavefront
Definition: wavefront.hh:57
PostExec
@ PostExec
Definition: exec_stage.hh:54
ExecStage::name
const std::string & name() const
Definition: exec_stage.hh:83
ExecStage::instrExecuted
bool instrExecuted
Definition: exec_stage.hh:107
ExecStage::dumpDispList
void dumpDispList()
Definition: exec_stage.cc:127
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
DISPATCH_STATUS
DISPATCH_STATUS
Definition: exec_stage.hh:57
ExecStage::computeUnit
ComputeUnit & computeUnit
Definition: exec_stage.hh:102
ExecStage::numTransActiveIdle
Stats::Scalar numTransActiveIdle
Definition: exec_stage.hh:108
ExecStage::regStats
void regStats()
Definition: exec_stage.cc:200

Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17