gem5 [DEVELOP-FOR-25.1]
Loading...
Searching...
No Matches
mem64.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011-2013,2018, 2021-2022 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 "arch/arm/tlb.hh"
41#include "base/loader/symtab.hh"
42#include "mem/request.hh"
43
44namespace gem5
45{
46
47namespace ArmISA
48{
49
50std::string
52{
53 std::stringstream ss;
54 ss << " " << mnemonic << ", ";
56 return ss.str();
57}
58
59
60uint32_t
62{
63 const auto misc_reg = encodeAArch64SysReg(dest);
64 return _iss(misc_reg.value(), base);
65}
66
67void
68Memory64::startDisassembly(std::ostream &os) const
69{
70 printMnemonic(os, "", false);
73 }else{
75 }
76 ccprintf(os, ", [");
78}
79
80void
81Memory64::setExcAcRel(bool exclusive, bool acrel)
82{
83 if (exclusive)
85 else
87 if (acrel) {
88 flags[IsWriteBarrier] = true;
89 flags[IsReadBarrier] = true;
90 }
91}
92
93std::string
95 Addr pc, const loader::SymbolTable *symtab) const
96{
97 std::stringstream ss;
99 if (imm)
100 ccprintf(ss, ", #%d", imm);
101 ccprintf(ss, "]");
102 return ss.str();
103}
104
105std::string
107 Addr pc, const loader::SymbolTable *symtab) const
108{
109 std::stringstream ss;
110 printMnemonic(ss, "", false);
112 ccprintf(ss, ", ");
114 ccprintf(ss, ", [");
116 if (imm)
117 ccprintf(ss, ", #%d", imm);
118 ccprintf(ss, "]");
119 return ss.str();
120}
121
122std::string
124 Addr pc, const loader::SymbolTable *symtab) const
125{
126 std::stringstream ss;
127 printMnemonic(ss, "", false);
129 ccprintf(ss, ", ");
131 ccprintf(ss, ", ");
133 ccprintf(ss, ", [");
135 if (imm)
136 ccprintf(ss, ", #%d", imm);
137 ccprintf(ss, "]");
138 return ss.str();
139}
140
141std::string
143 Addr pc, const loader::SymbolTable *symtab) const
144{
145 std::stringstream ss;
147 ccprintf(ss, ", #%d]!", imm);
148 return ss.str();
149}
150
151std::string
153 Addr pc, const loader::SymbolTable *symtab) const
154{
155 std::stringstream ss;
157 ccprintf(ss, "]");
158 if (imm)
159 ccprintf(ss, ", #%d", imm);
160 return ss.str();
161}
162
163std::string
165 Addr pc, const loader::SymbolTable *symtab) const
166{
167 std::stringstream ss;
170 ccprintf(ss, "]");
171 return ss.str();
172}
173
174std::string
176 Addr pc, const loader::SymbolTable *symtab) const
177{
178 std::stringstream ss;
180 ccprintf(ss, "]");
181 return ss.str();
182}
183
184std::string
186 Addr pc, const loader::SymbolTable *symtab) const
187{
188 std::stringstream ss;
189 printMnemonic(ss, "", false);
191 ccprintf(ss, ", ");
193 ccprintf(ss, ", [");
195 ccprintf(ss, "]");
196 return ss.str();
197}
198
199std::string
201 Addr pc, const loader::SymbolTable *symtab) const
202{
203 std::stringstream ss;
204 printMnemonic(ss, "", false);
206 ccprintf(ss, ", #%d", pc + imm);
207 return ss.str();
208}
209
210std::string
212 Addr pc, const loader::SymbolTable *symtab) const
213{
214 std::stringstream ss;
215 printMnemonic(ss, "", false);
217 ccprintf(ss, ", ");
219 ccprintf(ss, ", ");
221 ccprintf(ss, ", ");
223 ccprintf(ss, ", [");
225 ccprintf(ss, "]");
226 return ss.str();
227}
228
229} // namespace ArmISA
230} // namespace gem5
void printExtendOperand(bool firstOperand, std::ostream &os, RegIndex rm, ArmExtendType type, int64_t shiftAmt) const
void printMnemonic(std::ostream &os, const std::string &suffix="", bool withPred=true, bool withCond64=false, ConditionCode cond64=COND_UC) const
void printPFflags(std::ostream &os, int flag) 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).
void setExcAcRel(bool exclusive, bool acrel)
Definition mem64.cc:81
unsigned memAccessFlags
Definition mem64.hh:151
void startDisassembly(std::ostream &os) const
Definition mem64.cc:68
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition mem64.cc:211
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition mem64.cc:106
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition mem64.cc:123
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition mem64.cc:185
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition mem64.cc:94
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition mem64.cc:200
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition mem64.cc:152
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition mem64.cc:142
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition mem64.cc:175
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition mem64.cc:164
ArmExtendType type
Definition mem64.hh:232
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition mem64.cc:51
MiscRegIndex dest
Definition mem64.hh:56
uint32_t iss() const override
Definition mem64.cc:61
uint32_t _iss(const ArmISA::MiscRegNum64 &misc_reg, RegIndex int_index) const
Definition misc64.cc:115
@ LLSC
The request is a Load locked/store conditional.
Definition request.hh:156
bool isDataPrefetch() const
bool isInstPrefetch() const
const char * mnemonic
Base mnemonic (e.g., "add").
std::bitset< Num_Flags > flags
Flag values for this instruction.
std::optional< MiscRegNum64 > encodeAArch64SysReg(MiscRegIndex misc_reg)
Definition misc.cc:2981
Bitfield< 21 > ss
Definition misc_types.hh:60
Bitfield< 4 > pc
Bitfield< 17 > os
Definition misc.hh:838
Copyright (c) 2024 Arm Limited All rights reserved.
Definition binary32.hh:36
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
void ccprintf(cp::Print &print)
Definition cprintf.hh:130
Declaration of a request, the overall memory request consisting of the parts of the request that are ...

Generated on Mon Oct 27 2025 04:12:54 for gem5 by doxygen 1.14.0