packet.cc (11287:0d5bbeaeb8ca) | packet.cc (11600:a38c3f9c82d1) |
---|---|
1/* | 1/* |
2 * Copyright (c) 2011-2015 ARM Limited | 2 * Copyright (c) 2011-2016 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 --- 49 unchanged lines hidden (view full) --- 60 61// The one downside to bitsets is that static initializers can get ugly. 62#define SET1(a1) (1 << (a1)) 63#define SET2(a1, a2) (SET1(a1) | SET1(a2)) 64#define SET3(a1, a2, a3) (SET2(a1, a2) | SET1(a3)) 65#define SET4(a1, a2, a3, a4) (SET3(a1, a2, a3) | SET1(a4)) 66#define SET5(a1, a2, a3, a4, a5) (SET4(a1, a2, a3, a4) | SET1(a5)) 67#define SET6(a1, a2, a3, a4, a5, a6) (SET5(a1, a2, a3, a4, a5) | SET1(a6)) | 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 --- 49 unchanged lines hidden (view full) --- 60 61// The one downside to bitsets is that static initializers can get ugly. 62#define SET1(a1) (1 << (a1)) 63#define SET2(a1, a2) (SET1(a1) | SET1(a2)) 64#define SET3(a1, a2, a3) (SET2(a1, a2) | SET1(a3)) 65#define SET4(a1, a2, a3, a4) (SET3(a1, a2, a3) | SET1(a4)) 66#define SET5(a1, a2, a3, a4, a5) (SET4(a1, a2, a3, a4) | SET1(a5)) 67#define SET6(a1, a2, a3, a4, a5, a6) (SET5(a1, a2, a3, a4, a5) | SET1(a6)) |
68#define SET7(a1, a2, a3, a4, a5, a6, a7) (SET6(a1, a2, a3, a4, a5, a6) | \ 69 SET1(a7)) |
|
68 69const MemCmd::CommandInfo 70MemCmd::commandInfo[] = 71{ 72 /* InvalidCmd */ 73 { 0, InvalidCmd, "InvalidCmd" }, 74 /* ReadReq - Read issued by a non-caching agent such as a CPU or 75 * device, with no restrictions on alignment. */ --- 4 unchanged lines hidden (view full) --- 80 { SET4(IsRead, IsResponse, HasData, IsInvalidate), 81 InvalidCmd, "ReadRespWithInvalidate" }, 82 /* WriteReq */ 83 { SET5(IsWrite, NeedsWritable, IsRequest, NeedsResponse, HasData), 84 WriteResp, "WriteReq" }, 85 /* WriteResp */ 86 { SET2(IsWrite, IsResponse), InvalidCmd, "WriteResp" }, 87 /* WritebackDirty */ | 70 71const MemCmd::CommandInfo 72MemCmd::commandInfo[] = 73{ 74 /* InvalidCmd */ 75 { 0, InvalidCmd, "InvalidCmd" }, 76 /* ReadReq - Read issued by a non-caching agent such as a CPU or 77 * device, with no restrictions on alignment. */ --- 4 unchanged lines hidden (view full) --- 82 { SET4(IsRead, IsResponse, HasData, IsInvalidate), 83 InvalidCmd, "ReadRespWithInvalidate" }, 84 /* WriteReq */ 85 { SET5(IsWrite, NeedsWritable, IsRequest, NeedsResponse, HasData), 86 WriteResp, "WriteReq" }, 87 /* WriteResp */ 88 { SET2(IsWrite, IsResponse), InvalidCmd, "WriteResp" }, 89 /* WritebackDirty */ |
88 { SET4(IsWrite, IsRequest, IsEviction, HasData), | 90 { SET5(IsWrite, IsRequest, IsEviction, HasData, FromCache), |
89 InvalidCmd, "WritebackDirty" }, 90 /* WritebackClean - This allows the upstream cache to writeback a 91 * line to the downstream cache without it being considered 92 * dirty. */ | 91 InvalidCmd, "WritebackDirty" }, 92 /* WritebackClean - This allows the upstream cache to writeback a 93 * line to the downstream cache without it being considered 94 * dirty. */ |
93 { SET4(IsWrite, IsRequest, IsEviction, HasData), | 95 { SET5(IsWrite, IsRequest, IsEviction, HasData, FromCache), |
94 InvalidCmd, "WritebackClean" }, 95 /* CleanEvict */ | 96 InvalidCmd, "WritebackClean" }, 97 /* CleanEvict */ |
96 { SET2(IsRequest, IsEviction), InvalidCmd, "CleanEvict" }, | 98 { SET3(IsRequest, IsEviction, FromCache), InvalidCmd, "CleanEvict" }, |
97 /* SoftPFReq */ 98 { SET4(IsRead, IsRequest, IsSWPrefetch, NeedsResponse), 99 SoftPFResp, "SoftPFReq" }, 100 /* HardPFReq */ | 99 /* SoftPFReq */ 100 { SET4(IsRead, IsRequest, IsSWPrefetch, NeedsResponse), 101 SoftPFResp, "SoftPFReq" }, 102 /* HardPFReq */ |
101 { SET4(IsRead, IsRequest, IsHWPrefetch, NeedsResponse), | 103 { SET5(IsRead, IsRequest, IsHWPrefetch, NeedsResponse, FromCache), |
102 HardPFResp, "HardPFReq" }, 103 /* SoftPFResp */ 104 { SET4(IsRead, IsResponse, IsSWPrefetch, HasData), 105 InvalidCmd, "SoftPFResp" }, 106 /* HardPFResp */ 107 { SET4(IsRead, IsResponse, IsHWPrefetch, HasData), 108 InvalidCmd, "HardPFResp" }, 109 /* WriteLineReq */ 110 { SET5(IsWrite, NeedsWritable, IsRequest, NeedsResponse, HasData), 111 WriteResp, "WriteLineReq" }, 112 /* UpgradeReq */ | 104 HardPFResp, "HardPFReq" }, 105 /* SoftPFResp */ 106 { SET4(IsRead, IsResponse, IsSWPrefetch, HasData), 107 InvalidCmd, "SoftPFResp" }, 108 /* HardPFResp */ 109 { SET4(IsRead, IsResponse, IsHWPrefetch, HasData), 110 InvalidCmd, "HardPFResp" }, 111 /* WriteLineReq */ 112 { SET5(IsWrite, NeedsWritable, IsRequest, NeedsResponse, HasData), 113 WriteResp, "WriteLineReq" }, 114 /* UpgradeReq */ |
113 { SET5(IsInvalidate, NeedsWritable, IsUpgrade, IsRequest, NeedsResponse), | 115 { SET6(IsInvalidate, NeedsWritable, IsUpgrade, IsRequest, NeedsResponse, 116 FromCache), |
114 UpgradeResp, "UpgradeReq" }, 115 /* SCUpgradeReq: response could be UpgradeResp or UpgradeFailResp */ | 117 UpgradeResp, "UpgradeReq" }, 118 /* SCUpgradeReq: response could be UpgradeResp or UpgradeFailResp */ |
116 { SET6(IsInvalidate, NeedsWritable, IsUpgrade, IsLlsc, 117 IsRequest, NeedsResponse), | 119 { SET7(IsInvalidate, NeedsWritable, IsUpgrade, IsLlsc, 120 IsRequest, NeedsResponse, FromCache), |
118 UpgradeResp, "SCUpgradeReq" }, 119 /* UpgradeResp */ 120 { SET2(IsUpgrade, IsResponse), 121 InvalidCmd, "UpgradeResp" }, 122 /* SCUpgradeFailReq: generates UpgradeFailResp but still gets the data */ | 121 UpgradeResp, "SCUpgradeReq" }, 122 /* UpgradeResp */ 123 { SET2(IsUpgrade, IsResponse), 124 InvalidCmd, "UpgradeResp" }, 125 /* SCUpgradeFailReq: generates UpgradeFailResp but still gets the data */ |
123 { SET6(IsRead, NeedsWritable, IsInvalidate, 124 IsLlsc, IsRequest, NeedsResponse), | 126 { SET7(IsRead, NeedsWritable, IsInvalidate, 127 IsLlsc, IsRequest, NeedsResponse, FromCache), |
125 UpgradeFailResp, "SCUpgradeFailReq" }, 126 /* UpgradeFailResp - Behaves like a ReadExReq, but notifies an SC 127 * that it has failed, acquires line as Dirty*/ 128 { SET3(IsRead, IsResponse, HasData), 129 InvalidCmd, "UpgradeFailResp" }, 130 /* ReadExReq - Read issues by a cache, always cache-line aligned, 131 * and the response is guaranteed to be writeable (exclusive or 132 * even modified) */ | 128 UpgradeFailResp, "SCUpgradeFailReq" }, 129 /* UpgradeFailResp - Behaves like a ReadExReq, but notifies an SC 130 * that it has failed, acquires line as Dirty*/ 131 { SET3(IsRead, IsResponse, HasData), 132 InvalidCmd, "UpgradeFailResp" }, 133 /* ReadExReq - Read issues by a cache, always cache-line aligned, 134 * and the response is guaranteed to be writeable (exclusive or 135 * even modified) */ |
133 { SET5(IsRead, NeedsWritable, IsInvalidate, IsRequest, NeedsResponse), | 136 { SET6(IsRead, NeedsWritable, IsInvalidate, IsRequest, NeedsResponse, 137 FromCache), |
134 ReadExResp, "ReadExReq" }, 135 /* ReadExResp - Response matching a read exclusive, as we check 136 * the need for exclusive also on responses */ 137 { SET3(IsRead, IsResponse, HasData), 138 InvalidCmd, "ReadExResp" }, 139 /* ReadCleanReq - Read issued by a cache, always cache-line 140 * aligned, and the response is guaranteed to not contain dirty data 141 * (exclusive or shared).*/ | 138 ReadExResp, "ReadExReq" }, 139 /* ReadExResp - Response matching a read exclusive, as we check 140 * the need for exclusive also on responses */ 141 { SET3(IsRead, IsResponse, HasData), 142 InvalidCmd, "ReadExResp" }, 143 /* ReadCleanReq - Read issued by a cache, always cache-line 144 * aligned, and the response is guaranteed to not contain dirty data 145 * (exclusive or shared).*/ |
142 { SET3(IsRead, IsRequest, NeedsResponse), ReadResp, "ReadCleanReq" }, | 146 { SET4(IsRead, IsRequest, NeedsResponse, FromCache), 147 ReadResp, "ReadCleanReq" }, |
143 /* ReadSharedReq - Read issued by a cache, always cache-line 144 * aligned, response is shared, possibly exclusive, owned or even 145 * modified. */ | 148 /* ReadSharedReq - Read issued by a cache, always cache-line 149 * aligned, response is shared, possibly exclusive, owned or even 150 * modified. */ |
146 { SET3(IsRead, IsRequest, NeedsResponse), ReadResp, "ReadSharedReq" }, | 151 { SET4(IsRead, IsRequest, NeedsResponse, FromCache), 152 ReadResp, "ReadSharedReq" }, |
147 /* LoadLockedReq: note that we use plain ReadResp as response, so that 148 * we can also use ReadRespWithInvalidate when needed */ 149 { SET4(IsRead, IsLlsc, IsRequest, NeedsResponse), 150 ReadResp, "LoadLockedReq" }, 151 /* StoreCondReq */ 152 { SET6(IsWrite, NeedsWritable, IsLlsc, 153 IsRequest, NeedsResponse, HasData), 154 StoreCondResp, "StoreCondReq" }, --- 27 unchanged lines hidden (view full) --- 182 { SET3(IsRead, IsResponse, IsError), InvalidCmd, "FunctionalReadError" }, 183 /* FunctionalWriteError */ 184 { SET3(IsWrite, IsResponse, IsError), InvalidCmd, "FunctionalWriteError" }, 185 /* PrintReq */ 186 { SET2(IsRequest, IsPrint), InvalidCmd, "PrintReq" }, 187 /* Flush Request */ 188 { SET3(IsRequest, IsFlush, NeedsWritable), InvalidCmd, "FlushReq" }, 189 /* Invalidation Request */ | 153 /* LoadLockedReq: note that we use plain ReadResp as response, so that 154 * we can also use ReadRespWithInvalidate when needed */ 155 { SET4(IsRead, IsLlsc, IsRequest, NeedsResponse), 156 ReadResp, "LoadLockedReq" }, 157 /* StoreCondReq */ 158 { SET6(IsWrite, NeedsWritable, IsLlsc, 159 IsRequest, NeedsResponse, HasData), 160 StoreCondResp, "StoreCondReq" }, --- 27 unchanged lines hidden (view full) --- 188 { SET3(IsRead, IsResponse, IsError), InvalidCmd, "FunctionalReadError" }, 189 /* FunctionalWriteError */ 190 { SET3(IsWrite, IsResponse, IsError), InvalidCmd, "FunctionalWriteError" }, 191 /* PrintReq */ 192 { SET2(IsRequest, IsPrint), InvalidCmd, "PrintReq" }, 193 /* Flush Request */ 194 { SET3(IsRequest, IsFlush, NeedsWritable), InvalidCmd, "FlushReq" }, 195 /* Invalidation Request */ |
190 { SET4(IsInvalidate, IsRequest, NeedsWritable, NeedsResponse), | 196 { SET5(IsInvalidate, IsRequest, NeedsWritable, NeedsResponse, FromCache), |
191 InvalidateResp, "InvalidateReq" }, 192 /* Invalidation Response */ 193 { SET2(IsInvalidate, IsResponse), 194 InvalidCmd, "InvalidateResp" } 195}; 196 197bool 198Packet::checkFunctional(Printable *obj, Addr addr, bool is_secure, int size, --- 213 unchanged lines hidden --- | 197 InvalidateResp, "InvalidateReq" }, 198 /* Invalidation Response */ 199 { SET2(IsInvalidate, IsResponse), 200 InvalidCmd, "InvalidateResp" } 201}; 202 203bool 204Packet::checkFunctional(Printable *obj, Addr addr, bool is_secure, int size, --- 213 unchanged lines hidden --- |