gem5 v24.0.0.0
Loading...
Searching...
No Matches
tme64.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020-2021 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
39
40#include <sstream>
41
42#include "debug/ArmTme.hh"
43
44namespace gem5
45{
46
47using namespace ArmISA;
48
49namespace ArmISAInst {
50
51std::string
53 Addr pc, const loader::SymbolTable *symtab) const
54{
55 std::stringstream ss;
56 printMnemonic(ss, "", false);
57 ccprintf(ss, "#0x%x", imm);
58 return ss.str();
59}
60
61std::string
63 Addr pc, const loader::SymbolTable *symtab) const
64{
65 std::stringstream ss;
68 return ss.str();
69}
70
71std::string
73 Addr pc, const loader::SymbolTable *symtab) const
74{
75 std::stringstream ss;
77 return ss.str();
78}
79
81 : MicroTmeBasic64("utfence", machInst, MemReadOp)
82{
83 _numSrcRegs = 0;
84 _numDestRegs = 0;
85 flags[IsMicroop] = true;
86 flags[IsReadBarrier] = true;
87 flags[IsWriteBarrier] = true;
88}
89
92 ExecContext *xc, trace::InstRecord *traceData) const
93{
94 return NoFault;
95}
96
99 trace::InstRecord *traceData) const
100{
101 panic("tfence should not have memory semantics");
102
103 return NoFault;
104}
105
106Fault
108 trace::InstRecord *traceData) const
109{
110 panic("tfence should not have memory semantics");
111
112 return NoFault;
113}
114
116 : TmeRegNone64("tstart", machInst, MemReadOp, _dest)
117{
119 nullptr,
120 reinterpret_cast<RegIdArrayPtr>(
121 &std::remove_pointer_t<decltype(this)>::destRegIdxArr));
122 ;
123
124 _numSrcRegs = 0;
125 _numDestRegs = 0;
128 flags[IsHtmStart] = true;
129 flags[IsInteger] = true;
130 flags[IsLoad] = true;
131 flags[IsMicroop] = true;
132 flags[IsNonSpeculative] = true;
133}
134
135Fault
137 ExecContext *xc, trace::InstRecord *traceData) const
138{
139 panic("TME is not supported with atomic memory");
140
141 return NoFault;
142}
143
145 : TmeRegNone64("ttest", machInst, MemReadOp, _dest)
146{
148 nullptr,
149 reinterpret_cast<RegIdArrayPtr>(
150 &std::remove_pointer_t<decltype(this)>::destRegIdxArr));
151 ;
152
153 _numSrcRegs = 0;
154 _numDestRegs = 0;
157 flags[IsInteger] = true;
158 flags[IsMicroop] = true;
159}
160
161Tcancel64::Tcancel64(ExtMachInst machInst, uint64_t _imm)
162 : TmeImmOp64("tcancel", machInst, MemReadOp, _imm)
163{
164 _numSrcRegs = 0;
165 _numDestRegs = 0;
166 flags[IsLoad] = true;
167 flags[IsMicroop] = true;
168 flags[IsNonSpeculative] = true;
169 flags[IsHtmCancel] = true;
170}
171
172Fault
174 ExecContext *xc, trace::InstRecord *traceData) const
175{
176 panic("TME is not supported with atomic memory");
177
178 return NoFault;
179}
180
181MacroTmeOp::MacroTmeOp(const char *mnem,
182 ExtMachInst _machInst,
183 OpClass __opClass) :
184 PredMacroOp(mnem, machInst, __opClass) {
185 _numSrcRegs = 0;
186 _numDestRegs = 0;
187
188 numMicroops = 0;
189 microOps = nullptr;
190}
191
193 : MicroTmeBasic64("utcommit", machInst, MemReadOp)
194{
195 _numSrcRegs = 0;
196 _numDestRegs = 0;
197 flags[IsHtmStop] = true;
198 flags[IsLoad] = true;
199 flags[IsMicroop] = true;
200 flags[IsNonSpeculative] = true;
201}
202
203Fault
205{
206 panic("TME is not supported with atomic memory");
207
208 return NoFault;
209}
210
212 MacroTmeOp("tcommit", machInst, MemReadOp)
213{
214 numMicroops = 2;
216
217 microOps[0] = new ArmISAInst::MicroTfence64(_machInst);
220
221 microOps[1] = new ArmISAInst::MicroTcommit64(_machInst);
224}
225
226} // namespace ArmISAInst
227} // namespace gem5
MacroTmeOp(const char *mnem, ArmISA::ExtMachInst _machInst, OpClass __opClass)
Definition tme64.cc:181
Fault execute(ExecContext *, trace::InstRecord *) const
Definition tme64.cc:204
MicroTcommit64(ArmISA::ExtMachInst)
Definition tme64.cc:192
Fault execute(ExecContext *, trace::InstRecord *) const
Definition tme64.cc:91
MicroTfence64(ArmISA::ExtMachInst)
Definition tme64.cc:80
Fault completeAcc(PacketPtr, ExecContext *, trace::InstRecord *) const
Definition tme64.cc:107
Fault initiateAcc(ExecContext *, trace::InstRecord *) const
Definition tme64.cc:98
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const
Internal function to generate disassembly string.
Definition tme64.cc:72
Fault execute(ExecContext *, trace::InstRecord *) const
Definition tme64.cc:173
Tcancel64(ArmISA::ExtMachInst, uint64_t)
Definition tme64.cc:161
Tcommit64(ArmISA::ExtMachInst _machInst)
Definition tme64.cc:211
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const
Internal function to generate disassembly string.
Definition tme64.cc:52
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const
Internal function to generate disassembly string.
Definition tme64.cc:62
Fault execute(ExecContext *, trace::InstRecord *) const
Definition tme64.cc:136
Tstart64(ArmISA::ExtMachInst, RegIndex)
Definition tme64.cc:115
Ttest64(ArmISA::ExtMachInst, RegIndex)
Definition tme64.cc:144
void printMnemonic(std::ostream &os, const std::string &suffix="", bool withPred=true, bool withCond64=false, ConditionCode cond64=COND_UC) const
void printIntReg(std::ostream &os, RegIndex reg_idx, uint8_t opWidth=0) const
Print a register name for disassembly given the unique dependence tag number (FP or int).
Base class for predicated macro-operations.
Definition pred_inst.hh:343
StaticInstPtr * microOps
Definition pred_inst.hh:347
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition packet.hh:295
void setDestRegIdx(int i, const RegId &val)
void setRegIdxArrays(RegIdArrayPtr src, RegIdArrayPtr dest)
Set the pointers which point to the arrays of source and destination register indices.
std::array< uint8_t, MiscRegClass+1 > _numTypedDestRegs
RegId(StaticInst::*)[] RegIdArrayPtr
uint8_t _numSrcRegs
See numSrcRegs().
uint8_t _numDestRegs
See numDestRegs().
std::bitset< Num_Flags > flags
Flag values for this instruction.
#define panic(...)
This implements a cprintf based panic() function.
Definition logging.hh:188
constexpr RegClass intRegClass
Definition int.hh:173
Bitfield< 21 > ss
Definition misc_types.hh:60
Bitfield< 4 > pc
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
uint16_t RegIndex
Definition types.hh:176
std::shared_ptr< FaultBase > Fault
Definition types.hh:249
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
constexpr decltype(nullptr) NoFault
Definition types.hh:253
@ IntRegClass
Integer register.
Definition reg_class.hh:61
void ccprintf(cp::Print &print)
Definition cprintf.hh:130
static const OpClass MemReadOp
Definition op_class.hh:107

Generated on Tue Jun 18 2024 16:23:56 for gem5 by doxygen 1.11.0