gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 
38 #include "arch/arm/insts/mem64.hh"
39 
40 #include "arch/arm/tlb.hh"
41 #include "base/loader/symtab.hh"
42 #include "mem/request.hh"
43 
44 namespace gem5
45 {
46 
47 namespace ArmISA
48 {
49 
50 std::string
52 {
53  std::stringstream ss;
54  printMnemonic(ss, "", false);
55  ccprintf(ss, ", ");
57  return ss.str();
58 }
59 
60 
61 uint32_t
62 SysDC64::iss() const
63 {
64  const MiscRegNum64 &misc_reg = encodeAArch64SysReg(dest);
65  return _iss(misc_reg, base);
66 }
67 
68 void
69 Memory64::startDisassembly(std::ostream &os) const
70 {
71  printMnemonic(os, "", false);
74  }else{
76  }
77  ccprintf(os, ", [");
79 }
80 
81 void
82 Memory64::setExcAcRel(bool exclusive, bool acrel)
83 {
84  if (exclusive)
86  else
88  if (acrel) {
89  flags[IsWriteBarrier] = true;
90  flags[IsReadBarrier] = true;
91  }
92 }
93 
94 std::string
96  Addr pc, const loader::SymbolTable *symtab) const
97 {
98  std::stringstream ss;
100  if (imm)
101  ccprintf(ss, ", #%d", imm);
102  ccprintf(ss, "]");
103  return ss.str();
104 }
105 
106 std::string
108  Addr pc, const loader::SymbolTable *symtab) const
109 {
110  std::stringstream ss;
111  printMnemonic(ss, "", false);
112  printIntReg(ss, dest);
113  ccprintf(ss, ", ");
114  printIntReg(ss, dest2);
115  ccprintf(ss, ", [");
116  printIntReg(ss, base);
117  if (imm)
118  ccprintf(ss, ", #%d", imm);
119  ccprintf(ss, "]");
120  return ss.str();
121 }
122 
123 std::string
125  Addr pc, const loader::SymbolTable *symtab) const
126 {
127  std::stringstream ss;
128  printMnemonic(ss, "", false);
130  ccprintf(ss, ", ");
131  printIntReg(ss, dest);
132  ccprintf(ss, ", ");
133  printIntReg(ss, dest2);
134  ccprintf(ss, ", [");
135  printIntReg(ss, base);
136  if (imm)
137  ccprintf(ss, ", #%d", imm);
138  ccprintf(ss, "]");
139  return ss.str();
140 }
141 
142 std::string
144  Addr pc, const loader::SymbolTable *symtab) const
145 {
146  std::stringstream ss;
148  ccprintf(ss, ", #%d]!", imm);
149  return ss.str();
150 }
151 
152 std::string
154  Addr pc, const loader::SymbolTable *symtab) const
155 {
156  std::stringstream ss;
158  if (imm)
159  ccprintf(ss, "], #%d", imm);
160  ccprintf(ss, "]");
161  return ss.str();
162 }
163 
164 std::string
166  Addr pc, const loader::SymbolTable *symtab) const
167 {
168  std::stringstream ss;
171  ccprintf(ss, "]");
172  return ss.str();
173 }
174 
175 std::string
177  Addr pc, const loader::SymbolTable *symtab) const
178 {
179  std::stringstream ss;
181  ccprintf(ss, "]");
182  return ss.str();
183 }
184 
185 std::string
187  Addr pc, const loader::SymbolTable *symtab) const
188 {
189  std::stringstream ss;
190  printMnemonic(ss, "", false);
191  printIntReg(ss, dest);
192  ccprintf(ss, ", ");
194  ccprintf(ss, ", [");
195  printIntReg(ss, base);
196  ccprintf(ss, "]");
197  return ss.str();
198 }
199 
200 std::string
202  Addr pc, const loader::SymbolTable *symtab) const
203 {
204  std::stringstream ss;
205  printMnemonic(ss, "", false);
206  printIntReg(ss, dest);
207  ccprintf(ss, ", #%d", pc + imm);
208  return ss.str();
209 }
210 
211 std::string
213  Addr pc, const loader::SymbolTable *symtab) const
214 {
215  std::stringstream ss;
216  printMnemonic(ss, "", false);
218  ccprintf(ss, ", ");
220  ccprintf(ss, ", ");
221  printIntReg(ss, dest);
222  ccprintf(ss, ", ");
223  printIntReg(ss, dest2);
224  ccprintf(ss, ", [");
225  printIntReg(ss, base);
226  ccprintf(ss, "]");
227  return ss.str();
228 }
229 
230 } // namespace ArmISA
231 } // namespace gem5
gem5::ArmISA::Memory64::dest
RegIndex dest
Definition: mem64.hh:120
gem5::ArmISA::SysDC64::dest
MiscRegIndex dest
Definition: mem64.hh:56
gem5::ArmISA::MemoryDImmEx64::generateDisassembly
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition: mem64.cc:124
gem5::ArmISA::MemoryAtomicPair64::generateDisassembly
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition: mem64.cc:212
gem5::ArmISA::Memory64::setExcAcRel
void setExcAcRel(bool exclusive, bool acrel)
Definition: mem64.cc:82
gem5::ArmISA::MemoryReg64::offset
RegIndex offset
Definition: mem64.hh:231
gem5::ArmISA::SysDC64::iss
uint32_t iss() const override
Definition: mem64.cc:62
gem5::ArmISA::MemoryLiteral64::imm
int64_t imm
Definition: mem64.hh:277
gem5::ArmISA::MemoryDImm64::generateDisassembly
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition: mem64.cc:107
gem5::MiscRegOp64::_iss
uint32_t _iss(const ArmISA::MiscRegNum64 &misc_reg, RegIndex int_index) const
Definition: misc64.cc:114
gem5::ArmISA::ArmStaticInst::printMnemonic
void printMnemonic(std::ostream &os, const std::string &suffix="", bool withPred=true, bool withCond64=false, ConditionCode cond64=COND_UC) const
Definition: static_inst.cc:377
gem5::ArmISA::Memory64::base
RegIndex base
Definition: mem64.hh:121
gem5::loader::SymbolTable
Definition: symtab.hh:64
gem5::ArmISA::MemoryAtomicPair64::result
RegIndex result
Definition: mem64.hh:292
tlb.hh
gem5::ArmISA::MMU::AllowUnaligned
@ AllowUnaligned
Definition: mmu.hh:109
gem5::ArmISA::MemoryPostIndex64::generateDisassembly
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition: mem64.cc:153
request.hh
gem5::ccprintf
void ccprintf(cp::Print &print)
Definition: cprintf.hh:130
gem5::ArmISA::SysDC64::generateDisassembly
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition: mem64.cc:51
gem5::ArmISA::MemoryImm64::imm
int64_t imm
Definition: mem64.hh:159
gem5::ArmISA::MemoryReg64::generateDisassembly
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition: mem64.cc:165
gem5::ArmISA::MemoryRaw64::generateDisassembly
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition: mem64.cc:176
gem5::ArmISA::MemoryDImmEx64::result
RegIndex result
Definition: mem64.hh:189
gem5::ArmISA::MemoryAtomicPair64::dest2
RegIndex dest2
Definition: mem64.hh:291
gem5::StaticInst::isDataPrefetch
bool isDataPrefetch() const
Definition: static_inst.hh:151
gem5::Request::LLSC
@ LLSC
The request is a Load locked/store conditional.
Definition: request.hh:156
mem64.hh
gem5::ArmISA::MemoryAtomicPair64::result2
RegIndex result2
Definition: mem64.hh:293
gem5::StaticInst::flags
std::bitset< Num_Flags > flags
Flag values for this instruction.
Definition: static_inst.hh:102
gem5::ArmISA::Memory64::startDisassembly
void startDisassembly(std::ostream &os) const
Definition: mem64.cc:69
gem5::ArmISA::MemoryReg64::type
ArmExtendType type
Definition: mem64.hh:232
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::ArmISA::encodeAArch64SysReg
MiscRegNum64 encodeAArch64SysReg(MiscRegIndex misc_reg)
Definition: misc.cc:2188
gem5::ArmISA::MemoryPreIndex64::generateDisassembly
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition: mem64.cc:143
gem5::ArmISA::MemoryEx64::generateDisassembly
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition: mem64.cc:186
gem5::ArmISA::MiscRegNum64
Definition: misc.hh:1688
gem5::ArmISA::MemoryEx64::result
RegIndex result
Definition: mem64.hh:262
gem5::StaticInst::isInstPrefetch
bool isInstPrefetch() const
Definition: static_inst.hh:150
gem5::X86ISA::os
Bitfield< 17 > os
Definition: misc.hh:810
gem5::ArmISA::ss
Bitfield< 21 > ss
Definition: misc_types.hh:60
gem5::MipsISA::pc
Bitfield< 4 > pc
Definition: pra_constants.hh:243
gem5::ArmISA::ArmStaticInst::printExtendOperand
void printExtendOperand(bool firstOperand, std::ostream &os, RegIndex rm, ArmExtendType type, int64_t shiftAmt) const
Definition: static_inst.cc:562
gem5::ArmISA::SysDC64::base
RegIndex base
Definition: mem64.hh:55
gem5::ArmISA::MemoryDImm64::dest2
RegIndex dest2
Definition: mem64.hh:173
gem5::ArmISA::MemoryReg64::shiftAmt
uint64_t shiftAmt
Definition: mem64.hh:233
symtab.hh
gem5::ArmISA::ArmStaticInst::printIntReg
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).
Definition: static_inst.cc:299
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::ArmISA::MemoryLiteral64::generateDisassembly
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition: mem64.cc:201
gem5::ArmISA::MemoryImm64::generateDisassembly
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition: mem64.cc:95
gem5::ArmISA::Memory64::memAccessFlags
unsigned memAccessFlags
Definition: mem64.hh:151
gem5::ArmISA::ArmStaticInst::printPFflags
void printPFflags(std::ostream &os, int flag) const
Definition: static_inst.cc:334

Generated on Sun Jul 30 2023 01:56:48 for gem5 by doxygen 1.8.17