gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pipeline.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2014 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  * Authors: Andrew Bardsley
38  */
39 
47 #ifndef __CPU_MINOR_PIPELINE_HH__
48 #define __CPU_MINOR_PIPELINE_HH__
49 
50 #include "cpu/minor/activity.hh"
51 #include "cpu/minor/cpu.hh"
52 #include "cpu/minor/decode.hh"
53 #include "cpu/minor/execute.hh"
54 #include "cpu/minor/fetch1.hh"
55 #include "cpu/minor/fetch2.hh"
56 #include "params/MinorCPU.hh"
57 #include "sim/ticked_object.hh"
58 
59 namespace Minor
60 {
61 
71 class Pipeline : public Ticked
72 {
73  protected:
75 
78 
84 
89 
94 
95  public:
97  enum StageId
98  {
99  /* A stage representing wakeup of the whole processor */
101  /* Real pipeline stages */
103  Num_StageId /* Stage count */
104  };
105 
108 
109  public:
110  Pipeline(MinorCPU &cpu_, MinorCPUParams &params);
111 
112  public:
115  void wakeupFetch(ThreadID tid);
116 
118  bool drain();
119 
120  void drainResume();
121 
123  bool isDrained();
124 
127  void evaluate() override;
128 
129  void countCycles(Cycles delta) override
130  {
131  cpu.ppCycles->notify(delta);
132  }
133 
134  void minorTrace() const;
135 
143 
146 };
147 
148 }
149 
150 #endif /* __CPU_MINOR_PIPELINE_HH__ */
void drainResume()
Definition: pipeline.cc:213
Execute stage.
Definition: execute.hh:62
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:83
Top level definition of the Minor in-order CPU model.
Latch< ForwardInstData > f2ToD
Definition: pipeline.hh:81
Latch< BranchData > f2ToF1
Definition: pipeline.hh:80
All the fun of executing instructions from Decode and sending branch/new instruction stream info...
ActivityRecoder from cpu/activity.h wrapped to provide evaluate and minorTrace.
ActivityRecorder with a Ticked interface.
Definition: activity.hh:56
MinorCPU::MinorCPUPort & getInstPort()
Functions below here are BaseCPU operations passed on to pipeline stages.
Definition: pipeline.cc:179
Fetch2 receives lines of data from Fetch1, separates them into instructions and passes them to Decode...
MinorActivityRecorder * getActivityRecorder()
To give the activity recorder to the CPU.
Definition: pipeline.hh:145
MinorCPU::MinorCPUPort & getDataPort()
Return the DcachePort belonging to Execute for the CPU.
Definition: pipeline.cc:185
Latch< ForwardInstData > dToE
Definition: pipeline.hh:82
Latch< BranchData > eToF1
Definition: pipeline.hh:83
bool isDrained()
Test to see if the CPU is drained.
Definition: pipeline.cc:225
Latch< ForwardLineData > f1ToF2
Definition: pipeline.hh:79
Execute execute
Definition: pipeline.hh:85
Decode collects macro-ops from Fetch2 and splits them into micro-ops passed to Execute.
MinorActivityRecorder activityRecorder
Activity recording for the pipeline.
Definition: pipeline.hh:93
Ticked attaches gem5's event queue/scheduler to evaluate calls and provides a start/stop interface to...
Provide a non-protected base class for Minor's Ports as derived classes are created by Fetch1 and Exe...
Definition: cpu.hh:100
bool needToSignalDrained
True after drain is called but draining isn't complete.
Definition: pipeline.hh:107
bool drain()
Try to drain the CPU.
Definition: pipeline.cc:197
This stage receives lines of data from Fetch1, separates them into instructions and passes them to De...
Definition: fetch2.hh:61
StageId
Enumerated ids of the 'stages' for the activity recorder.
Definition: pipeline.hh:97
MinorCPU & cpu
Definition: pipeline.hh:74
A stage responsible for fetching "lines" from memory and passing them to Fetch2.
Definition: fetch1.hh:61
Decode decode
Definition: pipeline.hh:86
void countCycles(Cycles delta) override
Callback to handle cycle statistics and probes.
Definition: pipeline.hh:129
Fetch1 is responsible for fetching "lines" from memory and passing them to Fetch2.
void wakeupFetch(ThreadID tid)
Wake up the Fetch unit.
Definition: pipeline.cc:191
int16_t ThreadID
Thread index/ID type.
Definition: types.hh:171
Base classes for ClockedObjects which have evaluate functions to look like clock ticking operations...
Pipeline(MinorCPU &cpu_, MinorCPUParams &params)
Definition: pipeline.cc:56
bool allow_idling
Allow cycles to be skipped when the pipeline is idle.
Definition: pipeline.hh:77
Fetch2 fetch2
Definition: pipeline.hh:87
Wraps a MinorBuffer with Input/Output interfaces to ensure that units within the model can only see t...
Definition: buffers.hh:213
MinorCPU is an in-order CPU model with four fixed pipeline stages:
Definition: cpu.hh:79
void evaluate() override
A custom evaluate allows report in the right place (between stages and pipeline advance) ...
Definition: pipeline.cc:124
void minorTrace() const
Definition: pipeline.cc:109
Fetch1 fetch1
Definition: pipeline.hh:88
The constructed pipeline.
Definition: pipeline.hh:71

Generated on Fri Jun 9 2017 13:03:42 for gem5 by doxygen 1.8.6