gem5  v20.1.0.0
comm.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 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: Anthony Gutierrez
34  */
35 
36 #ifndef __GPU_COMPUTE_COMM_HH__
37 #define __GPU_COMPUTE_COMM_HH__
38 
39 #include <array>
40 #include <vector>
41 
43 #include "gpu-compute/misc.hh"
44 
45 struct ComputeUnitParams;
46 class Wavefront;
47 
49 {
50  public:
57  virtual void reset() = 0;
58 };
59 
64 {
65  public:
66  ScoreboardCheckToSchedule() = delete;
67  ScoreboardCheckToSchedule(const ComputeUnitParams *p);
68  void reset() override;
73  void markWFReady(Wavefront *wf, int func_unit_id);
79  int numReadyLists() const;
87  std::vector<Wavefront*>& readyWFs(int func_unit_id);
88 
89  // TODO: Leftover from old CU code, needs to go away.
90  void updateReadyList(int func_unit_id);
91 
92  private:
94 };
95 
100 {
101  public:
102  ScheduleToExecute() = delete;
103  ScheduleToExecute(const ComputeUnitParams *p);
104  void reset() override;
105  GPUDynInstPtr& readyInst(int func_unit_id);
113  void dispatchTransition(const GPUDynInstPtr &gpu_dyn_inst,
114  int func_unit_id, DISPATCH_STATUS disp_status);
115  void dispatchTransition(int func_unit_id, DISPATCH_STATUS disp_status);
116  DISPATCH_STATUS dispatchStatus(int func_unit_id) const;
117 
118  private:
121 };
122 
123 #endif // __GPU_COMPUTE_COMM_HH__
ScoreboardCheckToSchedule::ScoreboardCheckToSchedule
ScoreboardCheckToSchedule()=delete
ScheduleToExecute::reset
void reset() override
Reset the pipe stage interface.
Definition: comm.cc:116
PipeStageIFace
Definition: comm.hh:48
ScheduleToExecute::readyInst
GPUDynInstPtr & readyInst(int func_unit_id)
Definition: comm.cc:128
misc.hh
ScoreboardCheckToSchedule::reset
void reset() override
Reset the pipe stage interface.
Definition: comm.cc:60
ScheduleToExecute::_readyInsts
std::vector< GPUDynInstPtr > _readyInsts
Definition: comm.hh:119
ScheduleToExecute::dispatchStatus
DISPATCH_STATUS dispatchStatus(int func_unit_id) const
Definition: comm.cc:151
std::vector< Wavefront * >
ScoreboardCheckToSchedule::_readyWFs
std::vector< std::vector< Wavefront * > > _readyWFs
Definition: comm.hh:93
ScoreboardCheckToSchedule::markWFReady
void markWFReady(Wavefront *wf, int func_unit_id)
Mark the WF as ready for execution on a particular functional unit.
Definition: comm.cc:68
ScoreboardCheckToSchedule::updateReadyList
void updateReadyList(int func_unit_id)
Delete all wavefronts that have been marked as ready at scoreboard stage but are found to have empty ...
Definition: comm.cc:90
ScheduleToExecute::_dispatchStatus
std::vector< DISPATCH_STATUS > _dispatchStatus
Definition: comm.hh:120
ScheduleToExecute::dispatchTransition
void dispatchTransition(const GPUDynInstPtr &gpu_dyn_inst, int func_unit_id, DISPATCH_STATUS disp_status)
Once the scheduler has chosen a winning WF for execution, and after the WF's oldest instruction's ope...
Definition: comm.cc:134
ScheduleToExecute
Communication interface between Schedule and Execute stages.
Definition: comm.hh:99
ScoreboardCheckToSchedule
Communication interface between ScoreboardCheck and Schedule stages.
Definition: comm.hh:63
Wavefront
Definition: wavefront.hh:57
GPUDynInstPtr
std::shared_ptr< GPUDynInst > GPUDynInstPtr
Definition: misc.hh:48
ScoreboardCheckToSchedule::readyWFs
std::vector< Wavefront * > & readyWFs(int func_unit_id)
TODO: These methods expose this class' implementation too much by returning references to its interna...
Definition: comm.cc:80
ScheduleToExecute::ScheduleToExecute
ScheduleToExecute()=delete
ScoreboardCheckToSchedule::numReadyLists
int numReadyLists() const
Returns the number of ready lists (i.e., the number of functional units).
Definition: comm.cc:74
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
PipeStageIFace::reset
virtual void reset()=0
Reset the pipe stage interface.
DISPATCH_STATUS
DISPATCH_STATUS
Definition: exec_stage.hh:57
exec_stage.hh

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