gem5  v21.1.0.2
packet.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2019 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) 2006 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
24  * documentation and/or other materials provided with the distribution;
25  * neither the name of the copyright holders nor the names of its
26  * contributors may be used to endorse or promote products derived from
27  * this software without specific prior written permission.
28  *
29  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  */
41 
48 #include "mem/packet.hh"
49 
50 #include <algorithm>
51 #include <cstring>
52 #include <iostream>
53 #include <sstream>
54 #include <string>
55 
56 #include "base/cprintf.hh"
57 #include "base/logging.hh"
58 #include "base/trace.hh"
59 #include "mem/packet_access.hh"
60 
61 namespace gem5
62 {
63 
64 const MemCmd::CommandInfo
66 {
67  /* InvalidCmd */
68  { {}, InvalidCmd, "InvalidCmd" },
69  /* ReadReq - Read issued by a non-caching agent such as a CPU or
70  * device, with no restrictions on alignment. */
71  { {IsRead, IsRequest, NeedsResponse}, ReadResp, "ReadReq" },
72  /* ReadResp */
73  { {IsRead, IsResponse, HasData}, InvalidCmd, "ReadResp" },
74  /* ReadRespWithInvalidate */
75  { {IsRead, IsResponse, HasData, IsInvalidate},
76  InvalidCmd, "ReadRespWithInvalidate" },
77  /* WriteReq */
78  { {IsWrite, NeedsWritable, IsRequest, NeedsResponse, HasData},
79  WriteResp, "WriteReq" },
80  /* WriteResp */
81  { {IsWrite, IsResponse}, InvalidCmd, "WriteResp" },
82  /* WriteCompleteResp - The WriteCompleteResp command is needed
83  * because in the GPU memory model we use a WriteResp to indicate
84  * that a write has reached the cache controller so we can free
85  * resources at the coalescer. Later, when the write succesfully
86  * completes we send a WriteCompleteResp to the CU so its wait
87  * counters can be updated. Wait counters in the CU is how memory
88  * dependences are handled in the GPU ISA. */
89  { {IsWrite, IsResponse}, InvalidCmd, "WriteCompleteResp" },
90  /* WritebackDirty */
91  { {IsWrite, IsRequest, IsEviction, HasData, FromCache},
92  InvalidCmd, "WritebackDirty" },
93  /* WritebackClean - This allows the upstream cache to writeback a
94  * line to the downstream cache without it being considered
95  * dirty. */
96  { {IsWrite, IsRequest, IsEviction, HasData, FromCache},
97  InvalidCmd, "WritebackClean" },
98  /* WriteClean - This allows a cache to write a dirty block to a memory
99  below without evicting its copy. */
100  { {IsWrite, IsRequest, HasData, FromCache}, InvalidCmd, "WriteClean" },
101  /* CleanEvict */
102  { {IsRequest, IsEviction, FromCache}, InvalidCmd, "CleanEvict" },
103  /* SoftPFReq */
104  { {IsRead, IsRequest, IsSWPrefetch, NeedsResponse},
105  SoftPFResp, "SoftPFReq" },
106  /* SoftPFExReq */
107  { {IsRead, NeedsWritable, IsInvalidate, IsRequest,
108  IsSWPrefetch, NeedsResponse}, SoftPFResp, "SoftPFExReq" },
109  /* HardPFReq */
110  { {IsRead, IsRequest, IsHWPrefetch, NeedsResponse, FromCache},
111  HardPFResp, "HardPFReq" },
112  /* SoftPFResp */
113  { {IsRead, IsResponse, IsSWPrefetch, HasData}, InvalidCmd, "SoftPFResp" },
114  /* HardPFResp */
115  { {IsRead, IsResponse, IsHWPrefetch, HasData}, InvalidCmd, "HardPFResp" },
116  /* WriteLineReq */
117  { {IsWrite, NeedsWritable, IsRequest, NeedsResponse, HasData},
118  WriteResp, "WriteLineReq" },
119  /* UpgradeReq */
120  { {IsInvalidate, NeedsWritable, IsUpgrade, IsRequest, NeedsResponse,
121  FromCache}, UpgradeResp, "UpgradeReq" },
122  /* SCUpgradeReq: response could be UpgradeResp or UpgradeFailResp */
123  { {IsInvalidate, NeedsWritable, IsUpgrade, IsLlsc,
124  IsRequest, NeedsResponse, FromCache},
125  UpgradeResp, "SCUpgradeReq" },
126  /* UpgradeResp */
127  { {IsUpgrade, IsResponse}, InvalidCmd, "UpgradeResp" },
128  /* SCUpgradeFailReq: generates UpgradeFailResp but still gets the data */
129  { {IsRead, NeedsWritable, IsInvalidate,
130  IsLlsc, IsRequest, NeedsResponse, FromCache},
131  UpgradeFailResp, "SCUpgradeFailReq" },
132  /* UpgradeFailResp - Behaves like a ReadExReq, but notifies an SC
133  * that it has failed, acquires line as Dirty*/
134  { {IsRead, IsResponse, HasData}, InvalidCmd, "UpgradeFailResp" },
135  /* ReadExReq - Read issues by a cache, always cache-line aligned,
136  * and the response is guaranteed to be writeable (exclusive or
137  * even modified} */
138  { {IsRead, NeedsWritable, IsInvalidate, IsRequest, NeedsResponse,
139  FromCache}, ReadExResp, "ReadExReq" },
140  /* ReadExResp - Response matching a read exclusive, as we check
141  * the need for exclusive also on responses */
142  { {IsRead, IsResponse, HasData}, 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}.*/
146  { {IsRead, IsRequest, NeedsResponse, FromCache},
147  ReadResp, "ReadCleanReq" },
148  /* ReadSharedReq - Read issued by a cache, always cache-line
149  * aligned, response is shared, possibly exclusive, owned or even
150  * modified. */
151  { {IsRead, IsRequest, NeedsResponse, FromCache},
152  ReadResp, "ReadSharedReq" },
153  /* LoadLockedReq: note that we use plain ReadResp as response, so that
154  * we can also use ReadRespWithInvalidate when needed */
155  { {IsRead, IsLlsc, IsRequest, NeedsResponse},
156  ReadResp, "LoadLockedReq" },
157  /* StoreCondReq */
158  { {IsWrite, NeedsWritable, IsLlsc,
159  IsRequest, NeedsResponse, HasData},
160  StoreCondResp, "StoreCondReq" },
161  /* StoreCondFailReq: generates failing StoreCondResp */
162  { {IsWrite, NeedsWritable, IsLlsc, IsRequest, NeedsResponse, HasData},
163  StoreCondResp, "StoreCondFailReq" },
164  /* StoreCondResp */
165  { {IsWrite, IsLlsc, IsResponse},
166  InvalidCmd, "StoreCondResp" },
167  /* SwapReq -- for Swap ldstub type operations */
168  { {IsRead, IsWrite, NeedsWritable, IsRequest, HasData, NeedsResponse},
169  SwapResp, "SwapReq" },
170  /* SwapResp -- for Swap ldstub type operations */
171  { {IsRead, IsWrite, IsResponse, HasData}, InvalidCmd, "SwapResp" },
172  { {}, InvalidCmd, "Deprecated_MessageReq" },
173  { {}, InvalidCmd, "Deprecated_MessageResp" },
174  /* MemFenceReq -- for synchronization requests */
175  {{IsRequest, NeedsResponse}, MemFenceResp, "MemFenceReq"},
176  /* MemSyncReq */
177  {{IsRequest, NeedsResponse}, MemSyncResp, "MemSyncReq"},
178  /* MemSyncResp */
179  {{IsResponse}, InvalidCmd, "MemSyncResp"},
180  /* MemFenceResp -- for synchronization responses */
181  {{IsResponse}, InvalidCmd, "MemFenceResp"},
182  /* Cache Clean Request -- Update with the latest data all existing
183  copies of the block down to the point indicated by the
184  request */
185  { {IsRequest, IsClean, NeedsResponse, FromCache},
186  CleanSharedResp, "CleanSharedReq" },
187  /* Cache Clean Response - Indicates that all caches up to the
188  specified point of reference have a up-to-date copy of the
189  cache block or no copy at all */
190  { {IsResponse, IsClean}, InvalidCmd, "CleanSharedResp" },
191  /* Cache Clean and Invalidate Request -- Invalidate all existing
192  copies down to the point indicated by the request */
193  { {IsRequest, IsInvalidate, IsClean, NeedsResponse, FromCache},
194  CleanInvalidResp, "CleanInvalidReq" },
195  /* Cache Clean and Invalidate Respose -- Indicates that no cache
196  above the specified point holds the block and that the block
197  was written to a memory below the specified point. */
198  { {IsResponse, IsInvalidate, IsClean},
199  InvalidCmd, "CleanInvalidResp" },
200  /* InvalidDestError -- packet dest field invalid */
201  { {IsResponse, IsError}, InvalidCmd, "InvalidDestError" },
202  /* BadAddressError -- memory address invalid */
203  { {IsResponse, IsError}, InvalidCmd, "BadAddressError" },
204  /* FunctionalReadError */
205  { {IsRead, IsResponse, IsError}, InvalidCmd, "FunctionalReadError" },
206  /* FunctionalWriteError */
207  { {IsWrite, IsResponse, IsError}, InvalidCmd, "FunctionalWriteError" },
208  /* PrintReq */
209  { {IsRequest, IsPrint}, InvalidCmd, "PrintReq" },
210  /* Flush Request */
211  { {IsRequest, IsFlush, NeedsWritable}, InvalidCmd, "FlushReq" },
212  /* Invalidation Request */
213  { {IsInvalidate, IsRequest, NeedsWritable, NeedsResponse, FromCache},
214  InvalidateResp, "InvalidateReq" },
215  /* Invalidation Response */
216  { {IsInvalidate, IsResponse},
217  InvalidCmd, "InvalidateResp" },
218  // hardware transactional memory
219  { {IsRead, IsRequest, NeedsResponse}, HTMReqResp, "HTMReq" },
220  { {IsRead, IsResponse}, InvalidCmd, "HTMReqResp" },
221  { {IsRead, IsRequest}, InvalidCmd, "HTMAbort" },
222 };
223 
224 AddrRange
226 {
227  return RangeSize(getAddr(), getSize());
228 }
229 
230 bool
231 Packet::trySatisfyFunctional(Printable *obj, Addr addr, bool is_secure, int size,
232  uint8_t *_data)
233 {
234  const Addr func_start = getAddr();
235  const Addr func_end = getAddr() + getSize() - 1;
236  const Addr val_start = addr;
237  const Addr val_end = val_start + size - 1;
238 
239  if (is_secure != _isSecure || func_start > val_end ||
240  val_start > func_end) {
241  // no intersection
242  return false;
243  }
244 
245  // check print first since it doesn't require data
246  if (isPrint()) {
247  assert(!_data);
248  safe_cast<PrintReqState*>(senderState)->printObj(obj);
249  return false;
250  }
251 
252  // we allow the caller to pass NULL to signify the other packet
253  // has no data
254  if (!_data) {
255  return false;
256  }
257 
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);
264 
265  if (isRead()) {
266  std::memcpy(getPtr<uint8_t>() + func_offset,
267  _data + val_offset,
268  overlap_size);
269 
270  // initialise the tracking of valid bytes if we have not
271  // used it already
272  if (bytesValid.empty())
273  bytesValid.resize(getSize(), false);
274 
275  // track if we are done filling the functional access
276  bool all_bytes_valid = true;
277 
278  int i = 0;
279 
280  // check up to func_offset
281  for (; all_bytes_valid && i < func_offset; ++i)
282  all_bytes_valid &= bytesValid[i];
283 
284  // update the valid bytes
285  for (i = func_offset; i < func_offset + overlap_size; ++i)
286  bytesValid[i] = true;
287 
288  // check the bit after the update we just made
289  for (; all_bytes_valid && i < getSize(); ++i)
290  all_bytes_valid &= bytesValid[i];
291 
292  return all_bytes_valid;
293  } else if (isWrite()) {
294  std::memcpy(_data + val_offset,
295  getConstPtr<uint8_t>() + func_offset,
296  overlap_size);
297  } else {
298  panic("Don't know how to handle command %s\n", cmdString());
299  }
300 
301  // keep going with request by default
302  return false;
303 }
304 
305 void
307 {
308  assert(isRequest());
309  // If we have already found a responder, no other cache should
310  // commit to responding
311  assert(!pkt->cacheResponding() || !cacheResponding());
312  flags.set(pkt->flags & RESPONDER_FLAGS);
313 }
314 
315 void
317 {
318  assert(sender_state != NULL);
319  sender_state->predecessor = senderState;
320  senderState = sender_state;
321 }
322 
325 {
326  assert(senderState != NULL);
327  SenderState *sender_state = senderState;
328  senderState = sender_state->predecessor;
329  sender_state->predecessor = NULL;
330  return sender_state;
331 }
332 
333 uint64_t
334 Packet::getUintX(ByteOrder endian) const
335 {
336  switch(getSize()) {
337  case 1:
338  return (uint64_t)get<uint8_t>(endian);
339  case 2:
340  return (uint64_t)get<uint16_t>(endian);
341  case 4:
342  return (uint64_t)get<uint32_t>(endian);
343  case 8:
344  return (uint64_t)get<uint64_t>(endian);
345  default:
346  panic("%i isn't a supported word size.\n", getSize());
347  }
348 }
349 
350 void
351 Packet::setUintX(uint64_t w, ByteOrder endian)
352 {
353  switch(getSize()) {
354  case 1:
355  set<uint8_t>((uint8_t)w, endian);
356  break;
357  case 2:
358  set<uint16_t>((uint16_t)w, endian);
359  break;
360  case 4:
361  set<uint32_t>((uint32_t)w, endian);
362  break;
363  case 8:
364  set<uint64_t>((uint64_t)w, endian);
365  break;
366  default:
367  panic("%i isn't a supported word size.\n", getSize());
368  }
369 
370 }
371 
372 void
373 Packet::print(std::ostream &o, const int verbosity,
374  const std::string &prefix) const
375 {
376  ccprintf(o, "%s%s [%x:%x]%s%s%s%s%s%s", prefix, cmdString(),
377  getAddr(), getAddr() + getSize() - 1,
378  req->isSecure() ? " (s)" : "",
379  req->isInstFetch() ? " IF" : "",
380  req->isUncacheable() ? " UC" : "",
381  isExpressSnoop() ? " ES" : "",
382  req->isToPOC() ? " PoC" : "",
383  req->isToPOU() ? " PoU" : "");
384 }
385 
386 std::string
387 Packet::print() const {
388  std::ostringstream str;
389  print(str);
390  return str.str();
391 }
392 
393 bool
394 Packet::matchBlockAddr(const Addr addr, const bool is_secure,
395  const int blk_size) const
396 {
397  return (getBlockAddr(blk_size) == addr) && (isSecure() == is_secure);
398 }
399 
400 bool
401 Packet::matchBlockAddr(const PacketPtr pkt, const int blk_size) const
402 {
403  return matchBlockAddr(pkt->getBlockAddr(blk_size), pkt->isSecure(),
404  blk_size);
405 }
406 
407 bool
408 Packet::matchAddr(const Addr addr, const bool is_secure) const
409 {
410  return (getAddr() == addr) && (isSecure() == is_secure);
411 }
412 
413 bool
414 Packet::matchAddr(const PacketPtr pkt) const
415 {
416  return matchAddr(pkt->getAddr(), pkt->isSecure());
417 }
418 
419 Packet::PrintReqState::PrintReqState(std::ostream &_os, int _verbosity)
420  : curPrefixPtr(new std::string("")), os(_os), verbosity(_verbosity)
421 {
422  labelStack.push_back(LabelStackEntry("", curPrefixPtr));
423 }
424 
426 {
427  labelStack.pop_back();
428  assert(labelStack.empty());
429  delete curPrefixPtr;
430 }
431 
433 LabelStackEntry::LabelStackEntry(const std::string &_label,
434  std::string *_prefix)
435  : label(_label), prefix(_prefix), labelPrinted(false)
436 {
437 }
438 
439 void
440 Packet::PrintReqState::pushLabel(const std::string &lbl,
441  const std::string &prefix)
442 {
443  labelStack.push_back(LabelStackEntry(lbl, curPrefixPtr));
444  curPrefixPtr = new std::string(*curPrefixPtr);
445  *curPrefixPtr += prefix;
446 }
447 
448 void
450 {
451  delete curPrefixPtr;
452  curPrefixPtr = labelStack.back().prefix;
453  labelStack.pop_back();
454  assert(!labelStack.empty());
455 }
456 
457 void
459 {
460  if (!labelStack.back().labelPrinted) {
461  LabelStack::iterator i = labelStack.begin();
462  LabelStack::iterator end = labelStack.end();
463  while (i != end) {
464  if (!i->labelPrinted) {
465  ccprintf(os, "%s%s\n", *(i->prefix), i->label);
466  i->labelPrinted = true;
467  }
468  i++;
469  }
470  }
471 }
472 
473 
474 void
476 {
477  printLabels();
478  obj->print(os, verbosity, curPrefix());
479 }
480 
481 void
483  const HtmCacheFailure htm_return_code)
484 {
485  assert(needsResponse());
486  assert(isRequest());
487 
488  cmd = cmd.responseCommand();
489 
490  setHtmTransactionFailedInCache(htm_return_code);
491 
492  // responses are never express, even if the snoop that
493  // triggered them was
495 }
496 
497 void
499  const HtmCacheFailure htm_return_code)
500 {
501  if (htm_return_code != HtmCacheFailure::NO_FAIL)
503 
504  htmReturnReason = htm_return_code;
505 }
506 
507 bool
509 {
510  return flags.isSet(FAILS_TRANSACTION);
511 }
512 
515 {
516  assert(htmTransactionFailedInCache());
517  return htmReturnReason;
518 }
519 
520 void
522 {
524  htmTransactionUid = htm_uid;
525 }
526 
527 bool
529 {
530  return flags.isSet(FROM_TRANSACTION);
531 }
532 
533 uint64_t
535 {
536  assert(flags.isSet(FROM_TRANSACTION));
537  return htmTransactionUid;
538 }
539 
540 } // namespace gem5
gem5::Packet::getBlockAddr
Addr getBlockAddr(unsigned int blk_size) const
Definition: packet.hh:805
gem5::Packet::EXPRESS_SNOOP
@ EXPRESS_SNOOP
Special timing-mode atomic snoop for multi-level coherence.
Definition: packet.hh:304
gem5::Packet::cmdString
const std::string & cmdString() const
Return the string name of the cmd field (for debugging and tracing).
Definition: packet.hh:577
gem5::Packet::PrintReqState::PrintReqState
PrintReqState(std::ostream &os, int verbosity=0)
Definition: packet.cc:419
gem5::Packet::FAILS_TRANSACTION
@ FAILS_TRANSACTION
Definition: packet.hh:328
gem5::Packet::isRequest
bool isRequest() const
Definition: packet.hh:586
gem5::Packet::getUintX
uint64_t getUintX(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness and zero-extended to 64 bits.
Definition: packet.cc:334
gem5::Packet::PrintReqState::labelStack
LabelStack labelStack
Definition: packet.hh:483
gem5::MipsISA::w
Bitfield< 0 > w
Definition: pra_constants.hh:281
gem5::Packet::size
unsigned size
The size of the request or transfer.
Definition: packet.hh:386
gem5::Packet::_isSecure
bool _isSecure
True if the request targets the secure memory space.
Definition: packet.hh:383
gem5::MemCmd::commandInfo
static const CommandInfo commandInfo[]
Array to map Command enum to associated info.
Definition: packet.hh:203
gem5::RangeSize
AddrRange RangeSize(Addr start, Addr size)
Definition: addr_range.hh:661
gem5::Packet::pushSenderState
void pushSenderState(SenderState *sender_state)
Push a new sender state to the packet and make the current sender state the predecessor of the new on...
Definition: packet.cc:316
gem5::HtmCacheFailure::NO_FAIL
@ NO_FAIL
gem5::Flags::set
void set(Type mask)
Set all flag's bits matching the given mask.
Definition: flags.hh:116
gem5::Packet::req
RequestPtr req
A pointer to the original request.
Definition: packet.hh:366
gem5::MemCmd::responseCommand
Command responseCommand() const
Definition: packet.hh:259
gem5::Flags::clear
void clear()
Clear all flag's bits.
Definition: flags.hh:102
gem5::Packet::htmTransactionUid
uint64_t htmTransactionUid
A global unique identifier of the transaction.
Definition: packet.hh:409
gem5::HtmCacheFailure
HtmCacheFailure
Definition: htm.hh:59
gem5::Packet::setHtmTransactional
void setHtmTransactional(uint64_t val)
Stipulates that this packet/request originates in the CPU executing in transactional mode,...
Definition: packet.cc:521
gem5::Packet::cacheResponding
bool cacheResponding() const
Definition: packet.hh:646
gem5::Packet::PrintReqState::pushLabel
void pushLabel(const std::string &lbl, const std::string &prefix=" ")
Push a label onto the label stack, and prepend the given prefix string onto the current prefix.
Definition: packet.cc:440
gem5::Packet::isWrite
bool isWrite() const
Definition: packet.hh:583
gem5::Packet::isSecure
bool isSecure() const
Definition: packet.hh:810
gem5::ArmISA::i
Bitfield< 7 > i
Definition: misc_types.hh:66
gem5::Packet::PrintReqState::printLabels
void printLabels()
Print all of the pending unprinted labels on the stack.
Definition: packet.cc:458
gem5::Packet::SenderState::predecessor
SenderState * predecessor
Definition: packet.hh:459
gem5::ccprintf
void ccprintf(cp::Print &print)
Definition: cprintf.hh:130
packet.hh
gem5::Printable
Abstract base class for objects which support being printed to a stream for debugging.
Definition: printable.hh:47
gem5::Packet::PrintReqState::curPrefixPtr
std::string * curPrefixPtr
Definition: packet.hh:485
gem5::Packet::PrintReqState::os
std::ostream & os
Definition: packet.hh:488
gem5::Packet::isRead
bool isRead() const
Definition: packet.hh:582
gem5::Flags::isSet
bool isSet(Type mask) const
Verifies whether any bit matching the given mask is set.
Definition: flags.hh:83
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:283
gem5::Packet::matchBlockAddr
bool matchBlockAddr(const Addr addr, const bool is_secure, const int blk_size) const
Check if packet corresponds to a given block-aligned address and address space.
Definition: packet.cc:394
gem5::Packet::htmTransactionFailedInCache
bool htmTransactionFailedInCache() const
Returns whether or not this packet/request has returned from the cache hierarchy in a failed transact...
Definition: packet.cc:508
gem5::Printable::print
virtual void print(std::ostream &os, int verbosity=0, const std::string &prefix="") const =0
gem5::Packet::PrintReqState::LabelStackEntry
An entry in the label stack.
Definition: packet.hh:474
gem5::Packet::htmReturnReason
HtmCacheFailure htmReturnReason
Holds the return status of the transaction.
Definition: packet.hh:403
gem5::Packet::getHtmTransactionUid
uint64_t getHtmTransactionUid() const
If a packet/request originates in a CPU executing in transactional mode, i.e.
Definition: packet.cc:534
gem5::Packet::matchAddr
bool matchAddr(const Addr addr, const bool is_secure) const
Check if packet corresponds to a given address and address space.
Definition: packet.cc:408
gem5::Packet::PrintReqState::curPrefix
const std::string & curPrefix()
Returns the current line prefix.
Definition: packet.hh:497
cprintf.hh
gem5::Packet::makeHtmTransactionalReqResponse
void makeHtmTransactionalReqResponse(const HtmCacheFailure ret_code)
Communicates to the core that a packet was processed by the memory subsystem while running in transac...
Definition: packet.cc:482
gem5::Packet::getHtmTransactionFailedInCacheRC
HtmCacheFailure getHtmTransactionFailedInCacheRC() const
If a packet/request has returned from the cache hierarchy in a failed transaction,...
Definition: packet.cc:514
gem5::Packet::SenderState
A virtual base opaque structure used to hold state associated with the packet (e.g....
Definition: packet.hh:457
gem5::Packet::cmd
MemCmd cmd
The command field of the packet.
Definition: packet.hh:361
gem5::Packet::isPrint
bool isPrint() const
Definition: packet.hh:611
gem5::Packet::needsResponse
bool needsResponse() const
Definition: packet.hh:597
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::Packet::senderState
SenderState * senderState
This packet's sender state.
Definition: packet.hh:534
gem5::Packet::flags
Flags flags
Definition: packet.hh:355
packet_access.hh
gem5::Packet::popSenderState
SenderState * popSenderState()
Pop the top of the state stack and return a pointer to it.
Definition: packet.cc:324
gem5::Packet::PrintReqState::printObj
void printObj(Printable *obj)
Print a Printable object to os, because it matched the address on a PrintReq.
Definition: packet.cc:475
gem5::Packet::PrintReqState::LabelStackEntry::LabelStackEntry
LabelStackEntry(const std::string &_label, std::string *_prefix)
Definition: packet.cc:433
gem5::Packet::RESPONDER_FLAGS
@ RESPONDER_FLAGS
Definition: packet.hh:296
std
Overload hash function for BasicBlockRange type.
Definition: types.hh:111
gem5::X86ISA::os
Bitfield< 17 > os
Definition: misc.hh:809
gem5::Packet::PrintReqState::~PrintReqState
~PrintReqState()
Definition: packet.cc:425
gem5::Packet::FROM_TRANSACTION
@ FROM_TRANSACTION
Definition: packet.hh:332
logging.hh
gem5::Packet::trySatisfyFunctional
bool trySatisfyFunctional(PacketPtr other)
Check a functional request against a memory value stored in another packet (i.e.
Definition: packet.hh:1358
gem5::Packet::PrintReqState::verbosity
const int verbosity
Definition: packet.hh:489
gem5::Packet::isExpressSnoop
bool isExpressSnoop() const
Definition: packet.hh:689
trace.hh
gem5::Packet::setHtmTransactionFailedInCache
void setHtmTransactionFailedInCache(const HtmCacheFailure ret_code)
Stipulates that this packet/request has returned from the cache hierarchy in a failed transaction.
Definition: packet.cc:498
gem5::Packet::PrintReqState::popLabel
void popLabel()
Pop a label off the label stack.
Definition: packet.cc:449
gem5::Packet::isHtmTransactional
bool isHtmTransactional() const
Returns whether or not this packet/request originates in the CPU executing in transactional mode,...
Definition: packet.cc:528
gem5::Packet::getAddr
Addr getAddr() const
Definition: packet.hh:781
gem5::Packet::copyResponderFlags
void copyResponderFlags(const PacketPtr pkt)
Copy the reponse flags from an input packet to this packet.
Definition: packet.cc:306
gem5::Packet::bytesValid
std::vector< bool > bytesValid
Track the bytes found that satisfy a functional read.
Definition: packet.hh:391
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::Packet::getAddrRange
AddrRange getAddrRange() const
Get address range to which this packet belongs.
Definition: packet.cc:225
gem5::Packet::print
std::string print() const
A no-args wrapper of print(std::ostream...) meant to be invoked from DPRINTFs avoiding string overhea...
Definition: packet.cc:387
gem5::Packet::setUintX
void setUintX(uint64_t w, ByteOrder endian)
Set the value in the word w after truncating it to the length of the packet and then byteswapping it ...
Definition: packet.cc:351
gem5::Packet::getSize
unsigned getSize() const
Definition: packet.hh:791
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:177
gem5::Packet::addr
Addr addr
The address of the request.
Definition: packet.hh:380
gem5::X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:84

Generated on Tue Sep 21 2021 12:25:33 for gem5 by doxygen 1.8.17