gem5  v20.1.0.0
tme64.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 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 
38  #include "arch/arm/insts/tme64.hh"
39  #include "debug/ArmTme.hh"
40 
41  #include <sstream>
42 
43 using namespace ArmISA;
44 
45 namespace ArmISAInst {
46 
47 std::string
48 TmeImmOp64::generateDisassembly(
49  Addr pc, const Loader::SymbolTable *symtab) const
50 {
51  std::stringstream ss;
52  printMnemonic(ss, "", false);
53  ccprintf(ss, "#0x%x", imm);
54  return ss.str();
55 }
56 
57 std::string
58 TmeRegNone64::generateDisassembly(
59  Addr pc, const Loader::SymbolTable *symtab) const
60 {
61  std::stringstream ss;
62  printMnemonic(ss);
63  printIntReg(ss, dest);
64  return ss.str();
65 }
66 
67 std::string
68 MicroTmeBasic64::generateDisassembly(
69  Addr pc, const Loader::SymbolTable *symtab) const
70 {
71  std::stringstream ss;
72  printMnemonic(ss);
73  return ss.str();
74 }
75 
76 MicroTfence64::MicroTfence64(ExtMachInst machInst)
77  : MicroTmeBasic64("utfence", machInst, MemReadOp)
78 {
79  _numSrcRegs = 0;
80  _numDestRegs = 0;
81  _numFPDestRegs = 0;
82  _numVecDestRegs = 0;
84  _numIntDestRegs = 0;
85  _numCCDestRegs = 0;
86  flags[IsMemBarrier] = true;
87  flags[IsMicroop] = true;
88  flags[IsReadBarrier] = true;
89  flags[IsWriteBarrier] = true;
90 }
91 
92 Fault
94  ExecContext *xc, Trace::InstRecord *traceData) const
95 {
96  return NoFault;
97 }
98 
99 Fault
101  Trace::InstRecord *traceData) const
102 {
103  panic("tfence should not have memory semantics");
104 
105  return NoFault;
106 }
107 
108 Fault
110  Trace::InstRecord *traceData) const
111 {
112  panic("tfence should not have memory semantics");
113 
114  return NoFault;
115 }
116 
118  : TmeRegNone64("tstart", machInst, MemReadOp, _dest)
119 {
120  _numSrcRegs = 0;
121  _numDestRegs = 0;
122  _numFPDestRegs = 0;
123  _numVecDestRegs = 0;
125  _numIntDestRegs = 0;
126  _numCCDestRegs = 0;
128  _numIntDestRegs++;
129  flags[IsHtmStart] = true;
130  flags[IsInteger] = true;
131  flags[IsLoad] = true;
132  flags[IsMemRef] = true;
133  flags[IsMicroop] = true;
134  flags[IsNonSpeculative] = true;
135 }
136 
137 Fault
139  ExecContext *xc, Trace::InstRecord *traceData) const
140 {
141  panic("TME is not supported with atomic memory");
142 
143  return NoFault;
144 }
145 
147  : TmeRegNone64("ttest", machInst, MemReadOp, _dest)
148 {
149  _numSrcRegs = 0;
150  _numDestRegs = 0;
151  _numFPDestRegs = 0;
152  _numVecDestRegs = 0;
154  _numIntDestRegs = 0;
155  _numCCDestRegs = 0;
157  _numIntDestRegs++;
158  flags[IsInteger] = true;
159  flags[IsMicroop] = true;
160 }
161 
162 Tcancel64::Tcancel64(ExtMachInst machInst, uint64_t _imm)
163  : TmeImmOp64("tcancel", machInst, MemReadOp, _imm)
164 {
165  _numSrcRegs = 0;
166  _numDestRegs = 0;
167  _numFPDestRegs = 0;
168  _numVecDestRegs = 0;
170  _numIntDestRegs = 0;
171  _numCCDestRegs = 0;
172  flags[IsLoad] = true;
173  flags[IsMemRef] = true;
174  flags[IsMicroop] = true;
175  flags[IsNonSpeculative] = true;
176  flags[IsHtmCancel] = true;
177 }
178 
179 Fault
181  ExecContext *xc, Trace::InstRecord *traceData) const
182 {
183  panic("TME is not supported with atomic memory");
184 
185  return NoFault;
186 }
187 
188 MacroTmeOp::MacroTmeOp(const char *mnem,
189  ExtMachInst _machInst,
190  OpClass __opClass) :
191  PredMacroOp(mnem, machInst, __opClass) {
192  _numSrcRegs = 0;
193  _numDestRegs = 0;
194  _numFPDestRegs = 0;
195  _numVecDestRegs = 0;
197  _numIntDestRegs = 0;
198  _numCCDestRegs = 0;
199 
200  numMicroops = 0;
201  microOps = nullptr;
202 }
203 
205  : MicroTmeBasic64("utcommit", machInst, MemReadOp)
206 {
207  _numSrcRegs = 0;
208  _numDestRegs = 0;
209  _numFPDestRegs = 0;
210  _numVecDestRegs = 0;
212  _numIntDestRegs = 0;
213  _numCCDestRegs = 0;
214  flags[IsHtmStop] = true;
215  flags[IsLoad] = true;
216  flags[IsMemRef] = true;
217  flags[IsMicroop] = true;
218  flags[IsNonSpeculative] = true;
219 }
220 
221 Fault
223 {
224  panic("TME is not supported with atomic memory");
225 
226  return NoFault;
227 }
228 
230  MacroTmeOp("tcommit", machInst, MemReadOp)
231 {
232  numMicroops = 2;
234 
235  microOps[0] = new ArmISAInst::MicroTfence64(_machInst);
238 
239  microOps[1] = new ArmISAInst::MicroTcommit64(_machInst);
241  microOps[1]->setLastMicroop();
242 }
243 
244 } // namespace
ArmISAInst::TmeImmOp64
Definition: tme64.hh:68
StaticInst::_numIntDestRegs
int8_t _numIntDestRegs
Definition: static_inst.hh:114
StaticInst::_numVecDestRegs
int8_t _numVecDestRegs
To use in architectures with vector register file.
Definition: static_inst.hh:120
StaticInst::flags
std::bitset< Num_Flags > flags
Flag values for this instruction.
Definition: static_inst.hh:99
MemReadOp
static const OpClass MemReadOp
Definition: op_class.hh:99
ArmISAInst::Tcancel64::Tcancel64
Tcancel64(ArmISA::ExtMachInst, uint64_t)
Definition: tme64.cc:162
ArmISAInst::MicroTcommit64::MicroTcommit64
MicroTcommit64(ArmISA::ExtMachInst)
Definition: tme64.cc:204
ArmISAInst::MicroTfence64
Definition: tme64.hh:126
Loader::SymbolTable
Definition: symtab.hh:59
ArmISA::IntRegIndex
IntRegIndex
Definition: intregs.hh:51
Trace::InstRecord
Definition: insttracer.hh:55
ArmISAInst::MicroTfence64::completeAcc
Fault completeAcc(PacketPtr, ExecContext *, Trace::InstRecord *) const
Definition: tme64.cc:109
ArmISAInst::Tcommit64::Tcommit64
Tcommit64(ArmISA::ExtMachInst _machInst)
Definition: tme64.cc:229
tme64.hh
ArmISA
Definition: ccregs.hh:41
RegId
Register ID: describe an architectural register with its class and index.
Definition: reg_class.hh:75
ArmISAInst::MicroTfence64::initiateAcc
Fault initiateAcc(ExecContext *, Trace::InstRecord *) const
Definition: tme64.cc:100
StaticInst::_numVecElemDestRegs
int8_t _numVecElemDestRegs
Definition: static_inst.hh:121
StaticInst::setDelayedCommit
void setDelayedCommit()
Definition: static_inst.hh:221
ArmISAInst::MicroTcommit64
Definition: tme64.hh:136
ArmISAInst::MicroTmeBasic64
Definition: tme64.hh:56
ArmISA::ss
Bitfield< 21 > ss
Definition: miscregs_types.hh:56
ArmISAInst::Tstart64::Tstart64
Tstart64(ArmISA::ExtMachInst, ArmISA::IntRegIndex)
Definition: tme64.cc:117
ArmISA::imm
Bitfield< 7, 0 > imm
Definition: types.hh:141
ArmISAInst::TmeRegNone64::dest
ArmISA::IntRegIndex dest
Definition: tme64.hh:86
Fault
std::shared_ptr< FaultBase > Fault
Definition: types.hh:240
MipsISA::pc
Bitfield< 4 > pc
Definition: pra_constants.hh:240
ArmISAInst::TmeRegNone64
Definition: tme64.hh:83
StaticInst::_numCCDestRegs
int8_t _numCCDestRegs
Definition: static_inst.hh:115
ArmISAInst
Definition: tme64.cc:45
StaticInst::_destRegIdx
RegId _destRegIdx[MaxInstDestRegs]
See destRegIdx().
Definition: static_inst.hh:248
ArmISAInst::MicroTfence64::execute
Fault execute(ExecContext *, Trace::InstRecord *) const
Definition: tme64.cc:93
ExecContext
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
Definition: exec_context.hh:70
ArmISA::PredMacroOp
Base class for predicated macro-operations.
Definition: pred_inst.hh:336
StaticInst::ExtMachInst
TheISA::ExtMachInst ExtMachInst
Binary extended machine instruction type.
Definition: static_inst.hh:89
NoFault
constexpr decltype(nullptr) NoFault
Definition: types.hh:245
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
ArmISAInst::MacroTmeOp
Definition: tme64.hh:147
ArmISAInst::MacroTmeOp::MacroTmeOp
MacroTmeOp(const char *mnem, ArmISA::ExtMachInst _machInst, OpClass __opClass)
Definition: tme64.cc:188
IntRegClass
@ IntRegClass
Integer register.
Definition: reg_class.hh:53
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:257
ccprintf
void ccprintf(cp::Print &print)
Definition: cprintf.hh:127
ArmISAInst::Tstart64::execute
Fault execute(ExecContext *, Trace::InstRecord *) const
Definition: tme64.cc:138
ArmISAInst::MicroTcommit64::execute
Fault execute(ExecContext *, Trace::InstRecord *) const
Definition: tme64.cc:222
StaticInst::_numSrcRegs
int8_t _numSrcRegs
See numSrcRegs().
Definition: static_inst.hh:105
StaticInst::setFirstMicroop
void setFirstMicroop()
Definition: static_inst.hh:219
ArmISA::PredMacroOp::numMicroops
uint32_t numMicroops
Definition: pred_inst.hh:340
RefCountingPtr< StaticInst >
StaticInst::_numFPDestRegs
int8_t _numFPDestRegs
The following are used to track physical register usage for machines with separate int & FP reg files...
Definition: static_inst.hh:113
ArmISAInst::Tcancel64::execute
Fault execute(ExecContext *, Trace::InstRecord *) const
Definition: tme64.cc:180
StaticInst::setLastMicroop
void setLastMicroop()
Definition: static_inst.hh:220
StaticInst::_numDestRegs
int8_t _numDestRegs
See numDestRegs().
Definition: static_inst.hh:108
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:171
ArmISAInst::Ttest64::Ttest64
Ttest64(ArmISA::ExtMachInst, ArmISA::IntRegIndex)
Definition: tme64.cc:146
ArmISA::PredMacroOp::microOps
StaticInstPtr * microOps
Definition: pred_inst.hh:341

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