gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
mem.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009 The University of Edinburgh
3  * Copyright (c) 2021 IBM Corporation
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met: redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer;
10  * redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution;
13  * neither the name of the copyright holders nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #ifndef __ARCH_POWER_MEM_HH__
31 #define __ARCH_POWER_MEM_HH__
32 
34 
35 namespace gem5
36 {
37 
38 namespace PowerISA
39 {
40 
44 class MemOp : public PowerStaticInst
45 {
46  protected:
47 
49  unsigned memAccessFlags;
50 
52  MemOp(const char *mnem, MachInst _machInst, OpClass __opClass)
53  : PowerStaticInst(mnem, _machInst, __opClass),
55  {
56  }
57 
58  std::string generateDisassembly(
59  Addr pc, const loader::SymbolTable *symtab) const override;
60 };
61 
62 
66 class MemDispOp : public MemOp
67 {
68  protected:
69 
70  int64_t d;
71 
73  MemDispOp(const char *mnem, MachInst _machInst, OpClass __opClass)
74  : MemOp(mnem, _machInst, __opClass),
75  d(sext<16>(machInst.d))
76  {
77  }
78 
79  std::string generateDisassembly(
80  Addr pc, const loader::SymbolTable *symtab) const override;
81 };
82 
86 class MemDispShiftOp : public MemOp
87 {
88  protected:
89 
90  int64_t ds;
91 
93  MemDispShiftOp(const char *mnem, MachInst _machInst, OpClass __opClass)
94  : MemOp(mnem, _machInst, __opClass),
95  ds(sext<14>(machInst.ds))
96  {
97  }
98 
99  std::string generateDisassembly(
100  Addr pc, const loader::SymbolTable *symtab) const override;
101 };
102 
103 
107 class MemIndexOp : public MemOp
108 {
109  protected:
110 
112  MemIndexOp(const char *mnem, MachInst _machInst, OpClass __opClass)
113  : MemOp(mnem, _machInst, __opClass)
114  {
115  }
116 
117  std::string generateDisassembly(
118  Addr pc, const loader::SymbolTable *symtab) const override;
119 };
120 
121 } // namespace PowerISA
122 } // namespace gem5
123 
124 #endif //__ARCH_POWER_INSTS_MEM_HH__
gem5::PowerISA::PowerStaticInst::machInst
ExtMachInst machInst
Definition: static_inst.hh:47
gem5::PowerISA::MemDispShiftOp
Class for memory operations with shifted displacement.
Definition: mem.hh:86
gem5::PowerISA::MemDispOp::generateDisassembly
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition: mem.cc:47
gem5::PowerISA::MemDispShiftOp::MemDispShiftOp
MemDispShiftOp(const char *mnem, MachInst _machInst, OpClass __opClass)
Constructor.
Definition: mem.hh:93
gem5::PowerISA::MemDispShiftOp::ds
int64_t ds
Definition: mem.hh:90
gem5::sext
constexpr uint64_t sext(uint64_t val)
Sign-extend an N-bit value to 64 bits.
Definition: bitfield.hh:126
gem5::PowerISA::MemDispOp
Class for memory operations with displacement.
Definition: mem.hh:66
gem5::loader::SymbolTable
Definition: symtab.hh:64
gem5::PowerISA::MemOp
Base class for memory operations.
Definition: mem.hh:44
gem5::PowerISA::MemDispOp::MemDispOp
MemDispOp(const char *mnem, MachInst _machInst, OpClass __opClass)
Constructor.
Definition: mem.hh:73
gem5::PowerISA::MemOp::generateDisassembly
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition: mem.cc:40
gem5::PowerISA::MemIndexOp
Class for memory operations with register indexed addressing.
Definition: mem.hh:107
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::PowerISA::MemIndexOp::generateDisassembly
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition: mem.cc:166
gem5::PowerISA::MemOp::MemOp
MemOp(const char *mnem, MachInst _machInst, OpClass __opClass)
Constructor.
Definition: mem.hh:52
gem5::PowerISA::MachInst
uint32_t MachInst
Definition: types.hh:44
gem5::MipsISA::pc
Bitfield< 4 > pc
Definition: pra_constants.hh:243
gem5::PowerISA::MemIndexOp::MemIndexOp
MemIndexOp(const char *mnem, MachInst _machInst, OpClass __opClass)
Constructor.
Definition: mem.hh:112
gem5::PowerISA::MemDispOp::d
int64_t d
Definition: mem.hh:70
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
static_inst.hh
gem5::PowerISA::PowerStaticInst
Definition: static_inst.hh:44
gem5::PowerISA::MemOp::memAccessFlags
unsigned memAccessFlags
Memory request flags. See mem_req_base.hh.
Definition: mem.hh:49
gem5::PowerISA::MemDispShiftOp::generateDisassembly
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition: mem.cc:107

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