gem5  v22.0.0.1
decode.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 
45 #ifndef __CPU_MINOR_DECODE_HH__
46 #define __CPU_MINOR_DECODE_HH__
47 
48 #include <vector>
49 
50 #include "base/named.hh"
51 #include "cpu/minor/buffers.hh"
52 #include "cpu/minor/cpu.hh"
53 #include "cpu/minor/dyn_inst.hh"
54 #include "cpu/minor/pipe_data.hh"
55 
56 namespace gem5
57 {
58 
60 namespace minor
61 {
62 
63 /* Decode takes instructions from Fetch2 and decomposes them into micro-ops
64  * to feed to Execute. It generates a new sequence number for each
65  * instruction: execSeqNum.
66  */
67 class Decode : public Named
68 {
69  protected:
72 
77 
80 
82  unsigned int outputWidth;
83 
87 
88  public:
89  /* Public for Pipeline to be able to pass it to Fetch2 */
91 
92  protected:
96  {
98 
100  inputIndex(other.inputIndex),
101  inMacroop(other.inMacroop),
102  execSeqNum(other.execSeqNum),
103  blocked(other.blocked)
104  {
105  set(microopPC, other.microopPC);
106  }
107 
108 
111  unsigned int inputIndex = 0;
112 
118  bool inMacroop = false;
119  std::unique_ptr<PCStateBase> microopPC;
120 
123 
125  bool blocked = false;
126  };
127 
130 
131  protected:
133  const ForwardInstData *getInput(ThreadID tid);
134 
136  void popInput(ThreadID tid);
137 
141  public:
142  Decode(const std::string &name,
143  MinorCPU &cpu_,
144  const BaseMinorCPUParams &params,
147  std::vector<InputBuffer<ForwardInstData>> &next_stage_input_buffer);
148 
149  public:
151  void evaluate();
152 
153  void minorTrace() const;
154 
159  bool isDrained();
160 };
161 
162 } // namespace minor
163 } // namespace gem5
164 
165 #endif /* __CPU_MINOR_DECODE_HH__ */
pipe_data.hh
dyn_inst.hh
gem5::minor::Decode::nextStageReserve
std::vector< InputBuffer< ForwardInstData > > & nextStageReserve
Interface to reserve space in the next stage.
Definition: decode.hh:79
gem5::minor::Decode::minorTrace
void minorTrace() const
Definition: decode.cc:342
gem5::minor::Decode::outputWidth
unsigned int outputWidth
Width of output of this stage/input of next in instructions.
Definition: decode.hh:82
gem5::ArmISA::set
Bitfield< 12, 11 > set
Definition: misc_types.hh:703
named.hh
gem5::minor::Decode::DecodeThreadInfo::microopPC
std::unique_ptr< PCStateBase > microopPC
Definition: decode.hh:119
cpu.hh
gem5::minor::Decode::isDrained
bool isDrained()
Is this stage drained? For Decoed, draining is initiated by Execute halting Fetch1 causing Fetch2 to ...
Definition: decode.cc:331
minor
gem5::MinorCPU
MinorCPU is an in-order CPU model with four fixed pipeline stages:
Definition: cpu.hh:85
std::vector
STL vector class.
Definition: stl.hh:37
gem5::minor::ForwardInstData
Forward flowing data between Fetch2,Decode,Execute carrying a packet of instructions of a width appro...
Definition: pipe_data.hh:284
gem5::minor::InputBuffer
Like a Queue but with a restricted interface and a setTail function which, when the queue is empty,...
Definition: buffers.hh:572
gem5::Named
Interface for things with names.
Definition: named.hh:38
gem5::minor::Decode::popInput
void popInput(ThreadID tid)
Pop an element off the input buffer, if there are any.
Definition: decode.cc:99
gem5::minor::Decode::decodeInfo
std::vector< DecodeThreadInfo > decodeInfo
Definition: decode.hh:128
gem5::minor::Latch::Output
Definition: buffers.hh:263
gem5::minor::Decode::DecodeThreadInfo::inMacroop
bool inMacroop
True when we're in the process of decomposing a micro-op and microopPC will be valid.
Definition: decode.hh:118
gem5::Named::name
virtual std::string name() const
Definition: named.hh:47
gem5::minor::Latch::Input
Encapsulate wires on either input or output of the latch.
Definition: buffers.hh:252
gem5::minor::Decode::DecodeThreadInfo::DecodeThreadInfo
DecodeThreadInfo()
Definition: decode.hh:97
gem5::minor::Decode::DecodeThreadInfo::inputIndex
unsigned int inputIndex
Index into the inputBuffer's head marking the start of unhandled instructions.
Definition: decode.hh:111
gem5::minor::InstId::firstExecSeqNum
static const InstSeqNum firstExecSeqNum
Definition: dyn_inst.hh:85
gem5::minor::Decode::evaluate
void evaluate()
Pass on input/buffer data to the output if you can.
Definition: decode.cc:128
gem5::GEM5_DEPRECATED_NAMESPACE
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
gem5::minor::Decode::processMoreThanOneInput
bool processMoreThanOneInput
If true, more than one input word can be processed each cycle if there is room in the output to conta...
Definition: decode.hh:86
gem5::minor::Decode::cpu
MinorCPU & cpu
Pointer back to the containing CPU.
Definition: decode.hh:71
gem5::minor::Decode::threadPriority
ThreadID threadPriority
Definition: decode.hh:129
gem5::minor::Decode::DecodeThreadInfo::execSeqNum
InstSeqNum execSeqNum
Source of execSeqNums to number instructions.
Definition: decode.hh:122
gem5::minor::Decode::DecodeThreadInfo::blocked
bool blocked
Blocked indication for report.
Definition: decode.hh:125
gem5::minor::Decode::getScheduledThread
ThreadID getScheduledThread()
Use the current threading policy to determine the next thread to decode from.
Definition: decode.cc:301
gem5::minor::Decode::out
Latch< ForwardInstData >::Input out
Output port carrying micro-op decomposed instructions to Execute.
Definition: decode.hh:76
gem5::InstSeqNum
uint64_t InstSeqNum
Definition: inst_seq.hh:40
buffers.hh
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::minor::Decode::Decode
Decode(const std::string &name, MinorCPU &cpu_, const BaseMinorCPUParams &params, Latch< ForwardInstData >::Output inp_, Latch< ForwardInstData >::Input out_, std::vector< InputBuffer< ForwardInstData >> &next_stage_input_buffer)
Definition: decode.cc:52
gem5::minor::Decode::DecodeThreadInfo
Data members after this line are cycle-to-cycle state.
Definition: decode.hh:95
gem5::ThreadID
int16_t ThreadID
Thread index/ID type.
Definition: types.hh:235
gem5::minor::Decode
Definition: decode.hh:67
gem5::minor::Decode::inputBuffer
std::vector< InputBuffer< ForwardInstData > > inputBuffer
Definition: decode.hh:90
gem5::minor::Decode::inp
Latch< ForwardInstData >::Output inp
Input port carrying macro instructions from Fetch2.
Definition: decode.hh:74
gem5::minor::Decode::getInput
const ForwardInstData * getInput(ThreadID tid)
Get a piece of data to work on, or 0 if there is no data.
Definition: decode.cc:86
gem5::minor::Decode::DecodeThreadInfo::DecodeThreadInfo
DecodeThreadInfo(const DecodeThreadInfo &other)
Definition: decode.hh:99

Generated on Sat Jun 18 2022 08:12:20 for gem5 by doxygen 1.8.17