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) | \
75 { 0, InvalidCmd,
"InvalidCmd" },
78 {
SET3(IsRead, IsRequest, NeedsResponse), ReadResp,
"ReadReq" },
80 {
SET3(IsRead, IsResponse, HasData), InvalidCmd,
"ReadResp" },
82 {
SET4(IsRead, IsResponse, HasData, IsInvalidate),
83 InvalidCmd,
"ReadRespWithInvalidate" },
85 {
SET5(IsWrite, NeedsWritable, IsRequest, NeedsResponse, HasData),
86 WriteResp,
"WriteReq" },
88 {
SET2(IsWrite, IsResponse), InvalidCmd,
"WriteResp" },
96 {
SET2(IsWrite, IsResponse), InvalidCmd,
"WriteCompleteResp" },
98 {
SET5(IsWrite, IsRequest, IsEviction, HasData, FromCache),
99 InvalidCmd,
"WritebackDirty" },
103 {
SET5(IsWrite, IsRequest, IsEviction, HasData, FromCache),
104 InvalidCmd,
"WritebackClean" },
107 {
SET4(IsWrite, IsRequest, HasData, FromCache), InvalidCmd,
"WriteClean" },
109 {
SET3(IsRequest, IsEviction, FromCache), InvalidCmd,
"CleanEvict" },
111 {
SET4(IsRead, IsRequest, IsSWPrefetch, NeedsResponse),
112 SoftPFResp,
"SoftPFReq" },
114 {
SET6(IsRead, NeedsWritable, IsInvalidate, IsRequest,
115 IsSWPrefetch, NeedsResponse), SoftPFResp,
"SoftPFExReq" },
117 {
SET5(IsRead, IsRequest, IsHWPrefetch, NeedsResponse, FromCache),
118 HardPFResp,
"HardPFReq" },
120 {
SET4(IsRead, IsResponse, IsSWPrefetch, HasData),
121 InvalidCmd,
"SoftPFResp" },
123 {
SET4(IsRead, IsResponse, IsHWPrefetch, HasData),
124 InvalidCmd,
"HardPFResp" },
126 {
SET5(IsWrite, NeedsWritable, IsRequest, NeedsResponse, HasData),
127 WriteResp,
"WriteLineReq" },
129 {
SET6(IsInvalidate, NeedsWritable, IsUpgrade, IsRequest, NeedsResponse,
131 UpgradeResp,
"UpgradeReq" },
133 {
SET7(IsInvalidate, NeedsWritable, IsUpgrade, IsLlsc,
134 IsRequest, NeedsResponse, FromCache),
135 UpgradeResp,
"SCUpgradeReq" },
137 {
SET2(IsUpgrade, IsResponse),
138 InvalidCmd,
"UpgradeResp" },
140 {
SET7(IsRead, NeedsWritable, IsInvalidate,
141 IsLlsc, IsRequest, NeedsResponse, FromCache),
142 UpgradeFailResp,
"SCUpgradeFailReq" },
145 {
SET3(IsRead, IsResponse, HasData),
146 InvalidCmd,
"UpgradeFailResp" },
150 {
SET6(IsRead, NeedsWritable, IsInvalidate, IsRequest, NeedsResponse,
152 ReadExResp,
"ReadExReq" },
155 {
SET3(IsRead, IsResponse, HasData),
156 InvalidCmd,
"ReadExResp" },
160 {
SET4(IsRead, IsRequest, NeedsResponse, FromCache),
161 ReadResp,
"ReadCleanReq" },
165 {
SET4(IsRead, IsRequest, NeedsResponse, FromCache),
166 ReadResp,
"ReadSharedReq" },
169 {
SET4(IsRead, IsLlsc, IsRequest, NeedsResponse),
170 ReadResp,
"LoadLockedReq" },
172 {
SET6(IsWrite, NeedsWritable, IsLlsc,
173 IsRequest, NeedsResponse, HasData),
174 StoreCondResp,
"StoreCondReq" },
176 {
SET6(IsWrite, NeedsWritable, IsLlsc,
177 IsRequest, NeedsResponse, HasData),
178 StoreCondResp,
"StoreCondFailReq" },
180 {
SET3(IsWrite, IsLlsc, IsResponse),
181 InvalidCmd,
"StoreCondResp" },
183 {
SET6(IsRead, IsWrite, NeedsWritable, IsRequest, HasData, NeedsResponse),
184 SwapResp,
"SwapReq" },
186 {
SET4(IsRead, IsWrite, IsResponse, HasData),
187 InvalidCmd,
"SwapResp" },
188 { 0, InvalidCmd,
"Deprecated_MessageReq" },
189 { 0, InvalidCmd,
"Deprecated_MessageResp" },
191 {
SET2(IsRequest, NeedsResponse), MemFenceResp,
"MemFenceReq"},
193 {
SET2(IsRequest, NeedsResponse), MemSyncResp,
"MemSyncReq"},
195 {
SET1(IsResponse), InvalidCmd,
"MemSyncResp"},
197 {
SET1(IsResponse), InvalidCmd,
"MemFenceResp"},
201 {
SET4(IsRequest, IsClean, NeedsResponse, FromCache),
202 CleanSharedResp,
"CleanSharedReq" },
206 {
SET2(IsResponse, IsClean), InvalidCmd,
"CleanSharedResp" },
209 {
SET5(IsRequest, IsInvalidate, IsClean, NeedsResponse, FromCache),
210 CleanInvalidResp,
"CleanInvalidReq" },
214 {
SET3(IsResponse, IsInvalidate, IsClean),
215 InvalidCmd,
"CleanInvalidResp" },
217 {
SET2(IsResponse, IsError), InvalidCmd,
"InvalidDestError" },
219 {
SET2(IsResponse, IsError), InvalidCmd,
"BadAddressError" },
221 {
SET3(IsRead, IsResponse, IsError), InvalidCmd,
"FunctionalReadError" },
223 {
SET3(IsWrite, IsResponse, IsError), InvalidCmd,
"FunctionalWriteError" },
225 {
SET2(IsRequest, IsPrint), InvalidCmd,
"PrintReq" },
227 {
SET3(IsRequest, IsFlush, NeedsWritable), InvalidCmd,
"FlushReq" },
229 {
SET5(IsInvalidate, IsRequest, NeedsWritable, NeedsResponse, FromCache),
230 InvalidateResp,
"InvalidateReq" },
232 {
SET2(IsInvalidate, IsResponse),
233 InvalidCmd,
"InvalidateResp" },
235 {
SET3(IsRead, IsRequest, NeedsResponse), HTMReqResp,
"HTMReq" },
236 {
SET2(IsRead, IsResponse), InvalidCmd,
"HTMReqResp" },
237 {
SET2(IsRead, IsRequest), InvalidCmd,
"HTMAbort" },
253 const Addr val_end = val_start +
size - 1;
255 if (is_secure !=
_isSecure || func_start > val_end ||
256 val_start > func_end) {
264 safe_cast<PrintReqState*>(
senderState)->printObj(obj);
274 const Addr val_offset = func_start > val_start ?
275 func_start - val_start : 0;
276 const Addr func_offset = func_start < val_start ?
277 val_start - func_start : 0;
278 const Addr overlap_size = std::min(val_end, func_end)+1 -
279 std::max(val_start, func_start);
282 std::memcpy(getPtr<uint8_t>() + func_offset,
292 bool all_bytes_valid =
true;
297 for (; all_bytes_valid &&
i < func_offset; ++
i)
301 for (
i = func_offset;
i < func_offset + overlap_size; ++
i)
305 for (; all_bytes_valid &&
i <
getSize(); ++
i)
308 return all_bytes_valid;
310 std::memcpy(_data + val_offset,
311 getConstPtr<uint8_t>() + func_offset,
334 assert(sender_state != NULL);
354 return (uint64_t)get<uint8_t>(endian);
356 return (uint64_t)get<uint16_t>(endian);
358 return (uint64_t)get<uint32_t>(endian);
360 return (uint64_t)get<uint64_t>(endian);
371 set<uint8_t>((uint8_t)
w, endian);
374 set<uint16_t>((uint16_t)
w, endian);
377 set<uint32_t>((uint32_t)
w, endian);
380 set<uint64_t>((uint64_t)
w, endian);
390 const std::string &prefix)
const
394 req->isSecure() ?
" (s)" :
"",
395 req->isInstFetch() ?
" IF" :
"",
396 req->isUncacheable() ?
" UC" :
"",
398 req->isToPOC() ?
" PoC" :
"",
399 req->isToPOU() ?
" PoU" :
"");
404 std::ostringstream str;
411 const int blk_size)
const
436 : curPrefixPtr(new
std::string(
"")),
os(_os), verbosity(_verbosity)
443 labelStack.pop_back();
444 assert(labelStack.empty());
450 std::string *_prefix)
451 : label(_label), prefix(_prefix), labelPrinted(false)
457 const std::string &prefix)
480 if (!
i->labelPrinted) {
482 i->labelPrinted =
true;