gem5  v20.1.0.0
pipeline.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2014, 2017 ARM Limited
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions are
16  * met: redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer;
18  * redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution;
21  * neither the name of the copyright holders nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  */
37 
45 #ifndef __CPU_MINOR_PIPELINE_HH__
46 #define __CPU_MINOR_PIPELINE_HH__
47 
48 #include "cpu/minor/activity.hh"
49 #include "cpu/minor/cpu.hh"
50 #include "cpu/minor/decode.hh"
51 #include "cpu/minor/execute.hh"
52 #include "cpu/minor/fetch1.hh"
53 #include "cpu/minor/fetch2.hh"
54 #include "params/MinorCPU.hh"
55 #include "sim/ticked_object.hh"
56 
57 namespace Minor
58 {
59 
69 class Pipeline : public Ticked
70 {
71  protected:
73 
76 
82 
87 
92 
93  public:
95  enum StageId
96  {
97  /* A stage representing wakeup of the whole processor */
99  /* Real pipeline stages */
101  Num_StageId /* Stage count */
102  };
103 
106 
107  public:
108  Pipeline(MinorCPU &cpu_, MinorCPUParams &params);
109 
110  public:
113  void wakeupFetch(ThreadID tid);
114 
116  bool drain();
117 
118  void drainResume();
119 
121  bool isDrained();
122 
125  void evaluate() override;
126 
127  void minorTrace() const;
128 
136 
139 };
140 
141 }
142 
143 #endif /* __CPU_MINOR_PIPELINE_HH__ */
Minor::Pipeline::getDataPort
MinorCPU::MinorCPUPort & getDataPort()
Return the DcachePort belonging to Execute for the CPU.
Definition: pipeline.cc:183
Minor::Pipeline::getActivityRecorder
MinorActivityRecorder * getActivityRecorder()
To give the activity recorder to the CPU.
Definition: pipeline.hh:138
Minor::Pipeline::activityRecorder
MinorActivityRecorder activityRecorder
Activity recording for the pipeline.
Definition: pipeline.hh:91
Minor::Fetch2
This stage receives lines of data from Fetch1, separates them into instructions and passes them to De...
Definition: fetch2.hh:59
ThreadID
int16_t ThreadID
Thread index/ID type.
Definition: types.hh:227
Minor::Pipeline::StageId
StageId
Enumerated ids of the 'stages' for the activity recorder.
Definition: pipeline.hh:95
Minor::Pipeline::drain
bool drain()
Try to drain the CPU.
Definition: pipeline.cc:195
Minor::Pipeline::isDrained
bool isDrained()
Test to see if the CPU is drained.
Definition: pipeline.cc:223
Minor::Pipeline::f1ToF2
Latch< ForwardLineData > f1ToF2
Definition: pipeline.hh:77
Minor::Pipeline::ExecuteStageId
@ ExecuteStageId
Definition: pipeline.hh:100
Minor::Pipeline::Fetch2StageId
@ Fetch2StageId
Definition: pipeline.hh:100
Minor::Latch
Wraps a MinorBuffer with Input/Output interfaces to ensure that units within the model can only see t...
Definition: buffers.hh:215
cpu.hh
Minor::Pipeline::needToSignalDrained
bool needToSignalDrained
True after drain is called but draining isn't complete.
Definition: pipeline.hh:105
Minor::Pipeline::f2ToD
Latch< ForwardInstData > f2ToD
Definition: pipeline.hh:79
Minor
Definition: activity.cc:44
execute.hh
Minor::Fetch1
A stage responsible for fetching "lines" from memory and passing them to Fetch2.
Definition: fetch1.hh:59
Minor::Pipeline::Num_StageId
@ Num_StageId
Definition: pipeline.hh:101
fetch2.hh
Minor::MinorActivityRecorder
ActivityRecorder with a Ticked interface.
Definition: activity.hh:54
decode.hh
Minor::Pipeline::f2ToF1
Latch< BranchData > f2ToF1
Definition: pipeline.hh:78
Minor::Decode
Definition: decode.hh:60
Minor::Pipeline::allow_idling
bool allow_idling
Allow cycles to be skipped when the pipeline is idle.
Definition: pipeline.hh:75
Minor::Pipeline::execute
Execute execute
Definition: pipeline.hh:83
MinorCPU
MinorCPU is an in-order CPU model with four fixed pipeline stages:
Definition: cpu.hh:77
Minor::Pipeline
The constructed pipeline.
Definition: pipeline.hh:69
Ticked
Ticked attaches gem5's event queue/scheduler to evaluate calls and provides a start/stop interface to...
Definition: ticked_object.hh:58
Minor::Pipeline::Pipeline
Pipeline(MinorCPU &cpu_, MinorCPUParams &params)
Definition: pipeline.cc:54
Minor::Pipeline::DecodeStageId
@ DecodeStageId
Definition: pipeline.hh:100
Minor::Pipeline::eToF1
Latch< BranchData > eToF1
Definition: pipeline.hh:81
MinorCPU::MinorCPUPort
Provide a non-protected base class for Minor's Ports as derived classes are created by Fetch1 and Exe...
Definition: cpu.hh:98
Minor::Pipeline::dToE
Latch< ForwardInstData > dToE
Definition: pipeline.hh:80
Minor::Pipeline::Fetch1StageId
@ Fetch1StageId
Definition: pipeline.hh:100
Minor::Pipeline::CPUStageId
@ CPUStageId
Definition: pipeline.hh:98
Minor::Pipeline::minorTrace
void minorTrace() const
Definition: pipeline.cc:107
Minor::Pipeline::cpu
MinorCPU & cpu
Definition: pipeline.hh:72
ticked_object.hh
Minor::Pipeline::evaluate
void evaluate() override
A custom evaluate allows report in the right place (between stages and pipeline advance)
Definition: pipeline.cc:122
Minor::Pipeline::wakeupFetch
void wakeupFetch(ThreadID tid)
Wake up the Fetch unit.
Definition: pipeline.cc:189
Minor::Pipeline::fetch1
Fetch1 fetch1
Definition: pipeline.hh:86
Minor::Pipeline::drainResume
void drainResume()
Definition: pipeline.cc:211
Minor::Pipeline::decode
Decode decode
Definition: pipeline.hh:84
activity.hh
Minor::Execute
Execute stage.
Definition: execute.hh:60
fetch1.hh
Minor::Pipeline::getInstPort
MinorCPU::MinorCPUPort & getInstPort()
Functions below here are BaseCPU operations passed on to pipeline stages.
Definition: pipeline.cc:177
Minor::Pipeline::fetch2
Fetch2 fetch2
Definition: pipeline.hh:85

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