64 const MemCmd::CommandInfo
68 { {}, InvalidCmd,
"InvalidCmd" },
71 { {IsRead, IsRequest, NeedsResponse}, ReadResp,
"ReadReq" },
73 { {IsRead, IsResponse, HasData}, InvalidCmd,
"ReadResp" },
75 { {IsRead, IsResponse, HasData, IsInvalidate},
76 InvalidCmd,
"ReadRespWithInvalidate" },
78 { {IsWrite, NeedsWritable, IsRequest, NeedsResponse, HasData},
79 WriteResp,
"WriteReq" },
81 { {IsWrite, IsResponse}, InvalidCmd,
"WriteResp" },
89 { {IsWrite, IsResponse}, InvalidCmd,
"WriteCompleteResp" },
91 { {IsWrite, IsRequest, IsEviction, HasData, FromCache},
92 InvalidCmd,
"WritebackDirty" },
96 { {IsWrite, IsRequest, IsEviction, HasData, FromCache},
97 InvalidCmd,
"WritebackClean" },
100 { {IsWrite, IsRequest, HasData, FromCache}, InvalidCmd,
"WriteClean" },
102 { {IsRequest, IsEviction, FromCache}, InvalidCmd,
"CleanEvict" },
104 { {IsRead, IsRequest, IsSWPrefetch, NeedsResponse},
105 SoftPFResp,
"SoftPFReq" },
107 { {IsRead, NeedsWritable, IsInvalidate, IsRequest,
108 IsSWPrefetch, NeedsResponse}, SoftPFResp,
"SoftPFExReq" },
110 { {IsRead, IsRequest, IsHWPrefetch, NeedsResponse, FromCache},
111 HardPFResp,
"HardPFReq" },
113 { {IsRead, IsResponse, IsSWPrefetch, HasData}, InvalidCmd,
"SoftPFResp" },
115 { {IsRead, IsResponse, IsHWPrefetch, HasData}, InvalidCmd,
"HardPFResp" },
117 { {IsWrite, NeedsWritable, IsRequest, NeedsResponse, HasData},
118 WriteResp,
"WriteLineReq" },
120 { {IsInvalidate, NeedsWritable, IsUpgrade, IsRequest, NeedsResponse,
121 FromCache}, UpgradeResp,
"UpgradeReq" },
123 { {IsInvalidate, NeedsWritable, IsUpgrade, IsLlsc,
124 IsRequest, NeedsResponse, FromCache},
125 UpgradeResp,
"SCUpgradeReq" },
127 { {IsUpgrade, IsResponse}, InvalidCmd,
"UpgradeResp" },
129 { {IsRead, NeedsWritable, IsInvalidate,
130 IsLlsc, IsRequest, NeedsResponse, FromCache},
131 UpgradeFailResp,
"SCUpgradeFailReq" },
134 { {IsRead, IsResponse, HasData}, InvalidCmd,
"UpgradeFailResp" },
138 { {IsRead, NeedsWritable, IsInvalidate, IsRequest, NeedsResponse,
139 FromCache}, ReadExResp,
"ReadExReq" },
142 { {IsRead, IsResponse, HasData}, InvalidCmd,
"ReadExResp" },
146 { {IsRead, IsRequest, NeedsResponse, FromCache},
147 ReadResp,
"ReadCleanReq" },
151 { {IsRead, IsRequest, NeedsResponse, FromCache},
152 ReadResp,
"ReadSharedReq" },
155 { {IsRead, IsLlsc, IsRequest, NeedsResponse},
156 ReadResp,
"LoadLockedReq" },
158 { {IsWrite, NeedsWritable, IsLlsc,
159 IsRequest, NeedsResponse, HasData},
160 StoreCondResp,
"StoreCondReq" },
162 { {IsWrite, NeedsWritable, IsLlsc, IsRequest, NeedsResponse, HasData},
163 StoreCondResp,
"StoreCondFailReq" },
165 { {IsWrite, IsLlsc, IsResponse},
166 InvalidCmd,
"StoreCondResp" },
168 { {IsRead, IsWrite, NeedsWritable, IsRequest, HasData, NeedsResponse},
169 SwapResp,
"SwapReq" },
171 { {IsRead, IsWrite, IsResponse, HasData}, InvalidCmd,
"SwapResp" },
172 { {}, InvalidCmd,
"Deprecated_MessageReq" },
173 { {}, InvalidCmd,
"Deprecated_MessageResp" },
175 {{IsRequest, NeedsResponse}, MemFenceResp,
"MemFenceReq"},
177 {{IsRequest, NeedsResponse}, MemSyncResp,
"MemSyncReq"},
179 {{IsResponse}, InvalidCmd,
"MemSyncResp"},
181 {{IsResponse}, InvalidCmd,
"MemFenceResp"},
185 { {IsRequest, IsClean, NeedsResponse, FromCache},
186 CleanSharedResp,
"CleanSharedReq" },
190 { {IsResponse, IsClean}, InvalidCmd,
"CleanSharedResp" },
193 { {IsRequest, IsInvalidate, IsClean, NeedsResponse, FromCache},
194 CleanInvalidResp,
"CleanInvalidReq" },
198 { {IsResponse, IsInvalidate, IsClean},
199 InvalidCmd,
"CleanInvalidResp" },
201 { {IsResponse, IsError}, InvalidCmd,
"InvalidDestError" },
203 { {IsResponse, IsError}, InvalidCmd,
"BadAddressError" },
205 { {IsRead, IsResponse, IsError}, InvalidCmd,
"FunctionalReadError" },
207 { {IsWrite, IsResponse, IsError}, InvalidCmd,
"FunctionalWriteError" },
209 { {IsRequest, IsPrint}, InvalidCmd,
"PrintReq" },
211 { {IsRequest, IsFlush, NeedsWritable}, InvalidCmd,
"FlushReq" },
213 { {IsInvalidate, IsRequest, NeedsWritable, NeedsResponse, FromCache},
214 InvalidateResp,
"InvalidateReq" },
216 { {IsInvalidate, IsResponse},
217 InvalidCmd,
"InvalidateResp" },
219 { {IsRead, IsRequest, NeedsResponse}, HTMReqResp,
"HTMReq" },
220 { {IsRead, IsResponse}, InvalidCmd,
"HTMReqResp" },
221 { {IsRead, IsRequest}, InvalidCmd,
"HTMAbort" },
237 const Addr val_end = val_start +
size - 1;
239 if (is_secure !=
_isSecure || func_start > val_end ||
240 val_start > func_end) {
248 safe_cast<PrintReqState*>(
senderState)->printObj(obj);
258 const Addr val_offset = func_start > val_start ?
259 func_start - val_start : 0;
260 const Addr func_offset = func_start < val_start ?
261 val_start - func_start : 0;
262 const Addr overlap_size = std::min(val_end, func_end)+1 -
263 std::max(val_start, func_start);
266 std::memcpy(getPtr<uint8_t>() + func_offset,
276 bool all_bytes_valid =
true;
281 for (; all_bytes_valid &&
i < func_offset; ++
i)
285 for (
i = func_offset;
i < func_offset + overlap_size; ++
i)
289 for (; all_bytes_valid &&
i <
getSize(); ++
i)
292 return all_bytes_valid;
294 std::memcpy(_data + val_offset,
295 getConstPtr<uint8_t>() + func_offset,
318 assert(sender_state != NULL);
338 return (uint64_t)get<uint8_t>(endian);
340 return (uint64_t)get<uint16_t>(endian);
342 return (uint64_t)get<uint32_t>(endian);
344 return (uint64_t)get<uint64_t>(endian);
355 set<uint8_t>((uint8_t)
w, endian);
358 set<uint16_t>((uint16_t)
w, endian);
361 set<uint32_t>((uint32_t)
w, endian);
364 set<uint64_t>((uint64_t)
w, endian);
374 const std::string &prefix)
const
378 req->isSecure() ?
" (s)" :
"",
379 req->isInstFetch() ?
" IF" :
"",
380 req->isUncacheable() ?
" UC" :
"",
382 req->isToPOC() ?
" PoC" :
"",
383 req->isToPOU() ?
" PoU" :
"");
388 std::ostringstream str;
395 const int blk_size)
const
420 : curPrefixPtr(new
std::string(
"")),
os(_os), verbosity(_verbosity)
427 labelStack.pop_back();
428 assert(labelStack.empty());
434 std::string *_prefix)
435 : label(_label), prefix(_prefix), labelPrinted(false)
441 const std::string &prefix)
464 if (!
i->labelPrinted) {
466 i->labelPrinted =
true;