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

Generated on Wed Dec 21 2022 10:22:37 for gem5 by doxygen 1.9.1