amo.isa (12236:126ac9da6050) | amo.isa (12323:55d08b81ff39) |
---|---|
1// -*- mode:c++ -*- 2 3// Copyright (c) 2015 Riscv Developers 4// Copyright (c) 2016 The University of Virginia 5// All rights reserved. 6// 7// Redistribution and use in source and binary forms, with or without 8// modification, are permitted provided that the following conditions are --- 19 unchanged lines hidden (view full) --- 28// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29// 30// Authors: Alec Roelke 31 32//////////////////////////////////////////////////////////////////// 33// 34// Atomic memory operation instructions 35// | 1// -*- mode:c++ -*- 2 3// Copyright (c) 2015 Riscv Developers 4// Copyright (c) 2016 The University of Virginia 5// All rights reserved. 6// 7// Redistribution and use in source and binary forms, with or without 8// modification, are permitted provided that the following conditions are --- 19 unchanged lines hidden (view full) --- 28// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29// 30// Authors: Alec Roelke 31 32//////////////////////////////////////////////////////////////////// 33// 34// Atomic memory operation instructions 35// |
36output header {{ 37 class LoadReserved : public RiscvStaticInst 38 { 39 protected: 40 Request::Flags memAccessFlags; 41 42 LoadReserved(const char *mnem, ExtMachInst _machInst, 43 OpClass __opClass) 44 : RiscvStaticInst(mnem, _machInst, __opClass) 45 {} 46 47 std::string 48 generateDisassembly(Addr pc, const SymbolTable *symtab) const; 49 }; 50 51 class StoreCond : public RiscvStaticInst 52 { 53 protected: 54 Request::Flags memAccessFlags; 55 56 StoreCond(const char* mnem, ExtMachInst _machInst, OpClass __opClass) 57 : RiscvStaticInst(mnem, _machInst, __opClass) 58 {} 59 60 std::string 61 generateDisassembly(Addr pc, const SymbolTable *symtab) const; 62 }; 63 64 class AtomicMemOp : public RiscvMacroInst 65 { 66 protected: 67 /// Constructor 68 // Each AtomicMemOp has a load and a store phase 69 AtomicMemOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass) 70 : RiscvMacroInst(mnem, _machInst, __opClass) 71 {} 72 73 std::string generateDisassembly(Addr pc, 74 const SymbolTable *symtab) const; 75 }; 76 77 class AtomicMemOpMicro : public RiscvMicroInst 78 { 79 protected: 80 /// Memory request flags. See mem/request.hh. 81 Request::Flags memAccessFlags; 82 83 /// Constructor 84 AtomicMemOpMicro(const char *mnem, ExtMachInst _machInst, 85 OpClass __opClass) 86 : RiscvMicroInst(mnem, _machInst, __opClass) 87 {} 88 89 std::string generateDisassembly(Addr pc, 90 const SymbolTable *symtab) const; 91 }; 92}}; 93 94output decoder {{ 95 std::string LoadReserved::generateDisassembly(Addr pc, 96 const SymbolTable *symtab) const 97 { 98 std::stringstream ss; 99 ss << mnemonic << ' ' << registerName(_destRegIdx[0]) << ", (" 100 << registerName(_srcRegIdx[0]) << ')'; 101 return ss.str(); 102 } 103 104 std::string StoreCond::generateDisassembly(Addr pc, 105 const SymbolTable *symtab) const 106 { 107 std::stringstream ss; 108 ss << mnemonic << ' ' << registerName(_destRegIdx[0]) << ", " 109 << registerName(_srcRegIdx[1]) << ", (" 110 << registerName(_srcRegIdx[0]) << ')'; 111 return ss.str(); 112 } 113 114 std::string AtomicMemOp::generateDisassembly(Addr pc, 115 const SymbolTable *symtab) const 116 { 117 std::stringstream ss; 118 ss << mnemonic << ' ' << registerName(_destRegIdx[0]) << ", " 119 << registerName(_srcRegIdx[1]) << ", (" 120 << registerName(_srcRegIdx[0]) << ')'; 121 return ss.str(); 122 } 123 124 std::string AtomicMemOpMicro::generateDisassembly(Addr pc, 125 const SymbolTable *symtab) const 126 { 127 std::stringstream ss; 128 ss << csprintf("0x%08x", machInst) << ' ' << mnemonic; 129 return ss.str(); 130 } 131}}; 132 | |
133def template AtomicMemOpDeclare {{ 134 /** 135 * Static instruction class for an AtomicMemOp operation 136 */ 137 class %(class_name)s : public %(base_class)s 138 { 139 public: 140 // Constructor --- 360 unchanged lines hidden --- | 36def template AtomicMemOpDeclare {{ 37 /** 38 * Static instruction class for an AtomicMemOp operation 39 */ 40 class %(class_name)s : public %(base_class)s 41 { 42 public: 43 // Constructor --- 360 unchanged lines hidden --- |