1/* 2 * Copyright (c) 2012-2013 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 * Copyright (c) 2002-2005 The Regents of The University of Michigan |
15 * Copyright (c) 2010,2015 Advanced Micro Devices, Inc. |
16 * All rights reserved. 17 * 18 * Redistribution and use in source and binary forms, with or without 19 * modification, are permitted provided that the following conditions are 20 * met: redistributions of source code must retain the above copyright 21 * notice, this list of conditions and the following disclaimer; 22 * redistributions in binary form must reproduce the above copyright 23 * notice, this list of conditions and the following disclaimer in the --- 57 unchanged lines hidden (view full) --- 81class Request; 82 83typedef Request* RequestPtr; 84typedef uint16_t MasterID; 85 86class Request 87{ 88 public: |
89 typedef uint64_t FlagsType; |
90 typedef uint8_t ArchFlagsType; 91 typedef ::Flags<FlagsType> Flags; 92 93 enum : FlagsType { 94 /** 95 * Architecture specific flags. 96 * 97 * These bits int the flag field are reserved for 98 * architecture-specific code. For example, SPARC uses them to 99 * represent ASIs. 100 */ |
101 ARCH_BITS = 0x00000000000000FF, |
102 /** The request was an instruction fetch. */ |
103 INST_FETCH = 0x0000000000000100, |
104 /** The virtual address is also the physical address. */ |
105 PHYSICAL = 0x0000000000000200, |
106 /** 107 * The request is to an uncacheable address. 108 * 109 * @note Uncacheable accesses may be reordered by CPU models. The 110 * STRICT_ORDER flag should be set if such reordering is 111 * undesirable. 112 */ |
113 UNCACHEABLE = 0x0000000000000400, |
114 /** 115 * The request is required to be strictly ordered by <i>CPU 116 * models</i> and is non-speculative. 117 * 118 * A strictly ordered request is guaranteed to never be 119 * re-ordered or executed speculatively by a CPU model. The 120 * memory system may still reorder requests in caches unless 121 * the UNCACHEABLE flag is set as well. 122 */ |
123 STRICT_ORDER = 0x0000000000000800, |
124 /** This request is to a memory mapped register. */ |
125 MMAPPED_IPR = 0x0000000000001000, |
126 /** This request is a clear exclusive. */ |
127 CLEAR_LL = 0x0000000000002000, |
128 /** This request is made in privileged mode. */ |
129 PRIVILEGED = 0x0000000000004000, |
130 131 /** 132 * This is a write that is targeted and zeroing an entire 133 * cache block. There is no need for a read/modify/write 134 */ |
135 CACHE_BLOCK_ZERO = 0x0000000000008000, |
136 137 /** The request should not cause a memory access. */ |
138 NO_ACCESS = 0x0000000000100000, |
139 /** 140 * This request will lock or unlock the accessed memory. When 141 * used with a load, the access locks the particular chunk of 142 * memory. When used with a store, it unlocks. The rule is 143 * that locked accesses have to be made up of a locked load, 144 * some operation on the data, and then a locked store. 145 */ |
146 LOCKED_RMW = 0x0000000000200000, |
147 /** The request is a Load locked/store conditional. */ |
148 LLSC = 0x0000000000400000, |
149 /** This request is for a memory swap. */ |
150 MEM_SWAP = 0x0000000000800000, 151 MEM_SWAP_COND = 0x0000000001000000, |
152 153 /** The request is a prefetch. */ |
154 PREFETCH = 0x0000000002000000, |
155 /** The request should be prefetched into the exclusive state. */ |
156 PF_EXCLUSIVE = 0x0000000004000000, |
157 /** The request should be marked as LRU. */ |
158 EVICT_NEXT = 0x0000000008000000, 159 /** The request should be marked with ACQUIRE. */ 160 ACQUIRE = 0x0000000001000000, 161 /** The request should be marked with RELEASE. */ 162 RELEASE = 0x0000000002000000, |
163 164 /** 165 * The request should be handled by the generic IPR code (only 166 * valid together with MMAPPED_IPR) 167 */ |
168 GENERIC_IPR = 0x0000000004000000, |
169 170 /** The request targets the secure memory space. */ |
171 SECURE = 0x0000000008000000, |
172 /** The request is a page table walk */ |
173 PT_WALK = 0x0000000010000000, |
174 175 /** 176 * These flags are *not* cleared when a Request object is 177 * reused (assigned a new address). 178 */ 179 STICKY_FLAGS = INST_FETCH 180 }; 181 --- 473 unchanged lines hidden (view full) --- 655 only; setting flags should be done via setFlags(). */ 656 bool isUncacheable() const { return _flags.isSet(UNCACHEABLE); } 657 bool isStrictlyOrdered() const { return _flags.isSet(STRICT_ORDER); } 658 bool isInstFetch() const { return _flags.isSet(INST_FETCH); } 659 bool isPrefetch() const { return _flags.isSet(PREFETCH); } 660 bool isLLSC() const { return _flags.isSet(LLSC); } 661 bool isPriv() const { return _flags.isSet(PRIVILEGED); } 662 bool isLockedRMW() const { return _flags.isSet(LOCKED_RMW); } |
663 bool isAcquire() const { return _flags.isSet(ACQUIRE); } 664 bool isRelease() const { return _flags.isSet(RELEASE); } 665 bool isAcquireRelease() const { 666 return _flags.isSet(RELEASE | ACQUIRE); 667 } |
668 bool isSwap() const { return _flags.isSet(MEM_SWAP|MEM_SWAP_COND); } 669 bool isCondSwap() const { return _flags.isSet(MEM_SWAP_COND); } 670 bool isMmappedIpr() const { return _flags.isSet(MMAPPED_IPR); } 671 bool isClearLL() const { return _flags.isSet(CLEAR_LL); } 672 bool isSecure() const { return _flags.isSet(SECURE); } 673 bool isPTWalk() const { return _flags.isSet(PT_WALK); } |
674 void setAcquire() { _flags.set(ACQUIRE); } 675 void setRelease() { _flags.set(RELEASE); } |
676}; 677 678#endif // __MEM_REQUEST_HH__ |