gem5 v24.0.0.0
Loading...
Searching...
No Matches
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/BaseMinorCPU.hh"
55#include "sim/ticked_object.hh"
56
57namespace gem5
58{
59
60namespace minor
61{
62
72class Pipeline : public Ticked
73{
74 protected:
76
79
85
90
95
96 public:
99 {
100 /* A stage representing wakeup of the whole processor */
102 /* Real pipeline stages */
104 Num_StageId /* Stage count */
105 };
106
109
110 public:
111 Pipeline(MinorCPU &cpu_, const BaseMinorCPUParams &params);
112
113 public:
116 void wakeupFetch(ThreadID tid);
117
119 bool drain();
120
121 void drainResume();
122
124 bool isDrained();
125
128 void evaluate() override;
129
130 void minorTrace() const;
131
139
142};
143
144} // namespace minor
145} // namespace gem5
146
147#endif /* __CPU_MINOR_PIPELINE_HH__ */
Provide a non-protected base class for Minor's Ports as derived classes are created by Fetch1 and Exe...
Definition cpu.hh:106
MinorCPU is an in-order CPU model with four fixed pipeline stages:
Definition cpu.hh:85
Ticked attaches gem5's event queue/scheduler to evaluate calls and provides a start/stop interface to...
Execute stage.
Definition execute.hh:68
A stage responsible for fetching "lines" from memory and passing them to Fetch2.
Definition fetch1.hh:67
This stage receives lines of data from Fetch1, separates them into instructions and passes them to De...
Definition fetch2.hh:66
Wraps a MinorBuffer with Input/Output interfaces to ensure that units within the model can only see t...
Definition buffers.hh:222
ActivityRecorder with a Ticked interface.
Definition activity.hh:58
The constructed pipeline.
Definition pipeline.hh:73
Latch< BranchData > f2ToF1
Definition pipeline.hh:81
Pipeline(MinorCPU &cpu_, const BaseMinorCPUParams &params)
Definition pipeline.cc:57
Latch< ForwardLineData > f1ToF2
Definition pipeline.hh:80
void minorTrace() const
Definition pipeline.cc:110
MinorActivityRecorder * getActivityRecorder()
To give the activity recorder to the CPU.
Definition pipeline.hh:141
MinorCPU::MinorCPUPort & getDataPort()
Return the DcachePort belonging to Execute for the CPU.
Definition pipeline.cc:189
bool allow_idling
Allow cycles to be skipped when the pipeline is idle.
Definition pipeline.hh:78
bool needToSignalDrained
True after drain is called but draining isn't complete.
Definition pipeline.hh:108
MinorActivityRecorder activityRecorder
Activity recording for the pipeline.
Definition pipeline.hh:94
void evaluate() override
A custom evaluate allows report in the right place (between stages and pipeline advance)
Definition pipeline.cc:125
MinorCPU::MinorCPUPort & getInstPort()
Functions below here are BaseCPU operations passed on to pipeline stages.
Definition pipeline.cc:183
void wakeupFetch(ThreadID tid)
Wake up the Fetch unit.
Definition pipeline.cc:195
StageId
Enumerated ids of the 'stages' for the activity recorder.
Definition pipeline.hh:99
Latch< BranchData > eToF1
Definition pipeline.hh:84
Latch< ForwardInstData > dToE
Definition pipeline.hh:83
bool drain()
Try to drain the CPU.
Definition pipeline.cc:201
Latch< ForwardInstData > f2ToD
Definition pipeline.hh:82
bool isDrained()
Test to see if the CPU is drained.
Definition pipeline.cc:229
Top level definition of the Minor in-order CPU model.
All the fun of executing instructions from Decode and sending branch/new instruction stream info.
Fetch1 is responsible for fetching "lines" from memory and passing them to Fetch2.
Fetch2 receives lines of data from Fetch1, separates them into instructions and passes them to Decode...
ActivityRecoder from cpu/activity.h wrapped to provide evaluate and minorTrace.
Decode collects macro-ops from Fetch2 and splits them into micro-ops passed to Execute.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
int16_t ThreadID
Thread index/ID type.
Definition types.hh:235
Minor contains all the definitions within the MinorCPU apart from the CPU class itself.
Base classes for ClockedObjects which have evaluate functions to look like clock ticking operations.

Generated on Tue Jun 18 2024 16:24:01 for gem5 by doxygen 1.11.0