gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
packet.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-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 
47 #ifndef __MEM_PACKET_HH__
48 #define __MEM_PACKET_HH__
49 
50 #include <bitset>
51 #include <cassert>
52 #include <initializer_list>
53 #include <list>
54 
55 #include "base/addr_range.hh"
56 #include "base/cast.hh"
57 #include "base/compiler.hh"
58 #include "base/extensible.hh"
59 #include "base/flags.hh"
60 #include "base/logging.hh"
61 #include "base/printable.hh"
62 #include "base/types.hh"
63 #include "mem/htm.hh"
64 #include "mem/request.hh"
65 #include "sim/byteswap.hh"
66 
67 namespace gem5
68 {
69 
70 class Packet;
71 typedef Packet *PacketPtr;
72 typedef uint8_t* PacketDataPtr;
74 typedef uint64_t PacketId;
75 
76 class MemCmd
77 {
78  friend class Packet;
79 
80  public:
84  enum Command
85  {
95  WriteClean, // writes dirty data below without evicting
104  SCUpgradeReq, // Special "weak" upgrade for StoreCond
106  SCUpgradeFailReq, // Failed SCUpgradeReq in MSHR (never sent)
107  UpgradeFailResp, // Valid for SCUpgradeReq only
114  StoreCondFailReq, // Failed StoreCondReq in MSHR (never sent)
122  // MessageReq and MessageResp are deprecated.
124  MemSyncReq, // memory synchronization request (e.g., cache invalidate)
125  MemSyncResp, // memory synchronization response
131  // Error responses
132  // @TODO these should be classified as responses rather than
133  // requests; coding them as requests initially for backwards
134  // compatibility
135  InvalidDestError, // packet dest field invalid
136  BadAddressError, // memory address invalid
137  ReadError, // packet dest unable to fulfill read command
138  WriteError, // packet dest unable to fulfill write command
139  FunctionalReadError, // unable to fulfill functional read
140  FunctionalWriteError, // unable to fulfill functional write
141  // Fake simulator-only commands
142  PrintReq, // Print state matching address
143  FlushReq, //request for a cache flush
144  InvalidateReq, // request for address to be invalidated
146  // hardware transactional memory
150  // Tlb shootdown
153  };
154 
155  private:
160  {
181  };
182 
183  static constexpr unsigned long long
184  buildAttributes(std::initializer_list<Attribute> attrs)
185  {
186  unsigned long long ret = 0;
187  for (const auto &attr: attrs)
188  ret |= (1ULL << attr);
189  return ret;
190  }
191 
196  struct CommandInfo
197  {
199  const std::bitset<NUM_COMMAND_ATTRIBUTES> attributes;
204  const std::string str;
205 
206  CommandInfo(std::initializer_list<Attribute> attrs,
207  Command _response, const std::string &_str) :
208  attributes(buildAttributes(attrs)), response(_response), str(_str)
209  {}
210  };
211 
213  static const CommandInfo commandInfo[];
214 
215  private:
216 
218 
219  bool
221  {
222  return commandInfo[cmd].attributes[attrib] != 0;
223  }
224 
225  public:
226 
227  bool isRead() const { return testCmdAttrib(IsRead); }
228  bool isWrite() const { return testCmdAttrib(IsWrite); }
229  bool isUpgrade() const { return testCmdAttrib(IsUpgrade); }
230  bool isRequest() const { return testCmdAttrib(IsRequest); }
231  bool isResponse() const { return testCmdAttrib(IsResponse); }
232  bool needsWritable() const { return testCmdAttrib(NeedsWritable); }
233  bool needsResponse() const { return testCmdAttrib(NeedsResponse); }
234  bool isInvalidate() const { return testCmdAttrib(IsInvalidate); }
235  bool isEviction() const { return testCmdAttrib(IsEviction); }
236  bool isClean() const { return testCmdAttrib(IsClean); }
237  bool fromCache() const { return testCmdAttrib(FromCache); }
238 
242  bool isWriteback() const { return testCmdAttrib(IsEviction) &&
244 
250  bool hasData() const { return testCmdAttrib(HasData); }
251  bool isLLSC() const { return testCmdAttrib(IsLlsc); }
252  bool isLockedRMW() const { return testCmdAttrib(IsLockedRMW); }
253  bool isSWPrefetch() const { return testCmdAttrib(IsSWPrefetch); }
254  bool isHWPrefetch() const { return testCmdAttrib(IsHWPrefetch); }
255  bool isPrefetch() const { return testCmdAttrib(IsSWPrefetch) ||
257  bool isError() const { return testCmdAttrib(IsError); }
258  bool isPrint() const { return testCmdAttrib(IsPrint); }
259  bool isFlush() const { return testCmdAttrib(IsFlush); }
260 
261  bool
262  isDemand() const
263  {
264  return (cmd == ReadReq || cmd == WriteReq ||
265  cmd == WriteLineReq || cmd == ReadExReq ||
266  cmd == ReadCleanReq || cmd == ReadSharedReq);
267  }
268 
269  Command
271  {
272  return commandInfo[cmd].response;
273  }
274 
276  const std::string &toString() const { return commandInfo[cmd].str; }
277  int toInt() const { return (int)cmd; }
278 
279  MemCmd(Command _cmd) : cmd(_cmd) { }
280  MemCmd(int _cmd) : cmd((Command)_cmd) { }
282 
283  bool operator==(MemCmd c2) const { return (cmd == c2.cmd); }
284  bool operator!=(MemCmd c2) const { return (cmd != c2.cmd); }
285 };
286 
294 class Packet : public Printable, public Extensible<Packet>
295 {
296  public:
297  typedef uint32_t FlagsType;
299 
300  private:
301  enum : FlagsType
302  {
303  // Flags to transfer across when copying a packet
304  COPY_FLAGS = 0x000000FF,
305 
306  // Flags that are used to create reponse packets
307  RESPONDER_FLAGS = 0x00000009,
308 
309  // Does this packet have sharers (which means it should not be
310  // considered writable) or not. See setHasSharers below.
311  HAS_SHARERS = 0x00000001,
312 
313  // Special control flags
315  EXPRESS_SNOOP = 0x00000002,
316 
321 
322  // Snoop co-ordination flag to indicate that a cache is
323  // responding to a snoop. See setCacheResponding below.
324  CACHE_RESPONDING = 0x00000008,
325 
326  // The writeback/writeclean should be propagated further
327  // downstream by the receiver
328  WRITE_THROUGH = 0x00000010,
329 
330  // Response co-ordination flag for cache maintenance
331  // operations
332  SATISFIED = 0x00000020,
333 
334  // hardware transactional memory
335 
336  // Indicates that this packet/request has returned from the
337  // cache hierarchy in a failed transaction. The core is
338  // notified like this.
339  FAILS_TRANSACTION = 0x00000040,
340 
341  // Indicates that this packet/request originates in the CPU executing
342  // in transactional mode, i.e. in a transaction.
343  FROM_TRANSACTION = 0x00000080,
344 
346  VALID_ADDR = 0x00000100,
347  VALID_SIZE = 0x00000200,
348 
351  STATIC_DATA = 0x00001000,
355  DYNAMIC_DATA = 0x00002000,
356 
359  SUPPRESS_FUNC_ERROR = 0x00008000,
360 
361  // Signal block present to squash prefetch and cache evict packets
362  // through express snoop flag
363  BLOCK_CACHED = 0x00010000
364  };
365 
367 
368  public:
370 
373 
374  const PacketId id;
375 
378 
379  private:
388 
392 
394  bool _isSecure;
395 
397  unsigned size;
398 
403 
404  // Quality of Service priority value
405  uint8_t _qosValue;
406 
407  // hardware transactional memory
408 
415 
421 
422  public:
423 
431  uint32_t headerDelay;
432 
439  uint32_t snoopDelay;
440 
449  uint32_t payloadDelay;
450 
468  struct SenderState
469  {
472  virtual ~SenderState() {}
473  };
474 
479  class PrintReqState : public SenderState
480  {
481  private:
486  {
487  const std::string label;
488  std::string *prefix;
490  LabelStackEntry(const std::string &_label, std::string *_prefix);
491  };
492 
495 
496  std::string *curPrefixPtr;
497 
498  public:
499  std::ostream &os;
500  const int verbosity;
501 
502  PrintReqState(std::ostream &os, int verbosity = 0);
503  ~PrintReqState();
504 
508  const std::string &curPrefix() { return *curPrefixPtr; }
509 
515  void pushLabel(const std::string &lbl,
516  const std::string &prefix = " ");
517 
521  void popLabel();
522 
528  void printLabels();
529 
534  void printObj(Printable *obj);
535  };
536 
546 
555  void pushSenderState(SenderState *sender_state);
556 
566 
574  template <typename T>
576  {
577  T *t = NULL;
578  SenderState* sender_state = senderState;
579  while (t == NULL && sender_state != NULL) {
580  t = dynamic_cast<T*>(sender_state);
581  sender_state = sender_state->predecessor;
582  }
583  return t;
584  }
585 
588  const std::string &cmdString() const { return cmd.toString(); }
589 
591  inline int cmdToIndex() const { return cmd.toInt(); }
592 
593  bool isRead() const { return cmd.isRead(); }
594  bool isWrite() const { return cmd.isWrite(); }
595  bool isDemand() const { return cmd.isDemand(); }
596  bool isUpgrade() const { return cmd.isUpgrade(); }
597  bool isRequest() const { return cmd.isRequest(); }
598  bool isResponse() const { return cmd.isResponse(); }
599  bool needsWritable() const
600  {
601  // we should never check if a response needsWritable, the
602  // request has this flag, and for a response we should rather
603  // look at the hasSharers flag (if not set, the response is to
604  // be considered writable)
605  assert(isRequest());
606  return cmd.needsWritable();
607  }
608  bool needsResponse() const { return cmd.needsResponse(); }
609  bool isInvalidate() const { return cmd.isInvalidate(); }
610  bool isEviction() const { return cmd.isEviction(); }
611  bool isClean() const { return cmd.isClean(); }
612  bool fromCache() const { return cmd.fromCache(); }
613  bool isWriteback() const { return cmd.isWriteback(); }
614  bool hasData() const { return cmd.hasData(); }
615  bool hasRespData() const
616  {
617  MemCmd resp_cmd = cmd.responseCommand();
618  return resp_cmd.hasData();
619  }
620  bool isLLSC() const { return cmd.isLLSC(); }
621  bool isLockedRMW() const { return cmd.isLockedRMW(); }
622  bool isError() const { return cmd.isError(); }
623  bool isPrint() const { return cmd.isPrint(); }
624  bool isFlush() const { return cmd.isFlush(); }
625 
626  bool isWholeLineWrite(unsigned blk_size)
627  {
628  return (cmd == MemCmd::WriteReq || cmd == MemCmd::WriteLineReq) &&
629  getOffset(blk_size) == 0 && getSize() == blk_size &&
630  !isMaskedWrite();
631  }
632 
634 
654  {
655  assert(isRequest());
656  assert(!flags.isSet(CACHE_RESPONDING));
658  }
659  bool cacheResponding() const { return flags.isSet(CACHE_RESPONDING); }
686  bool hasSharers() const { return flags.isSet(HAS_SHARERS); }
688 
702  bool isExpressSnoop() const { return flags.isSet(EXPRESS_SNOOP); }
703 
714  {
715  assert(cacheResponding());
716  assert(!responderHadWritable());
718  }
719  bool responderHadWritable() const
720  { return flags.isSet(RESPONDER_HAD_WRITABLE); }
721 
729  void copyResponderFlags(const PacketPtr pkt);
730 
736  {
737  assert(cmd.isWrite() &&
740  }
742  bool writeThrough() const { return flags.isSet(WRITE_THROUGH); }
743 
750  {
751  assert(cmd.isClean());
752  assert(!flags.isSet(SATISFIED));
754  }
755  bool satisfied() const { return flags.isSet(SATISFIED); }
756 
760  bool isBlockCached() const { return flags.isSet(BLOCK_CACHED); }
762 
769  inline uint8_t qosValue() const { return _qosValue; }
770 
777  inline void qosValue(const uint8_t qos_value)
778  { _qosValue = qos_value; }
779 
780  inline RequestorID requestorId() const { return req->requestorId(); }
781 
782  // Network error conditions... encapsulate them as methods since
783  // their encoding keeps changing (from result field to command
784  // field, etc.)
785  void
787  {
788  assert(isResponse());
790  }
791 
792  // Command error conditions. The request is sent to target but the target
793  // cannot make it.
794  void
796  {
797  assert(isResponse());
798  if (isWrite()) {
800  } else {
802  }
803  }
804 
805  void copyError(Packet *pkt) { assert(pkt->isError()); cmd = pkt->cmd; }
806 
807  Addr getAddr() const { assert(flags.isSet(VALID_ADDR)); return addr; }
815  void setAddr(Addr _addr) { assert(flags.isSet(VALID_ADDR)); addr = _addr; }
816 
817  unsigned getSize() const { assert(flags.isSet(VALID_SIZE)); return size; }
818 
824  AddrRange getAddrRange() const;
825 
826  Addr getOffset(unsigned int blk_size) const
827  {
828  return getAddr() & Addr(blk_size - 1);
829  }
830 
831  Addr getBlockAddr(unsigned int blk_size) const
832  {
833  return getAddr() & ~(Addr(blk_size - 1));
834  }
835 
836  bool isSecure() const
837  {
838  assert(flags.isSet(VALID_ADDR));
839  return _isSecure;
840  }
841 
845  AtomicOpFunctor *getAtomicOp() const { return req->getAtomicOpFunctor(); }
846  bool isAtomicOp() const { return req->isAtomic(); }
847 
852  void
854  {
855  assert(isLLSC());
856  assert(isWrite());
858  }
859 
864  void
866  {
867  assert(isLLSC());
868  assert(isRead());
870  }
871 
877  Packet(const RequestPtr &_req, MemCmd _cmd)
878  : cmd(_cmd), id((PacketId)_req.get()), req(_req),
879  data(nullptr), addr(0), _isSecure(false), size(0),
880  _qosValue(0),
883  headerDelay(0), snoopDelay(0),
884  payloadDelay(0), senderState(NULL)
885  {
886  flags.clear();
887  if (req->hasPaddr()) {
888  addr = req->getPaddr();
890  _isSecure = req->isSecure();
891  }
892 
903  if (req->isHTMCmd()) {
905  assert(addr == 0x0);
906  }
907  if (req->hasSize()) {
908  size = req->getSize();
910  }
911  }
912 
918  Packet(const RequestPtr &_req, MemCmd _cmd, int _blkSize, PacketId _id = 0)
919  : cmd(_cmd), id(_id ? _id : (PacketId)_req.get()), req(_req),
920  data(nullptr), addr(0), _isSecure(false),
921  _qosValue(0),
924  headerDelay(0),
925  snoopDelay(0), payloadDelay(0), senderState(NULL)
926  {
927  flags.clear();
928  if (req->hasPaddr()) {
929  addr = req->getPaddr() & ~(_blkSize - 1);
931  _isSecure = req->isSecure();
932  }
933  size = _blkSize;
935  }
936 
944  Packet(const PacketPtr pkt, bool clear_flags, bool alloc_data)
945  : Extensible<Packet>(*pkt),
946  cmd(pkt->cmd), id(pkt->id), req(pkt->req),
947  data(nullptr),
948  addr(pkt->addr), _isSecure(pkt->_isSecure), size(pkt->size),
949  bytesValid(pkt->bytesValid),
950  _qosValue(pkt->qosValue()),
953  headerDelay(pkt->headerDelay),
954  snoopDelay(0),
957  {
958  if (!clear_flags)
959  flags.set(pkt->flags & COPY_FLAGS);
960 
961  flags.set(pkt->flags & (VALID_ADDR|VALID_SIZE));
962 
963  if (pkt->isHtmTransactional())
965 
966  if (pkt->htmTransactionFailedInCache()) {
969  );
970  }
971 
972  // should we allocate space for data, or not, the express
973  // snoops do not need to carry any data as they only serve to
974  // co-ordinate state changes
975  if (alloc_data) {
976  // even if asked to allocate data, if the original packet
977  // holds static data, then the sender will not be doing
978  // any memcpy on receiving the response, thus we simply
979  // carry the pointer forward
980  if (pkt->flags.isSet(STATIC_DATA)) {
981  data = pkt->data;
983  } else {
984  allocate();
985  }
986  }
987  }
988 
992  static MemCmd
994  {
995  if (req->isHTMCmd()) {
996  if (req->isHTMAbort())
997  return MemCmd::HTMAbort;
998  else
999  return MemCmd::HTMReq;
1000  } else if (req->isLLSC())
1001  return MemCmd::LoadLockedReq;
1002  else if (req->isPrefetchEx())
1003  return MemCmd::SoftPFExReq;
1004  else if (req->isPrefetch())
1005  return MemCmd::SoftPFReq;
1006  else if (req->isLockedRMW())
1007  return MemCmd::LockedRMWReadReq;
1008  else
1009  return MemCmd::ReadReq;
1010  }
1011 
1015  static MemCmd
1017  {
1018  if (req->isLLSC())
1019  return MemCmd::StoreCondReq;
1020  else if (req->isSwap() || req->isAtomic())
1021  return MemCmd::SwapReq;
1022  else if (req->isCacheInvalidate()) {
1023  return req->isCacheClean() ? MemCmd::CleanInvalidReq :
1025  } else if (req->isCacheClean()) {
1026  return MemCmd::CleanSharedReq;
1027  } else if (req->isLockedRMW()) {
1029  } else
1030  return MemCmd::WriteReq;
1031  }
1032 
1037  static PacketPtr
1039  {
1040  return new Packet(req, makeReadCmd(req));
1041  }
1042 
1043  static PacketPtr
1045  {
1046  return new Packet(req, makeWriteCmd(req));
1047  }
1048 
1053  {
1054  deleteData();
1055  }
1056 
1061  void
1063  {
1064  assert(needsResponse());
1065  assert(isRequest());
1066  cmd = cmd.responseCommand();
1067 
1068  // responses are never express, even if the snoop that
1069  // triggered them was
1071  }
1072 
1073  void
1075  {
1076  makeResponse();
1077  }
1078 
1079  void
1081  {
1082  makeResponse();
1083  }
1084 
1085  void
1087  {
1088  if (!success) {
1089  if (isWrite()) {
1091  } else {
1093  }
1094  }
1095  }
1096 
1097  void
1098  setSize(unsigned size)
1099  {
1100  assert(!flags.isSet(VALID_SIZE));
1101 
1102  this->size = size;
1103  flags.set(VALID_SIZE);
1104  }
1105 
1113  bool isGLCSet() const { return req->isGLCSet();}
1114  bool isSLCSet() const { return req->isSLCSet();}
1115 
1125  bool matchBlockAddr(const Addr addr, const bool is_secure,
1126  const int blk_size) const;
1127 
1136  bool matchBlockAddr(const PacketPtr pkt, const int blk_size) const;
1137 
1145  bool matchAddr(const Addr addr, const bool is_secure) const;
1146 
1154  bool matchAddr(const PacketPtr pkt) const;
1155 
1156  public:
1173  template <typename T>
1174  void
1176  {
1178  data = (PacketDataPtr)p;
1180  }
1181 
1190  template <typename T>
1191  void
1192  dataStaticConst(const T *p)
1193  {
1195  data = const_cast<PacketDataPtr>(p);
1197  }
1198 
1211  template <typename T>
1212  void
1214  {
1216  data = (PacketDataPtr)p;
1218  }
1219 
1223  template <typename T>
1224  T*
1226  {
1228  assert(!isMaskedWrite());
1229  return (T*)data;
1230  }
1231 
1232  template <typename T>
1233  const T*
1234  getConstPtr() const
1235  {
1237  return (const T*)data;
1238  }
1239 
1244  template <typename T>
1245  T getBE() const;
1246 
1251  template <typename T>
1252  T getLE() const;
1253 
1258  template <typename T>
1259  T get(ByteOrder endian) const;
1260 
1262  template <typename T>
1263  void setBE(T v);
1264 
1266  template <typename T>
1267  void setLE(T v);
1268 
1273  template <typename T>
1274  void set(T v, ByteOrder endian);
1275 
1280  uint64_t getUintX(ByteOrder endian) const;
1281 
1287  void setUintX(uint64_t w, ByteOrder endian);
1288 
1292  void
1293  setData(const uint8_t *p)
1294  {
1295  // we should never be copying data onto itself, which means we
1296  // must idenfity packets with static data, as they carry the
1297  // same pointer from source to destination and back
1298  assert(p != getPtr<uint8_t>() || flags.isSet(STATIC_DATA));
1299 
1300  if (p != getPtr<uint8_t>()) {
1301  // for packet with allocated dynamic data, we copy data from
1302  // one to the other, e.g. a forwarded response to a response
1303  std::memcpy(getPtr<uint8_t>(), p, getSize());
1304  }
1305  }
1306 
1311  void
1312  setDataFromBlock(const uint8_t *blk_data, int blkSize)
1313  {
1314  setData(blk_data + getOffset(blkSize));
1315  }
1316 
1321  void
1322  writeData(uint8_t *p) const
1323  {
1324  if (!isMaskedWrite()) {
1325  std::memcpy(p, getConstPtr<uint8_t>(), getSize());
1326  } else {
1327  assert(req->getByteEnable().size() == getSize());
1328  // Write only the enabled bytes
1329  const uint8_t *base = getConstPtr<uint8_t>();
1330  for (unsigned int i = 0; i < getSize(); i++) {
1331  if (req->getByteEnable()[i]) {
1332  p[i] = *(base + i);
1333  }
1334  // Disabled bytes stay untouched
1335  }
1336  }
1337  }
1338 
1345  void
1346  writeDataToBlock(uint8_t *blk_data, int blkSize) const
1347  {
1348  writeData(blk_data + getOffset(blkSize));
1349  }
1350 
1355  void
1357  {
1358  if (flags.isSet(DYNAMIC_DATA))
1359  delete [] data;
1360 
1362  data = NULL;
1363  }
1364 
1366  void
1368  {
1369  // if either this command or the response command has a data
1370  // payload, actually allocate space
1371  if (hasData() || hasRespData()) {
1374  data = new uint8_t[getSize()];
1375  }
1376  }
1377 
1381  template <typename T>
1382  T getRaw() const;
1383 
1385  template <typename T>
1386  void setRaw(T v);
1387 
1388  public:
1398  bool
1400  {
1401  if (other->isMaskedWrite()) {
1402  // Do not forward data if overlapping with a masked write
1403  if (_isSecure == other->isSecure() &&
1404  getAddr() <= (other->getAddr() + other->getSize() - 1) &&
1405  other->getAddr() <= (getAddr() + getSize() - 1)) {
1406  warn("Trying to check against a masked write, skipping."
1407  " (addr: 0x%x, other addr: 0x%x)", getAddr(),
1408  other->getAddr());
1409  }
1410  return false;
1411  }
1412  // all packets that are carrying a payload should have a valid
1413  // data pointer
1414  return trySatisfyFunctional(other, other->getAddr(), other->isSecure(),
1415  other->getSize(),
1416  other->hasData() ?
1417  other->getPtr<uint8_t>() : NULL);
1418  }
1419 
1424  bool
1426  {
1427  return cmd == MemCmd::HardPFReq || isEviction();
1428  }
1429 
1434  bool
1436  {
1438  }
1439 
1440  bool
1442  {
1443  return (cmd == MemCmd::WriteReq && req->isMasked());
1444  }
1445 
1453  bool
1454  trySatisfyFunctional(Printable *obj, Addr base, bool is_secure, int size,
1455  uint8_t *_data);
1456 
1460  void
1461  pushLabel(const std::string &lbl)
1462  {
1463  if (isPrint())
1464  safe_cast<PrintReqState*>(senderState)->pushLabel(lbl);
1465  }
1466 
1470  void
1472  {
1473  if (isPrint())
1474  safe_cast<PrintReqState*>(senderState)->popLabel();
1475  }
1476 
1477  void print(std::ostream &o, int verbosity = 0,
1478  const std::string &prefix = "") const;
1479 
1486  std::string print() const;
1487 
1488  // hardware transactional memory
1489 
1498  void makeHtmTransactionalReqResponse(const HtmCacheFailure ret_code);
1499 
1504  void setHtmTransactional(uint64_t val);
1505 
1510  bool isHtmTransactional() const;
1511 
1518  uint64_t getHtmTransactionUid() const;
1519 
1525  void setHtmTransactionFailedInCache(const HtmCacheFailure ret_code);
1526 
1532  bool htmTransactionFailedInCache() const;
1533 
1539 };
1540 
1541 } // namespace gem5
1542 
1543 #endif //__MEM_PACKET_HH
gem5::Packet::getBlockAddr
Addr getBlockAddr(unsigned int blk_size) const
Definition: packet.hh:831
gem5::Packet::makeWriteCmd
static MemCmd makeWriteCmd(const RequestPtr &req)
Generate the appropriate write MemCmd based on the Request flags.
Definition: packet.hh:1016
gem5::Packet::cmdString
const std::string & cmdString() const
Return the string name of the cmd field (for debugging and tracing).
Definition: packet.hh:588
gem5::Packet::BLOCK_CACHED
@ BLOCK_CACHED
Definition: packet.hh:363
gem5::MemCmd::StoreCondReq
@ StoreCondReq
Definition: packet.hh:113
gem5::Packet::isAtomicOp
bool isAtomicOp() const
Definition: packet.hh:846
gem5::Packet::PrintReqState::PrintReqState
PrintReqState(std::ostream &os, int verbosity=0)
Definition: packet.cc:414
gem5::Packet::isRequest
bool isRequest() const
Definition: packet.hh:597
warn
#define warn(...)
Definition: logging.hh:256
gem5::MemCmd::isClean
bool isClean() const
Definition: packet.hh:236
gem5::MemCmd::HasData
@ HasData
There is an associated payload.
Definition: packet.hh:175
gem5::Packet::setFunctionalResponseStatus
void setFunctionalResponseStatus(bool success)
Definition: packet.hh:1086
gem5::MemCmd::FunctionalReadError
@ FunctionalReadError
Definition: packet.hh:139
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:352
gem5::MemCmd::LockedRMWWriteReq
@ LockedRMWWriteReq
Definition: packet.hh:118
gem5::Packet::EXPRESS_SNOOP
@ EXPRESS_SNOOP
Special timing-mode atomic snoop for multi-level coherence.
Definition: packet.hh:315
gem5::MemCmd::WriteClean
@ WriteClean
Definition: packet.hh:95
gem5::Packet::PrintReqState::labelStack
LabelStack labelStack
Definition: packet.hh:494
gem5::Packet::setRaw
void setRaw(T v)
Set the value in the data pointer to v without byte swapping.
Definition: packet_access.hh:61
gem5::MemCmd::MemCmd
MemCmd(Command _cmd)
Definition: packet.hh:279
gem5::Packet::getOffset
Addr getOffset(unsigned int blk_size) const
Definition: packet.hh:826
gem5::MemCmd::CleanEvict
@ CleanEvict
Definition: packet.hh:96
gem5::Packet::size
unsigned size
The size of the request or transfer.
Definition: packet.hh:397
gem5::MemCmd::IsHWPrefetch
@ IsHWPrefetch
Definition: packet.hh:172
gem5::Packet::_isSecure
bool _isSecure
True if the request targets the secure memory space.
Definition: packet.hh:394
gem5::MemCmd::SwapReq
@ SwapReq
Definition: packet.hh:120
gem5::MemCmd::CleanSharedResp
@ CleanSharedResp
Definition: packet.hh:128
gem5::MemCmd::commandInfo
static const CommandInfo commandInfo[]
Array to map Command enum to associated info.
Definition: packet.hh:213
gem5::MemCmd::Attribute
Attribute
List of command attributes.
Definition: packet.hh:159
gem5::Packet::isCleanEviction
bool isCleanEviction() const
Is this packet a clean eviction, including both actual clean evict packets, but also clean writebacks...
Definition: packet.hh:1435
gem5::AtomicOpFunctor
Definition: amo.hh:43
gem5::MemCmd::ReadExResp
@ ReadExResp
Definition: packet.hh:109
gem5::MemCmd::IsInvalidate
@ IsInvalidate
Definition: packet.hh:164
gem5::Packet::findNextSenderState
T * findNextSenderState() const
Go through the sender state stack and return the first instance that is of type T (as determined by a...
Definition: packet.hh:575
gem5::Packet::setData
void setData(const uint8_t *p)
Copy data into the packet from the provided pointer.
Definition: packet.hh:1293
gem5::MemCmd::hasData
bool hasData() const
Check if this particular packet type carries payload data.
Definition: packet.hh:250
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:334
gem5::HtmCacheFailure::NO_FAIL
@ NO_FAIL
gem5::ArmISA::attr
attr
Definition: misc_types.hh:713
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:377
gem5::MemCmd::responseCommand
Command responseCommand() const
Definition: packet.hh:270
gem5::Packet::convertScToWrite
void convertScToWrite()
It has been determined that the SC packet should successfully update memory.
Definition: packet.hh:853
gem5::Packet::setBadAddress
void setBadAddress()
Definition: packet.hh:786
gem5::Packet::WRITE_THROUGH
@ WRITE_THROUGH
Definition: packet.hh:328
gem5::MemCmd::IsFlush
@ IsFlush
Flush the address from caches.
Definition: packet.hh:178
gem5::Packet::FROM_TRANSACTION
@ FROM_TRANSACTION
Definition: packet.hh:343
gem5::Flags::clear
void clear()
Clear all flag's bits.
Definition: flags.hh:102
gem5::MemCmd::FlushReq
@ FlushReq
Definition: packet.hh:143
gem5::Packet::data
PacketDataPtr data
A pointer to the data being transferred.
Definition: packet.hh:387
gem5::MemCmd::CommandInfo::str
const std::string str
String representation (for printing)
Definition: packet.hh:204
gem5::Extensible
Definition: extensible.hh:120
gem5::Packet::writeThrough
bool writeThrough() const
Definition: packet.hh:742
gem5::MemCmd::CleanInvalidReq
@ CleanInvalidReq
Definition: packet.hh:129
gem5::Packet::htmTransactionUid
uint64_t htmTransactionUid
A global unique identifier of the transaction.
Definition: packet.hh:420
htm.hh
gem5::MemCmd::buildAttributes
static constexpr unsigned long long buildAttributes(std::initializer_list< Attribute > attrs)
Definition: packet.hh:184
gem5::Packet::qosValue
uint8_t qosValue() const
QoS Value getter Returns 0 if QoS value was never set (constructor default).
Definition: packet.hh:769
gem5::HtmCacheFailure
HtmCacheFailure
Definition: htm.hh:59
gem5::Packet::setCacheResponding
void setCacheResponding()
Snoop flags.
Definition: packet.hh:653
gem5::MemCmd::needsResponse
bool needsResponse() const
Definition: packet.hh:233
gem5::Packet::isWriteback
bool isWriteback() const
Definition: packet.hh:613
gem5::Packet::setBadCommand
void setBadCommand()
Definition: packet.hh:795
gem5::MemCmd::isInvalidate
bool isInvalidate() const
Definition: packet.hh:234
gem5::Packet::~Packet
~Packet()
clean up packet variables
Definition: packet.hh:1052
gem5::Packet::setHtmTransactional
void setHtmTransactional(uint64_t val)
Stipulates that this packet/request originates in the CPU executing in transactional mode,...
Definition: packet.cc:516
gem5::X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:776
gem5::MemCmd::SoftPFResp
@ SoftPFResp
Definition: packet.hh:100
gem5::Packet::cacheResponding
bool cacheResponding() const
Definition: packet.hh:659
gem5::MemCmd::ReadSharedReq
@ ReadSharedReq
Definition: packet.hh:111
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:435
gem5::MemCmd::Command
Command
List of all commands associated with a packet.
Definition: packet.hh:84
gem5::Packet::copyError
void copyError(Packet *pkt)
Definition: packet.hh:805
gem5::Packet::isUpgrade
bool isUpgrade() const
Definition: packet.hh:596
gem5::MemCmd::SwapResp
@ SwapResp
Definition: packet.hh:121
cast.hh
gem5::Packet::isWrite
bool isWrite() const
Definition: packet.hh:594
gem5::Packet::isSecure
bool isSecure() const
Definition: packet.hh:836
gem5::MemCmd::NUM_MEM_CMDS
@ NUM_MEM_CMDS
Definition: packet.hh:152
gem5::Packet::setWriteThrough
void setWriteThrough()
A writeback/writeclean cmd gets propagated further downstream by the receiver when the flag is set.
Definition: packet.hh:735
gem5::Packet::hasSharers
bool hasSharers() const
Definition: packet.hh:686
gem5::Packet::createWrite
static PacketPtr createWrite(const RequestPtr &req)
Definition: packet.hh:1044
gem5::VegaISA::w
Bitfield< 6 > w
Definition: pagetable.hh:59
gem5::MemCmd::IsLlsc
@ IsLlsc
Alpha/MIPS LL or SC access.
Definition: packet.hh:173
gem5::MemCmd::UpgradeReq
@ UpgradeReq
Definition: packet.hh:103
std::vector< bool >
gem5::MemCmd::isWrite
bool isWrite() const
Definition: packet.hh:228
gem5::MemCmd::IsWrite
@ IsWrite
Data flows from requester to responder.
Definition: packet.hh:162
gem5::MemCmd::fromCache
bool fromCache() const
Definition: packet.hh:237
gem5::Packet::makeAtomicResponse
void makeAtomicResponse()
Definition: packet.hh:1074
gem5::Packet::PrintReqState::LabelStackEntry::labelPrinted
bool labelPrinted
Definition: packet.hh:489
gem5::Packet::setDataFromBlock
void setDataFromBlock(const uint8_t *blk_data, int blkSize)
Copy data into the packet from the provided block pointer, which is aligned to the given block size.
Definition: packet.hh:1312
gem5::MemCmd::isDemand
bool isDemand() const
Definition: packet.hh:262
gem5::X86ISA::base
Bitfield< 51, 12 > base
Definition: pagetable.hh:141
gem5::MemCmd::IsRequest
@ IsRequest
Issued by requester.
Definition: packet.hh:167
gem5::PacketDataPtr
uint8_t * PacketDataPtr
Definition: packet.hh:72
gem5::ArmISA::i
Bitfield< 7 > i
Definition: misc_types.hh:67
gem5::MemCmd::operator==
bool operator==(MemCmd c2) const
Definition: packet.hh:283
gem5::MemCmd::HardPFReq
@ HardPFReq
Definition: packet.hh:99
gem5::Packet::headerDelay
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
Definition: packet.hh:431
gem5::Packet::PrintReqState::LabelStackEntry::label
const std::string label
Definition: packet.hh:487
gem5::Packet::setSatisfied
void setSatisfied()
Set when a request hits in a cache and the cache is not going to respond.
Definition: packet.hh:749
gem5::Packet::Flags
gem5::Flags< FlagsType > Flags
Definition: packet.hh:298
gem5::Packet::PrintReqState::printLabels
void printLabels()
Print all of the pending unprinted labels on the stack.
Definition: packet.cc:453
gem5::Packet::VALID_ADDR
@ VALID_ADDR
Are the 'addr' and 'size' fields valid?
Definition: packet.hh:346
request.hh
gem5::Packet::snoopDelay
uint32_t snoopDelay
Keep track of the extra delay incurred by snooping upwards before sending a request down the memory s...
Definition: packet.hh:439
gem5::Packet::SenderState::predecessor
SenderState * predecessor
Definition: packet.hh:470
printable.hh
gem5::Packet::isGLCSet
bool isGLCSet() const
Accessor functions for the cache bypass flags.
Definition: packet.hh:1113
gem5::Packet::Packet
Packet(const RequestPtr &_req, MemCmd _cmd)
Constructor.
Definition: packet.hh:877
gem5::MemCmd::ReadCleanReq
@ ReadCleanReq
Definition: packet.hh:110
gem5::Packet::PrintReqState::LabelStackEntry::prefix
std::string * prefix
Definition: packet.hh:488
gem5::PacketPtr
Packet * PacketPtr
Definition: thread_context.hh:70
gem5::MemCmd::StoreCondFailReq
@ StoreCondFailReq
Definition: packet.hh:114
gem5::MemCmd::WritebackDirty
@ WritebackDirty
Definition: packet.hh:93
gem5::MemCmd::IsUpgrade
@ IsUpgrade
Definition: packet.hh:163
gem5::MemCmd::MemFenceResp
@ MemFenceResp
Definition: packet.hh:126
gem5::Packet::hasData
bool hasData() const
Definition: packet.hh:614
gem5::Packet::convertLlToRead
void convertLlToRead()
When ruby is in use, Ruby will monitor the cache line and the phys memory should treat LL ops as norm...
Definition: packet.hh:865
gem5::MemCmd::isError
bool isError() const
Definition: packet.hh:257
gem5::MemCmd
Definition: packet.hh:76
gem5::MemCmd::isResponse
bool isResponse() const
Definition: packet.hh:231
gem5::Packet::mustCheckAbove
bool mustCheckAbove() const
Does the request need to check for cached copies of the same block in the memory hierarchy above.
Definition: packet.hh:1425
gem5::Printable
Abstract base class for objects which support being printed to a stream for debugging.
Definition: printable.hh:47
gem5::Packet::getAtomicOp
AtomicOpFunctor * getAtomicOp() const
Accessor function to atomic op.
Definition: packet.hh:845
gem5::Packet::payloadDelay
uint32_t payloadDelay
The extra pipelining delay from seeing the packet until the end of payload is transmitted by the comp...
Definition: packet.hh:449
gem5::Packet::PrintReqState::curPrefixPtr
std::string * curPrefixPtr
Definition: packet.hh:496
gem5::Packet::dataStatic
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
Definition: packet.hh:1175
gem5::MemCmd::IsError
@ IsError
Error response.
Definition: packet.hh:176
gem5::MemCmd::CommandInfo::response
const Command response
Corresponding response for requests; InvalidCmd if no response is applicable.
Definition: packet.hh:202
gem5::Packet::HAS_SHARERS
@ HAS_SHARERS
Definition: packet.hh:311
gem5::SparcISA::int_reg::o
constexpr RegId o(int index)
Definition: int.hh:147
gem5::MemCmd::isEviction
bool isEviction() const
Definition: packet.hh:235
gem5::Packet::VALID_SIZE
@ VALID_SIZE
Definition: packet.hh:347
gem5::Flags< FlagsType >
gem5::MemCmd::HTMAbort
@ HTMAbort
Definition: packet.hh:149
gem5::Packet::PrintReqState::os
std::ostream & os
Definition: packet.hh:499
gem5::MemCmd::MemCmd
MemCmd(int _cmd)
Definition: packet.hh:280
gem5::Packet::isRead
bool isRead() const
Definition: packet.hh:593
gem5::Packet::needsWritable
bool needsWritable() const
Definition: packet.hh:599
gem5::MemCmd::NeedsWritable
@ NeedsWritable
Requires writable copy to complete in-cache.
Definition: packet.hh:166
gem5::MemCmd::CleanInvalidResp
@ CleanInvalidResp
Definition: packet.hh:130
gem5::MemCmd::WriteResp
@ WriteResp
Definition: packet.hh:91
gem5::VegaISA::t
Bitfield< 51 > t
Definition: pagetable.hh:56
gem5::MemCmd::SCUpgradeReq
@ SCUpgradeReq
Definition: packet.hh:104
gem5::Packet::getRaw
T getRaw() const
Get the data in the packet without byte swapping.
Definition: packet_access.hh:52
gem5::Packet::requestorId
RequestorID requestorId() const
Definition: packet.hh:780
gem5::VegaISA::p
Bitfield< 54 > p
Definition: pagetable.hh:70
gem5::Flags::isSet
bool isSet(Type mask) const
Verifies whether any bit matching the given mask is set.
Definition: flags.hh:83
gem5::Packet::getBE
T getBE() const
Get the data in the packet byte swapped from big endian to host endian.
Definition: packet_access.hh:71
gem5::PacketList
std::list< PacketPtr > PacketList
Definition: packet.hh:73
gem5::MemCmd::isRequest
bool isRequest() const
Definition: packet.hh:230
gem5::PacketId
uint64_t PacketId
Definition: packet.hh:74
gem5::MemCmd::WriteError
@ WriteError
Definition: packet.hh:138
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:294
gem5::MemCmd::UpgradeResp
@ UpgradeResp
Definition: packet.hh:105
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:389
gem5::Packet::setAddr
void setAddr(Addr _addr)
Update the address of this packet mid-transaction.
Definition: packet.hh:815
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:503
gem5::probing::Packet
ProbePointArg< PacketInfo > Packet
Packet probe point.
Definition: mem.hh:108
gem5::MemCmd::NUM_COMMAND_ATTRIBUTES
@ NUM_COMMAND_ATTRIBUTES
Definition: packet.hh:180
gem5::MemCmd::cmd
Command cmd
Definition: packet.hh:217
gem5::Packet::SenderState::~SenderState
virtual ~SenderState()
Definition: packet.hh:472
gem5::Packet::PrintReqState::LabelStackEntry
An entry in the label stack.
Definition: packet.hh:485
gem5::Packet::satisfied
bool satisfied() const
Definition: packet.hh:755
gem5::Packet::qosValue
void qosValue(const uint8_t qos_value)
QoS Value setter Interface for setting QoS priority value of the packet.
Definition: packet.hh:777
gem5::MemCmd::LoadLockedReq
@ LoadLockedReq
Definition: packet.hh:112
gem5::Packet::htmReturnReason
HtmCacheFailure htmReturnReason
Holds the return status of the transaction.
Definition: packet.hh:414
gem5::RequestPtr
std::shared_ptr< Request > RequestPtr
Definition: request.hh:92
gem5::Packet::getConstPtr
const T * getConstPtr() const
Definition: packet.hh:1234
gem5::MemCmd::ReadReq
@ ReadReq
Definition: packet.hh:87
gem5::MemCmd::MemSyncReq
@ MemSyncReq
Definition: packet.hh:124
gem5::Packet::DYNAMIC_DATA
@ DYNAMIC_DATA
The data pointer points to a value that should be freed when the packet is destroyed.
Definition: packet.hh:355
gem5::MemCmd::isHWPrefetch
bool isHWPrefetch() const
Definition: packet.hh:254
gem5::Packet::setBE
void setBE(T v)
Set the value in the data pointer to v as big endian.
Definition: packet_access.hh:101
gem5::Packet::getHtmTransactionUid
uint64_t getHtmTransactionUid() const
If a packet/request originates in a CPU executing in transactional mode, i.e.
Definition: packet.cc:529
gem5::MemCmd::testCmdAttrib
bool testCmdAttrib(MemCmd::Attribute attrib) const
Definition: packet.hh:220
gem5::Packet::suppressFuncError
bool suppressFuncError() const
Definition: packet.hh:758
gem5::MemCmd::toInt
int toInt() const
Definition: packet.hh:277
gem5::Packet::isSLCSet
bool isSLCSet() const
Definition: packet.hh:1114
gem5::Packet::isLLSC
bool isLLSC() const
Definition: packet.hh:620
gem5::MemCmd::WritebackClean
@ WritebackClean
Definition: packet.hh:94
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:403
gem5::Packet::PrintReqState::LabelStack
std::list< LabelStackEntry > LabelStack
Definition: packet.hh:493
gem5::Packet::setExpressSnoop
void setExpressSnoop()
The express snoop flag is used for two purposes.
Definition: packet.hh:701
gem5::Packet::clearBlockCached
void clearBlockCached()
Definition: packet.hh:761
gem5::Packet::PrintReqState::curPrefix
const std::string & curPrefix()
Returns the current line prefix.
Definition: packet.hh:508
gem5::MemCmd::CleanSharedReq
@ CleanSharedReq
Definition: packet.hh:127
extensible.hh
gem5::MemCmd::CommandInfo::CommandInfo
CommandInfo(std::initializer_list< Attribute > attrs, Command _response, const std::string &_str)
Definition: packet.hh:206
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:477
compiler.hh
gem5::Packet::id
const PacketId id
Definition: packet.hh:374
gem5::Packet::makeReadCmd
static MemCmd makeReadCmd(const RequestPtr &req)
Generate the appropriate read MemCmd based on the Request flags.
Definition: packet.hh:993
gem5::Packet::getHtmTransactionFailedInCacheRC
HtmCacheFailure getHtmTransactionFailedInCacheRC() const
If a packet/request has returned from the cache hierarchy in a failed transaction,...
Definition: packet.cc:509
gem5::Packet::_qosValue
uint8_t _qosValue
Definition: packet.hh:405
gem5::Packet::setResponderHadWritable
void setResponderHadWritable()
On responding to a snoop request (which only happens for Modified or Owned lines),...
Definition: packet.hh:713
gem5::MemCmd::isLockedRMW
bool isLockedRMW() const
Definition: packet.hh:252
gem5::Packet::pushLabel
void pushLabel(const std::string &lbl)
Push label for PrintReq (safe to call unconditionally).
Definition: packet.hh:1461
gem5::Packet::SenderState
A virtual base opaque structure used to hold state associated with the packet (e.g....
Definition: packet.hh:468
gem5::MemCmd::ReadExReq
@ ReadExReq
Definition: packet.hh:108
gem5::Packet::cmd
MemCmd cmd
The command field of the packet.
Definition: packet.hh:372
gem5::MemCmd::IsPrint
@ IsPrint
Print state matching address (for debugging)
Definition: packet.hh:177
gem5::Packet::isPrint
bool isPrint() const
Definition: packet.hh:623
gem5::MemCmd::isFlush
bool isFlush() const
Definition: packet.hh:259
gem5::Packet::deleteData
void deleteData()
delete the data pointed to in the data pointer.
Definition: packet.hh:1356
gem5::MemCmd::SoftPFExReq
@ SoftPFExReq
Definition: packet.hh:98
gem5::Packet::popLabel
void popLabel()
Pop label for PrintReq (safe to call unconditionally).
Definition: packet.hh:1471
gem5::Packet::responderHadWritable
bool responderHadWritable() const
Definition: packet.hh:719
gem5::MemCmd::TlbiExtSync
@ TlbiExtSync
Definition: packet.hh:151
gem5::Packet::needsResponse
bool needsResponse() const
Definition: packet.hh:608
gem5::Packet::writeData
void writeData(uint8_t *p) const
Copy data from the packet to the memory at the provided pointer.
Definition: packet.hh:1322
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::Packet::isError
bool isError() const
Definition: packet.hh:622
gem5::Packet::isLockedRMW
bool isLockedRMW() const
Definition: packet.hh:621
gem5::MemCmd::CommandInfo::attributes
const std::bitset< NUM_COMMAND_ATTRIBUTES > attributes
Set of attribute flags.
Definition: packet.hh:199
gem5::Packet::senderState
SenderState * senderState
This packet's sender state.
Definition: packet.hh:545
gem5::Packet::flags
Flags flags
Definition: packet.hh:366
gem5::MemCmd::LockedRMWReadResp
@ LockedRMWReadResp
Definition: packet.hh:117
flags.hh
gem5::MemCmd::SCUpgradeFailReq
@ SCUpgradeFailReq
Definition: packet.hh:106
addr_range.hh
gem5::Packet::popSenderState
SenderState * popSenderState()
Pop the top of the state stack and return a pointer to it.
Definition: packet.cc:342
gem5::MemCmd::InvalidateResp
@ InvalidateResp
Definition: packet.hh:145
gem5::MemCmd::toString
const std::string & toString() const
Return the string to a cmd given by idx.
Definition: packet.hh:276
gem5::Packet::RESPONDER_HAD_WRITABLE
@ RESPONDER_HAD_WRITABLE
Allow a responding cache to inform the cache hierarchy that it had a writable copy before responding.
Definition: packet.hh:320
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:470
gem5::Packet::dataStaticConst
void dataStaticConst(const T *p)
Set the data pointer to the following value that should not be freed.
Definition: packet.hh:1192
gem5::Packet::Command
MemCmd::Command Command
Definition: packet.hh:369
gem5::MemCmd::HTMReq
@ HTMReq
Definition: packet.hh:147
gem5::MemCmd::WriteCompleteResp
@ WriteCompleteResp
Definition: packet.hh:92
gem5::MemCmd::IsSWPrefetch
@ IsSWPrefetch
Definition: packet.hh:171
gem5::Packet::isClean
bool isClean() const
Definition: packet.hh:611
gem5::Packet::setHasSharers
void setHasSharers()
On fills, the hasSharers flag is used by the caches in combination with the cacheResponding flag,...
Definition: packet.hh:685
gem5::MemCmd::LockedRMWReadReq
@ LockedRMWReadReq
Definition: packet.hh:116
gem5::MemCmd::IsEviction
@ IsEviction
Definition: packet.hh:170
gem5::Packet::PrintReqState::LabelStackEntry::LabelStackEntry
LabelStackEntry(const std::string &_label, std::string *_prefix)
Definition: packet.cc:428
gem5::Packet::get
T get(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness.
Definition: packet_access.hh:85
gem5::Packet::COPY_FLAGS
@ COPY_FLAGS
Definition: packet.hh:304
gem5::VegaISA::v
Bitfield< 0 > v
Definition: pagetable.hh:65
gem5::MemCmd::BadAddressError
@ BadAddressError
Definition: packet.hh:136
gem5::Packet::makeTimingResponse
void makeTimingResponse()
Definition: packet.hh:1080
gem5::Packet::isFlush
bool isFlush() const
Definition: packet.hh:624
gem5::Packet::Packet
Packet(const RequestPtr &_req, MemCmd _cmd, int _blkSize, PacketId _id=0)
Alternate constructor if you are trying to create a packet with a request that is for a whole block,...
Definition: packet.hh:918
gem5::c2
c2
Definition: intmath.hh:174
gem5::Packet::allocate
void allocate()
Allocate memory for the packet.
Definition: packet.hh:1367
gem5::MemCmd::isSWPrefetch
bool isSWPrefetch() const
Definition: packet.hh:253
gem5::Packet::Packet
Packet(const PacketPtr pkt, bool clear_flags, bool alloc_data)
Alternate constructor for copying a packet.
Definition: packet.hh:944
types.hh
gem5::Packet::PrintReqState::~PrintReqState
~PrintReqState()
Definition: packet.cc:420
gem5::Packet::writeDataToBlock
void writeDataToBlock(uint8_t *blk_data, int blkSize) const
Copy data from the packet to the provided block pointer, which is aligned to the given block size.
Definition: packet.hh:1346
gem5::MemCmd::ReadResp
@ ReadResp
Definition: packet.hh:88
gem5::Packet::CACHE_RESPONDING
@ CACHE_RESPONDING
Definition: packet.hh:324
gem5::Packet::makeResponse
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
Definition: packet.hh:1062
gem5::Packet::dataDynamic
void dataDynamic(T *p)
Set the data pointer to a value that should have delete [] called on it.
Definition: packet.hh:1213
gem5::MemCmd::IsClean
@ IsClean
Cleans any existing dirty blocks.
Definition: packet.hh:165
gem5::MemCmd::MemCmd
MemCmd()
Definition: packet.hh:281
gem5::MemCmd::isPrint
bool isPrint() const
Definition: packet.hh:258
gem5::Packet::clearWriteThrough
void clearWriteThrough()
Definition: packet.hh:741
gem5::MemCmd::operator!=
bool operator!=(MemCmd c2) const
Definition: packet.hh:284
gem5::MemCmd::WriteReq
@ WriteReq
Definition: packet.hh:90
gem5::MemCmd::IsResponse
@ IsResponse
Issue by responder.
Definition: packet.hh:168
gem5::Packet::setBlockCached
void setBlockCached()
Definition: packet.hh:759
gem5::MemCmd::FunctionalWriteError
@ FunctionalWriteError
Definition: packet.hh:140
logging.hh
gem5::MemCmd::InvalidateReq
@ InvalidateReq
Definition: packet.hh:144
gem5::Packet::getLE
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
Definition: packet_access.hh:78
gem5::Packet::fromCache
bool fromCache() const
Definition: packet.hh:612
gem5::MemCmd::CommandInfo
Structure that defines attributes and other data associated with a Command.
Definition: packet.hh:196
gem5::MemCmd::MemFenceReq
@ MemFenceReq
Definition: packet.hh:123
gem5::Packet::trySatisfyFunctional
bool trySatisfyFunctional(PacketPtr other)
Check a functional request against a memory value stored in another packet (i.e.
Definition: packet.hh:1399
gem5::Packet::PrintReqState::verbosity
const int verbosity
Definition: packet.hh:500
gem5::Packet::SATISFIED
@ SATISFIED
Definition: packet.hh:332
gem5::Packet::SenderState::SenderState
SenderState()
Definition: packet.hh:471
gem5::Packet::STATIC_DATA
@ STATIC_DATA
Is the data pointer set to a value that shouldn't be freed when the packet is destroyed?
Definition: packet.hh:351
gem5::MemCmd::ReadError
@ ReadError
Definition: packet.hh:137
gem5::MemCmd::IsLockedRMW
@ IsLockedRMW
x86 locked RMW access
Definition: packet.hh:174
gem5::Packet::isExpressSnoop
bool isExpressSnoop() const
Definition: packet.hh:702
gem5::RequestorID
uint16_t RequestorID
Definition: request.hh:95
gem5::Packet::setLE
void setLE(T v)
Set the value in the data pointer to v as little endian.
Definition: packet_access.hh:108
gem5::MemCmd::isLLSC
bool isLLSC() const
Definition: packet.hh:251
gem5::MemCmd::PrintReq
@ PrintReq
Definition: packet.hh:142
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:493
gem5::MemCmd::StoreCondResp
@ StoreCondResp
Definition: packet.hh:115
gem5::MemCmd::isWriteback
bool isWriteback() const
A writeback is an eviction that carries data.
Definition: packet.hh:242
gem5::Packet::FlagsType
uint32_t FlagsType
Definition: packet.hh:297
gem5::Packet::isMaskedWrite
bool isMaskedWrite() const
Definition: packet.hh:1441
gem5::Packet::PrintReqState::popLabel
void popLabel()
Pop a label off the label stack.
Definition: packet.cc:444
gem5::Packet::isHtmTransactional
bool isHtmTransactional() const
Returns whether or not this packet/request originates in the CPU executing in transactional mode,...
Definition: packet.cc:523
gem5::AddrRange
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
Definition: addr_range.hh:81
std::list
STL list class.
Definition: stl.hh:51
gem5::Packet::getAddr
Addr getAddr() const
Definition: packet.hh:807
gem5::Packet::copyResponderFlags
void copyResponderFlags(const PacketPtr pkt)
Copy the reponse flags from an input packet to this packet.
Definition: packet.cc:324
gem5::Packet::bytesValid
std::vector< bool > bytesValid
Track the bytes found that satisfy a functional read.
Definition: packet.hh:402
gem5::Packet::SUPPRESS_FUNC_ERROR
@ SUPPRESS_FUNC_ERROR
suppress the error if this packet encounters a functional access failure.
Definition: packet.hh:359
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::MemCmd::FromCache
@ FromCache
Request originated from a caching agent.
Definition: packet.hh:179
gem5::MemCmd::MemSyncResp
@ MemSyncResp
Definition: packet.hh:125
gem5::MemCmd::InvalidCmd
@ InvalidCmd
Definition: packet.hh:86
gem5::Packet::createRead
static PacketPtr createRead(const RequestPtr &req)
Constructor-like methods that return Packets based on Request objects.
Definition: packet.hh:1038
gem5::Packet::getAddrRange
AddrRange getAddrRange() const
Get address range to which this packet belongs.
Definition: packet.cc:243
gem5::Packet::set
void set(T v, ByteOrder endian)
Set the value in the data pointer to v using the specified endianness.
Definition: packet_access.hh:115
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:382
gem5::Packet::cmdToIndex
int cmdToIndex() const
Return the index of this command.
Definition: packet.hh:591
gem5::MemCmd::isPrefetch
bool isPrefetch() const
Definition: packet.hh:255
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:361
gem5::Packet::RESPONDER_FLAGS
@ RESPONDER_FLAGS
Definition: packet.hh:307
gem5::Packet::FAILS_TRANSACTION
@ FAILS_TRANSACTION
Definition: packet.hh:339
gem5::MemCmd::ReadRespWithInvalidate
@ ReadRespWithInvalidate
Definition: packet.hh:89
gem5::MemCmd::isRead
bool isRead() const
Definition: packet.hh:227
gem5::MemCmd::NeedsResponse
@ NeedsResponse
Requester needs response from target.
Definition: packet.hh:169
gem5::MemCmd::HTMReqResp
@ HTMReqResp
Definition: packet.hh:148
gem5::Packet::setSuppressFuncError
void setSuppressFuncError()
Definition: packet.hh:757
gem5::Packet::isBlockCached
bool isBlockCached() const
Definition: packet.hh:760
gem5::Packet::isResponse
bool isResponse() const
Definition: packet.hh:598
gem5::MemCmd::WriteLineReq
@ WriteLineReq
Definition: packet.hh:102
gem5::Packet::getSize
unsigned getSize() const
Definition: packet.hh:817
gem5::MemCmd::UpgradeFailResp
@ UpgradeFailResp
Definition: packet.hh:107
gem5::Packet::isWholeLineWrite
bool isWholeLineWrite(unsigned blk_size)
Definition: packet.hh:626
gem5::MemCmd::IsRead
@ IsRead
Data flows from responder to requester.
Definition: packet.hh:161
gem5::Packet::hasRespData
bool hasRespData() const
Definition: packet.hh:615
gem5::MemCmd::needsWritable
bool needsWritable() const
Definition: packet.hh:232
byteswap.hh
gem5::Flags::noneSet
bool noneSet(Type mask) const
Verifies whether no bits matching the given mask are set.
Definition: flags.hh:99
gem5::Packet::isEviction
bool isEviction() const
Definition: packet.hh:610
gem5::Packet::isInvalidate
bool isInvalidate() const
Definition: packet.hh:609
gem5::Packet::addr
Addr addr
The address of the request.
Definition: packet.hh:391
gem5::MemCmd::HardPFResp
@ HardPFResp
Definition: packet.hh:101
gem5::MemCmd::LockedRMWWriteResp
@ LockedRMWWriteResp
Definition: packet.hh:119
gem5::Packet::isDemand
bool isDemand() const
Definition: packet.hh:595
gem5::Packet::getPtr
T * getPtr()
get a pointer to the data ptr.
Definition: packet.hh:1225
gem5::MemCmd::SoftPFReq
@ SoftPFReq
Definition: packet.hh:97
gem5::Packet::PrintReqState
Object used to maintain state of a PrintReq.
Definition: packet.hh:479
gem5::MemCmd::isUpgrade
bool isUpgrade() const
Definition: packet.hh:229
gem5::MemCmd::InvalidDestError
@ InvalidDestError
Definition: packet.hh:135
gem5::Packet::setSize
void setSize(unsigned size)
Definition: packet.hh:1098

Generated on Sun Jul 30 2023 01:56:58 for gem5 by doxygen 1.8.17