gem5  v22.0.0.2
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/flags.hh"
59 #include "base/logging.hh"
60 #include "base/printable.hh"
61 #include "base/types.hh"
62 #include "mem/htm.hh"
63 #include "mem/request.hh"
64 #include "sim/byteswap.hh"
65 
66 namespace gem5
67 {
68 
69 class Packet;
70 typedef Packet *PacketPtr;
71 typedef uint8_t* PacketDataPtr;
73 typedef uint64_t PacketId;
74 
75 class MemCmd
76 {
77  friend class Packet;
78 
79  public:
83  enum Command
84  {
94  WriteClean, // writes dirty data below without evicting
103  SCUpgradeReq, // Special "weak" upgrade for StoreCond
105  SCUpgradeFailReq, // Failed SCUpgradeReq in MSHR (never sent)
106  UpgradeFailResp, // Valid for SCUpgradeReq only
113  StoreCondFailReq, // Failed StoreCondReq in MSHR (never sent)
121  // MessageReq and MessageResp are deprecated.
123  MemSyncReq, // memory synchronization request (e.g., cache invalidate)
124  MemSyncResp, // memory synchronization response
130  // Error responses
131  // @TODO these should be classified as responses rather than
132  // requests; coding them as requests initially for backwards
133  // compatibility
134  InvalidDestError, // packet dest field invalid
135  BadAddressError, // memory address invalid
136  FunctionalReadError, // unable to fulfill functional read
137  FunctionalWriteError, // unable to fulfill functional write
138  // Fake simulator-only commands
139  PrintReq, // Print state matching address
140  FlushReq, //request for a cache flush
141  InvalidateReq, // request for address to be invalidated
143  // hardware transactional memory
147  // Tlb shootdown
150  };
151 
152  private:
157  {
178  };
179 
180  static constexpr unsigned long long
181  buildAttributes(std::initializer_list<Attribute> attrs)
182  {
183  unsigned long long ret = 0;
184  for (const auto &attr: attrs)
185  ret |= (1ULL << attr);
186  return ret;
187  }
188 
193  struct CommandInfo
194  {
196  const std::bitset<NUM_COMMAND_ATTRIBUTES> attributes;
201  const std::string str;
202 
203  CommandInfo(std::initializer_list<Attribute> attrs,
204  Command _response, const std::string &_str) :
205  attributes(buildAttributes(attrs)), response(_response), str(_str)
206  {}
207  };
208 
210  static const CommandInfo commandInfo[];
211 
212  private:
213 
215 
216  bool
218  {
219  return commandInfo[cmd].attributes[attrib] != 0;
220  }
221 
222  public:
223 
224  bool isRead() const { return testCmdAttrib(IsRead); }
225  bool isWrite() const { return testCmdAttrib(IsWrite); }
226  bool isUpgrade() const { return testCmdAttrib(IsUpgrade); }
227  bool isRequest() const { return testCmdAttrib(IsRequest); }
228  bool isResponse() const { return testCmdAttrib(IsResponse); }
229  bool needsWritable() const { return testCmdAttrib(NeedsWritable); }
230  bool needsResponse() const { return testCmdAttrib(NeedsResponse); }
231  bool isInvalidate() const { return testCmdAttrib(IsInvalidate); }
232  bool isEviction() const { return testCmdAttrib(IsEviction); }
233  bool isClean() const { return testCmdAttrib(IsClean); }
234  bool fromCache() const { return testCmdAttrib(FromCache); }
235 
239  bool isWriteback() const { return testCmdAttrib(IsEviction) &&
241 
247  bool hasData() const { return testCmdAttrib(HasData); }
248  bool isLLSC() const { return testCmdAttrib(IsLlsc); }
249  bool isLockedRMW() const { return testCmdAttrib(IsLockedRMW); }
250  bool isSWPrefetch() const { return testCmdAttrib(IsSWPrefetch); }
251  bool isHWPrefetch() const { return testCmdAttrib(IsHWPrefetch); }
252  bool isPrefetch() const { return testCmdAttrib(IsSWPrefetch) ||
254  bool isError() const { return testCmdAttrib(IsError); }
255  bool isPrint() const { return testCmdAttrib(IsPrint); }
256  bool isFlush() const { return testCmdAttrib(IsFlush); }
257 
258  bool
259  isDemand() const
260  {
261  return (cmd == ReadReq || cmd == WriteReq ||
262  cmd == WriteLineReq || cmd == ReadExReq ||
263  cmd == ReadCleanReq || cmd == ReadSharedReq);
264  }
265 
266  Command
268  {
269  return commandInfo[cmd].response;
270  }
271 
273  const std::string &toString() const { return commandInfo[cmd].str; }
274  int toInt() const { return (int)cmd; }
275 
276  MemCmd(Command _cmd) : cmd(_cmd) { }
277  MemCmd(int _cmd) : cmd((Command)_cmd) { }
279 
280  bool operator==(MemCmd c2) const { return (cmd == c2.cmd); }
281  bool operator!=(MemCmd c2) const { return (cmd != c2.cmd); }
282 };
283 
291 class Packet : public Printable
292 {
293  public:
294  typedef uint32_t FlagsType;
296 
297  private:
298  enum : FlagsType
299  {
300  // Flags to transfer across when copying a packet
301  COPY_FLAGS = 0x000000FF,
302 
303  // Flags that are used to create reponse packets
304  RESPONDER_FLAGS = 0x00000009,
305 
306  // Does this packet have sharers (which means it should not be
307  // considered writable) or not. See setHasSharers below.
308  HAS_SHARERS = 0x00000001,
309 
310  // Special control flags
312  EXPRESS_SNOOP = 0x00000002,
313 
318 
319  // Snoop co-ordination flag to indicate that a cache is
320  // responding to a snoop. See setCacheResponding below.
321  CACHE_RESPONDING = 0x00000008,
322 
323  // The writeback/writeclean should be propagated further
324  // downstream by the receiver
325  WRITE_THROUGH = 0x00000010,
326 
327  // Response co-ordination flag for cache maintenance
328  // operations
329  SATISFIED = 0x00000020,
330 
331  // hardware transactional memory
332 
333  // Indicates that this packet/request has returned from the
334  // cache hierarchy in a failed transaction. The core is
335  // notified like this.
336  FAILS_TRANSACTION = 0x00000040,
337 
338  // Indicates that this packet/request originates in the CPU executing
339  // in transactional mode, i.e. in a transaction.
340  FROM_TRANSACTION = 0x00000080,
341 
343  VALID_ADDR = 0x00000100,
344  VALID_SIZE = 0x00000200,
345 
348  STATIC_DATA = 0x00001000,
352  DYNAMIC_DATA = 0x00002000,
353 
356  SUPPRESS_FUNC_ERROR = 0x00008000,
357 
358  // Signal block present to squash prefetch and cache evict packets
359  // through express snoop flag
360  BLOCK_CACHED = 0x00010000
361  };
362 
364 
365  public:
367 
370 
371  const PacketId id;
372 
375 
376  private:
385 
389 
391  bool _isSecure;
392 
394  unsigned size;
395 
400 
401  // Quality of Service priority value
402  uint8_t _qosValue;
403 
404  // hardware transactional memory
405 
412 
418 
419  public:
420 
428  uint32_t headerDelay;
429 
436  uint32_t snoopDelay;
437 
446  uint32_t payloadDelay;
447 
465  struct SenderState
466  {
469  virtual ~SenderState() {}
470  };
471 
476  class PrintReqState : public SenderState
477  {
478  private:
483  {
484  const std::string label;
485  std::string *prefix;
487  LabelStackEntry(const std::string &_label, std::string *_prefix);
488  };
489 
492 
493  std::string *curPrefixPtr;
494 
495  public:
496  std::ostream &os;
497  const int verbosity;
498 
499  PrintReqState(std::ostream &os, int verbosity = 0);
500  ~PrintReqState();
501 
505  const std::string &curPrefix() { return *curPrefixPtr; }
506 
512  void pushLabel(const std::string &lbl,
513  const std::string &prefix = " ");
514 
518  void popLabel();
519 
525  void printLabels();
526 
531  void printObj(Printable *obj);
532  };
533 
543 
552  void pushSenderState(SenderState *sender_state);
553 
563 
571  template <typename T>
573  {
574  T *t = NULL;
575  SenderState* sender_state = senderState;
576  while (t == NULL && sender_state != NULL) {
577  t = dynamic_cast<T*>(sender_state);
578  sender_state = sender_state->predecessor;
579  }
580  return t;
581  }
582 
585  const std::string &cmdString() const { return cmd.toString(); }
586 
588  inline int cmdToIndex() const { return cmd.toInt(); }
589 
590  bool isRead() const { return cmd.isRead(); }
591  bool isWrite() const { return cmd.isWrite(); }
592  bool isDemand() const { return cmd.isDemand(); }
593  bool isUpgrade() const { return cmd.isUpgrade(); }
594  bool isRequest() const { return cmd.isRequest(); }
595  bool isResponse() const { return cmd.isResponse(); }
596  bool needsWritable() const
597  {
598  // we should never check if a response needsWritable, the
599  // request has this flag, and for a response we should rather
600  // look at the hasSharers flag (if not set, the response is to
601  // be considered writable)
602  assert(isRequest());
603  return cmd.needsWritable();
604  }
605  bool needsResponse() const { return cmd.needsResponse(); }
606  bool isInvalidate() const { return cmd.isInvalidate(); }
607  bool isEviction() const { return cmd.isEviction(); }
608  bool isClean() const { return cmd.isClean(); }
609  bool fromCache() const { return cmd.fromCache(); }
610  bool isWriteback() const { return cmd.isWriteback(); }
611  bool hasData() const { return cmd.hasData(); }
612  bool hasRespData() const
613  {
614  MemCmd resp_cmd = cmd.responseCommand();
615  return resp_cmd.hasData();
616  }
617  bool isLLSC() const { return cmd.isLLSC(); }
618  bool isLockedRMW() const { return cmd.isLockedRMW(); }
619  bool isError() const { return cmd.isError(); }
620  bool isPrint() const { return cmd.isPrint(); }
621  bool isFlush() const { return cmd.isFlush(); }
622 
623  bool isWholeLineWrite(unsigned blk_size)
624  {
625  return (cmd == MemCmd::WriteReq || cmd == MemCmd::WriteLineReq) &&
626  getOffset(blk_size) == 0 && getSize() == blk_size;
627  }
628 
630 
650  {
651  assert(isRequest());
652  assert(!flags.isSet(CACHE_RESPONDING));
654  }
655  bool cacheResponding() const { return flags.isSet(CACHE_RESPONDING); }
682  bool hasSharers() const { return flags.isSet(HAS_SHARERS); }
684 
698  bool isExpressSnoop() const { return flags.isSet(EXPRESS_SNOOP); }
699 
710  {
711  assert(cacheResponding());
712  assert(!responderHadWritable());
714  }
715  bool responderHadWritable() const
716  { return flags.isSet(RESPONDER_HAD_WRITABLE); }
717 
725  void copyResponderFlags(const PacketPtr pkt);
726 
732  {
733  assert(cmd.isWrite() &&
736  }
738  bool writeThrough() const { return flags.isSet(WRITE_THROUGH); }
739 
746  {
747  assert(cmd.isClean());
748  assert(!flags.isSet(SATISFIED));
750  }
751  bool satisfied() const { return flags.isSet(SATISFIED); }
752 
756  bool isBlockCached() const { return flags.isSet(BLOCK_CACHED); }
758 
765  inline uint8_t qosValue() const { return _qosValue; }
766 
773  inline void qosValue(const uint8_t qos_value)
774  { _qosValue = qos_value; }
775 
776  inline RequestorID requestorId() const { return req->requestorId(); }
777 
778  // Network error conditions... encapsulate them as methods since
779  // their encoding keeps changing (from result field to command
780  // field, etc.)
781  void
783  {
784  assert(isResponse());
786  }
787 
788  void copyError(Packet *pkt) { assert(pkt->isError()); cmd = pkt->cmd; }
789 
790  Addr getAddr() const { assert(flags.isSet(VALID_ADDR)); return addr; }
798  void setAddr(Addr _addr) { assert(flags.isSet(VALID_ADDR)); addr = _addr; }
799 
800  unsigned getSize() const { assert(flags.isSet(VALID_SIZE)); return size; }
801 
807  AddrRange getAddrRange() const;
808 
809  Addr getOffset(unsigned int blk_size) const
810  {
811  return getAddr() & Addr(blk_size - 1);
812  }
813 
814  Addr getBlockAddr(unsigned int blk_size) const
815  {
816  return getAddr() & ~(Addr(blk_size - 1));
817  }
818 
819  bool isSecure() const
820  {
821  assert(flags.isSet(VALID_ADDR));
822  return _isSecure;
823  }
824 
828  AtomicOpFunctor *getAtomicOp() const { return req->getAtomicOpFunctor(); }
829  bool isAtomicOp() const { return req->isAtomic(); }
830 
835  void
837  {
838  assert(isLLSC());
839  assert(isWrite());
841  }
842 
847  void
849  {
850  assert(isLLSC());
851  assert(isRead());
853  }
854 
860  Packet(const RequestPtr &_req, MemCmd _cmd)
861  : cmd(_cmd), id((PacketId)_req.get()), req(_req),
862  data(nullptr), addr(0), _isSecure(false), size(0),
863  _qosValue(0),
866  headerDelay(0), snoopDelay(0),
867  payloadDelay(0), senderState(NULL)
868  {
869  flags.clear();
870  if (req->hasPaddr()) {
871  addr = req->getPaddr();
873  _isSecure = req->isSecure();
874  }
875 
886  if (req->isHTMCmd()) {
888  assert(addr == 0x0);
889  }
890  if (req->hasSize()) {
891  size = req->getSize();
893  }
894  }
895 
901  Packet(const RequestPtr &_req, MemCmd _cmd, int _blkSize, PacketId _id = 0)
902  : cmd(_cmd), id(_id ? _id : (PacketId)_req.get()), req(_req),
903  data(nullptr), addr(0), _isSecure(false),
904  _qosValue(0),
907  headerDelay(0),
908  snoopDelay(0), payloadDelay(0), senderState(NULL)
909  {
910  flags.clear();
911  if (req->hasPaddr()) {
912  addr = req->getPaddr() & ~(_blkSize - 1);
914  _isSecure = req->isSecure();
915  }
916  size = _blkSize;
918  }
919 
927  Packet(const PacketPtr pkt, bool clear_flags, bool alloc_data)
928  : cmd(pkt->cmd), id(pkt->id), req(pkt->req),
929  data(nullptr),
930  addr(pkt->addr), _isSecure(pkt->_isSecure), size(pkt->size),
931  bytesValid(pkt->bytesValid),
932  _qosValue(pkt->qosValue()),
935  headerDelay(pkt->headerDelay),
936  snoopDelay(0),
939  {
940  if (!clear_flags)
941  flags.set(pkt->flags & COPY_FLAGS);
942 
943  flags.set(pkt->flags & (VALID_ADDR|VALID_SIZE));
944 
945  if (pkt->isHtmTransactional())
947 
948  if (pkt->htmTransactionFailedInCache()) {
951  );
952  }
953 
954  // should we allocate space for data, or not, the express
955  // snoops do not need to carry any data as they only serve to
956  // co-ordinate state changes
957  if (alloc_data) {
958  // even if asked to allocate data, if the original packet
959  // holds static data, then the sender will not be doing
960  // any memcpy on receiving the response, thus we simply
961  // carry the pointer forward
962  if (pkt->flags.isSet(STATIC_DATA)) {
963  data = pkt->data;
965  } else {
966  allocate();
967  }
968  }
969  }
970 
974  static MemCmd
976  {
977  if (req->isHTMCmd()) {
978  if (req->isHTMAbort())
979  return MemCmd::HTMAbort;
980  else
981  return MemCmd::HTMReq;
982  } else if (req->isLLSC())
983  return MemCmd::LoadLockedReq;
984  else if (req->isPrefetchEx())
985  return MemCmd::SoftPFExReq;
986  else if (req->isPrefetch())
987  return MemCmd::SoftPFReq;
988  else if (req->isLockedRMW())
990  else
991  return MemCmd::ReadReq;
992  }
993 
997  static MemCmd
999  {
1000  if (req->isLLSC())
1001  return MemCmd::StoreCondReq;
1002  else if (req->isSwap() || req->isAtomic())
1003  return MemCmd::SwapReq;
1004  else if (req->isCacheInvalidate()) {
1005  return req->isCacheClean() ? MemCmd::CleanInvalidReq :
1007  } else if (req->isCacheClean()) {
1008  return MemCmd::CleanSharedReq;
1009  } else if (req->isLockedRMW()) {
1011  } else
1012  return MemCmd::WriteReq;
1013  }
1014 
1019  static PacketPtr
1021  {
1022  return new Packet(req, makeReadCmd(req));
1023  }
1024 
1025  static PacketPtr
1027  {
1028  return new Packet(req, makeWriteCmd(req));
1029  }
1030 
1035  {
1036  deleteData();
1037  }
1038 
1043  void
1045  {
1046  assert(needsResponse());
1047  assert(isRequest());
1048  cmd = cmd.responseCommand();
1049 
1050  // responses are never express, even if the snoop that
1051  // triggered them was
1053  }
1054 
1055  void
1057  {
1058  makeResponse();
1059  }
1060 
1061  void
1063  {
1064  makeResponse();
1065  }
1066 
1067  void
1069  {
1070  if (!success) {
1071  if (isWrite()) {
1073  } else {
1075  }
1076  }
1077  }
1078 
1079  void
1080  setSize(unsigned size)
1081  {
1082  assert(!flags.isSet(VALID_SIZE));
1083 
1084  this->size = size;
1085  flags.set(VALID_SIZE);
1086  }
1087 
1097  bool matchBlockAddr(const Addr addr, const bool is_secure,
1098  const int blk_size) const;
1099 
1108  bool matchBlockAddr(const PacketPtr pkt, const int blk_size) const;
1109 
1117  bool matchAddr(const Addr addr, const bool is_secure) const;
1118 
1126  bool matchAddr(const PacketPtr pkt) const;
1127 
1128  public:
1145  template <typename T>
1146  void
1148  {
1150  data = (PacketDataPtr)p;
1152  }
1153 
1162  template <typename T>
1163  void
1164  dataStaticConst(const T *p)
1165  {
1167  data = const_cast<PacketDataPtr>(p);
1169  }
1170 
1183  template <typename T>
1184  void
1186  {
1188  data = (PacketDataPtr)p;
1190  }
1191 
1195  template <typename T>
1196  T*
1198  {
1200  assert(!isMaskedWrite());
1201  return (T*)data;
1202  }
1203 
1204  template <typename T>
1205  const T*
1206  getConstPtr() const
1207  {
1209  return (const T*)data;
1210  }
1211 
1216  template <typename T>
1217  T getBE() const;
1218 
1223  template <typename T>
1224  T getLE() const;
1225 
1230  template <typename T>
1231  T get(ByteOrder endian) const;
1232 
1234  template <typename T>
1235  void setBE(T v);
1236 
1238  template <typename T>
1239  void setLE(T v);
1240 
1245  template <typename T>
1246  void set(T v, ByteOrder endian);
1247 
1252  uint64_t getUintX(ByteOrder endian) const;
1253 
1259  void setUintX(uint64_t w, ByteOrder endian);
1260 
1264  void
1265  setData(const uint8_t *p)
1266  {
1267  // we should never be copying data onto itself, which means we
1268  // must idenfity packets with static data, as they carry the
1269  // same pointer from source to destination and back
1270  assert(p != getPtr<uint8_t>() || flags.isSet(STATIC_DATA));
1271 
1272  if (p != getPtr<uint8_t>()) {
1273  // for packet with allocated dynamic data, we copy data from
1274  // one to the other, e.g. a forwarded response to a response
1275  std::memcpy(getPtr<uint8_t>(), p, getSize());
1276  }
1277  }
1278 
1283  void
1284  setDataFromBlock(const uint8_t *blk_data, int blkSize)
1285  {
1286  setData(blk_data + getOffset(blkSize));
1287  }
1288 
1293  void
1294  writeData(uint8_t *p) const
1295  {
1296  if (!isMaskedWrite()) {
1297  std::memcpy(p, getConstPtr<uint8_t>(), getSize());
1298  } else {
1299  assert(req->getByteEnable().size() == getSize());
1300  // Write only the enabled bytes
1301  const uint8_t *base = getConstPtr<uint8_t>();
1302  for (unsigned int i = 0; i < getSize(); i++) {
1303  if (req->getByteEnable()[i]) {
1304  p[i] = *(base + i);
1305  }
1306  // Disabled bytes stay untouched
1307  }
1308  }
1309  }
1310 
1317  void
1318  writeDataToBlock(uint8_t *blk_data, int blkSize) const
1319  {
1320  writeData(blk_data + getOffset(blkSize));
1321  }
1322 
1327  void
1329  {
1330  if (flags.isSet(DYNAMIC_DATA))
1331  delete [] data;
1332 
1334  data = NULL;
1335  }
1336 
1338  void
1340  {
1341  // if either this command or the response command has a data
1342  // payload, actually allocate space
1343  if (hasData() || hasRespData()) {
1346  data = new uint8_t[getSize()];
1347  }
1348  }
1349 
1353  template <typename T>
1354  T getRaw() const;
1355 
1357  template <typename T>
1358  void setRaw(T v);
1359 
1360  public:
1370  bool
1372  {
1373  if (other->isMaskedWrite()) {
1374  // Do not forward data if overlapping with a masked write
1375  if (_isSecure == other->isSecure() &&
1376  getAddr() <= (other->getAddr() + other->getSize() - 1) &&
1377  other->getAddr() <= (getAddr() + getSize() - 1)) {
1378  warn("Trying to check against a masked write, skipping."
1379  " (addr: 0x%x, other addr: 0x%x)", getAddr(),
1380  other->getAddr());
1381  }
1382  return false;
1383  }
1384  // all packets that are carrying a payload should have a valid
1385  // data pointer
1386  return trySatisfyFunctional(other, other->getAddr(), other->isSecure(),
1387  other->getSize(),
1388  other->hasData() ?
1389  other->getPtr<uint8_t>() : NULL);
1390  }
1391 
1396  bool
1398  {
1399  return cmd == MemCmd::HardPFReq || isEviction();
1400  }
1401 
1406  bool
1408  {
1410  }
1411 
1412  bool
1414  {
1415  return (cmd == MemCmd::WriteReq && req->isMasked());
1416  }
1417 
1425  bool
1426  trySatisfyFunctional(Printable *obj, Addr base, bool is_secure, int size,
1427  uint8_t *_data);
1428 
1432  void
1433  pushLabel(const std::string &lbl)
1434  {
1435  if (isPrint())
1436  safe_cast<PrintReqState*>(senderState)->pushLabel(lbl);
1437  }
1438 
1442  void
1444  {
1445  if (isPrint())
1446  safe_cast<PrintReqState*>(senderState)->popLabel();
1447  }
1448 
1449  void print(std::ostream &o, int verbosity = 0,
1450  const std::string &prefix = "") const;
1451 
1458  std::string print() const;
1459 
1460  // hardware transactional memory
1461 
1470  void makeHtmTransactionalReqResponse(const HtmCacheFailure ret_code);
1471 
1476  void setHtmTransactional(uint64_t val);
1477 
1482  bool isHtmTransactional() const;
1483 
1490  uint64_t getHtmTransactionUid() const;
1491 
1497  void setHtmTransactionFailedInCache(const HtmCacheFailure ret_code);
1498 
1504  bool htmTransactionFailedInCache() const;
1505 
1511 };
1512 
1513 } // namespace gem5
1514 
1515 #endif //__MEM_PACKET_HH
gem5::Packet::getBlockAddr
Addr getBlockAddr(unsigned int blk_size) const
Definition: packet.hh:814
gem5::Packet::makeWriteCmd
static MemCmd makeWriteCmd(const RequestPtr &req)
Generate the appropriate write MemCmd based on the Request flags.
Definition: packet.hh:998
gem5::Packet::cmdString
const std::string & cmdString() const
Return the string name of the cmd field (for debugging and tracing).
Definition: packet.hh:585
gem5::MemCmd::StoreCondReq
@ StoreCondReq
Definition: packet.hh:112
gem5::Packet::isAtomicOp
bool isAtomicOp() const
Definition: packet.hh:829
gem5::Packet::PrintReqState::PrintReqState
PrintReqState(std::ostream &os, int verbosity=0)
Definition: packet.cc:410
gem5::Packet::isRequest
bool isRequest() const
Definition: packet.hh:594
warn
#define warn(...)
Definition: logging.hh:246
gem5::MemCmd::isClean
bool isClean() const
Definition: packet.hh:233
gem5::MemCmd::HasData
@ HasData
There is an associated payload.
Definition: packet.hh:172
gem5::Packet::setFunctionalResponseStatus
void setFunctionalResponseStatus(bool success)
Definition: packet.hh:1068
gem5::MemCmd::FunctionalReadError
@ FunctionalReadError
Definition: packet.hh:136
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:348
gem5::MemCmd::LockedRMWWriteReq
@ LockedRMWWriteReq
Definition: packet.hh:117
gem5::MemCmd::WriteClean
@ WriteClean
Definition: packet.hh:94
gem5::Packet::PrintReqState::labelStack
LabelStack labelStack
Definition: packet.hh:491
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:276
gem5::Packet::getOffset
Addr getOffset(unsigned int blk_size) const
Definition: packet.hh:809
gem5::Packet::WRITE_THROUGH
@ WRITE_THROUGH
Definition: packet.hh:325
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:348
gem5::MemCmd::CleanEvict
@ CleanEvict
Definition: packet.hh:95
gem5::Packet::size
unsigned size
The size of the request or transfer.
Definition: packet.hh:394
gem5::MemCmd::IsHWPrefetch
@ IsHWPrefetch
Definition: packet.hh:169
gem5::Packet::_isSecure
bool _isSecure
True if the request targets the secure memory space.
Definition: packet.hh:391
gem5::Packet::SUPPRESS_FUNC_ERROR
@ SUPPRESS_FUNC_ERROR
suppress the error if this packet encounters a functional access failure.
Definition: packet.hh:356
gem5::Packet::EXPRESS_SNOOP
@ EXPRESS_SNOOP
Special timing-mode atomic snoop for multi-level coherence.
Definition: packet.hh:312
gem5::MemCmd::SwapReq
@ SwapReq
Definition: packet.hh:119
gem5::MemCmd::CleanSharedResp
@ CleanSharedResp
Definition: packet.hh:127
gem5::MemCmd::commandInfo
static const CommandInfo commandInfo[]
Array to map Command enum to associated info.
Definition: packet.hh:210
gem5::MemCmd::Attribute
Attribute
List of command attributes.
Definition: packet.hh:156
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:1407
gem5::AtomicOpFunctor
Definition: amo.hh:43
gem5::MemCmd::ReadExResp
@ ReadExResp
Definition: packet.hh:108
gem5::MemCmd::IsInvalidate
@ IsInvalidate
Definition: packet.hh:161
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:572
gem5::Packet::setData
void setData(const uint8_t *p)
Copy data into the packet from the provided pointer.
Definition: packet.hh:1265
gem5::MemCmd::hasData
bool hasData() const
Check if this particular packet type carries payload data.
Definition: packet.hh:247
gem5::Packet::CACHE_RESPONDING
@ CACHE_RESPONDING
Definition: packet.hh:321
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:330
gem5::HtmCacheFailure::NO_FAIL
@ NO_FAIL
gem5::ArmISA::attr
attr
Definition: misc_types.hh:656
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:374
gem5::MemCmd::responseCommand
Command responseCommand() const
Definition: packet.hh:267
gem5::Packet::convertScToWrite
void convertScToWrite()
It has been determined that the SC packet should successfully update memory.
Definition: packet.hh:836
gem5::Packet::setBadAddress
void setBadAddress()
Definition: packet.hh:782
gem5::MemCmd::IsFlush
@ IsFlush
Flush the address from caches.
Definition: packet.hh:175
gem5::Flags::clear
void clear()
Clear all flag's bits.
Definition: flags.hh:102
gem5::MemCmd::FlushReq
@ FlushReq
Definition: packet.hh:140
gem5::Packet::data
PacketDataPtr data
A pointer to the data being transferred.
Definition: packet.hh:384
gem5::MemCmd::CommandInfo::str
const std::string str
String representation (for printing)
Definition: packet.hh:201
gem5::Packet::writeThrough
bool writeThrough() const
Definition: packet.hh:738
gem5::MemCmd::CleanInvalidReq
@ CleanInvalidReq
Definition: packet.hh:128
gem5::Packet::htmTransactionUid
uint64_t htmTransactionUid
A global unique identifier of the transaction.
Definition: packet.hh:417
htm.hh
gem5::MemCmd::buildAttributes
static constexpr unsigned long long buildAttributes(std::initializer_list< Attribute > attrs)
Definition: packet.hh:181
gem5::Packet::qosValue
uint8_t qosValue() const
QoS Value getter Returns 0 if QoS value was never set (constructor default).
Definition: packet.hh:765
gem5::HtmCacheFailure
HtmCacheFailure
Definition: htm.hh:59
gem5::Packet::setCacheResponding
void setCacheResponding()
Snoop flags.
Definition: packet.hh:649
gem5::MemCmd::needsResponse
bool needsResponse() const
Definition: packet.hh:230
gem5::Packet::isWriteback
bool isWriteback() const
Definition: packet.hh:610
gem5::MemCmd::isInvalidate
bool isInvalidate() const
Definition: packet.hh:231
gem5::Packet::~Packet
~Packet()
clean up packet variables
Definition: packet.hh:1034
gem5::Packet::setHtmTransactional
void setHtmTransactional(uint64_t val)
Stipulates that this packet/request originates in the CPU executing in transactional mode,...
Definition: packet.cc:512
gem5::X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:769
gem5::MemCmd::SoftPFResp
@ SoftPFResp
Definition: packet.hh:99
gem5::Packet::cacheResponding
bool cacheResponding() const
Definition: packet.hh:655
gem5::MemCmd::ReadSharedReq
@ ReadSharedReq
Definition: packet.hh:110
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:431
gem5::MemCmd::Command
Command
List of all commands associated with a packet.
Definition: packet.hh:83
gem5::Packet::copyError
void copyError(Packet *pkt)
Definition: packet.hh:788
gem5::Packet::isUpgrade
bool isUpgrade() const
Definition: packet.hh:593
gem5::MemCmd::SwapResp
@ SwapResp
Definition: packet.hh:120
cast.hh
gem5::Packet::isWrite
bool isWrite() const
Definition: packet.hh:591
gem5::Packet::isSecure
bool isSecure() const
Definition: packet.hh:819
gem5::MemCmd::NUM_MEM_CMDS
@ NUM_MEM_CMDS
Definition: packet.hh:149
gem5::Packet::setWriteThrough
void setWriteThrough()
A writeback/writeclean cmd gets propagated further downstream by the receiver when the flag is set.
Definition: packet.hh:731
gem5::Packet::hasSharers
bool hasSharers() const
Definition: packet.hh:682
gem5::Packet::createWrite
static PacketPtr createWrite(const RequestPtr &req)
Definition: packet.hh:1026
gem5::VegaISA::w
Bitfield< 6 > w
Definition: pagetable.hh:59
gem5::MemCmd::IsLlsc
@ IsLlsc
Alpha/MIPS LL or SC access.
Definition: packet.hh:170
gem5::MemCmd::UpgradeReq
@ UpgradeReq
Definition: packet.hh:102
std::vector< bool >
gem5::MemCmd::isWrite
bool isWrite() const
Definition: packet.hh:225
gem5::MemCmd::IsWrite
@ IsWrite
Data flows from requester to responder.
Definition: packet.hh:159
gem5::MemCmd::fromCache
bool fromCache() const
Definition: packet.hh:234
gem5::Packet::makeAtomicResponse
void makeAtomicResponse()
Definition: packet.hh:1056
gem5::Packet::PrintReqState::LabelStackEntry::labelPrinted
bool labelPrinted
Definition: packet.hh:486
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:1284
gem5::MemCmd::isDemand
bool isDemand() const
Definition: packet.hh:259
gem5::X86ISA::base
Bitfield< 51, 12 > base
Definition: pagetable.hh:141
gem5::MemCmd::IsRequest
@ IsRequest
Issued by requester.
Definition: packet.hh:164
gem5::PacketDataPtr
uint8_t * PacketDataPtr
Definition: packet.hh:71
gem5::ArmISA::i
Bitfield< 7 > i
Definition: misc_types.hh:67
gem5::MemCmd::operator==
bool operator==(MemCmd c2) const
Definition: packet.hh:280
gem5::MemCmd::HardPFReq
@ HardPFReq
Definition: packet.hh:98
gem5::Packet::headerDelay
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
Definition: packet.hh:428
gem5::Packet::PrintReqState::LabelStackEntry::label
const std::string label
Definition: packet.hh:484
gem5::Packet::setSatisfied
void setSatisfied()
Set when a request hits in a cache and the cache is not going to respond.
Definition: packet.hh:745
gem5::Packet::Flags
gem5::Flags< FlagsType > Flags
Definition: packet.hh:295
gem5::Packet::PrintReqState::printLabels
void printLabels()
Print all of the pending unprinted labels on the stack.
Definition: packet.cc:449
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:436
gem5::Packet::SenderState::predecessor
SenderState * predecessor
Definition: packet.hh:467
printable.hh
gem5::Packet::Packet
Packet(const RequestPtr &_req, MemCmd _cmd)
Constructor.
Definition: packet.hh:860
gem5::MemCmd::ReadCleanReq
@ ReadCleanReq
Definition: packet.hh:109
gem5::Packet::PrintReqState::LabelStackEntry::prefix
std::string * prefix
Definition: packet.hh:485
gem5::PacketPtr
Packet * PacketPtr
Definition: thread_context.hh:76
gem5::MemCmd::StoreCondFailReq
@ StoreCondFailReq
Definition: packet.hh:113
gem5::MemCmd::WritebackDirty
@ WritebackDirty
Definition: packet.hh:92
gem5::MemCmd::IsUpgrade
@ IsUpgrade
Definition: packet.hh:160
gem5::MemCmd::MemFenceResp
@ MemFenceResp
Definition: packet.hh:125
gem5::Packet::hasData
bool hasData() const
Definition: packet.hh:611
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:848
gem5::MemCmd::isError
bool isError() const
Definition: packet.hh:254
gem5::MemCmd
Definition: packet.hh:75
gem5::MemCmd::isResponse
bool isResponse() const
Definition: packet.hh:228
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:1397
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:828
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:446
gem5::Packet::PrintReqState::curPrefixPtr
std::string * curPrefixPtr
Definition: packet.hh:493
gem5::Packet::dataStatic
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
Definition: packet.hh:1147
gem5::MemCmd::IsError
@ IsError
Error response.
Definition: packet.hh:173
gem5::MemCmd::CommandInfo::response
const Command response
Corresponding response for requests; InvalidCmd if no response is applicable.
Definition: packet.hh:199
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:352
gem5::MemCmd::isEviction
bool isEviction() const
Definition: packet.hh:232
gem5::Packet::VALID_SIZE
@ VALID_SIZE
Definition: packet.hh:344
gem5::Flags< FlagsType >
gem5::MemCmd::HTMAbort
@ HTMAbort
Definition: packet.hh:146
gem5::Packet::PrintReqState::os
std::ostream & os
Definition: packet.hh:496
gem5::MemCmd::MemCmd
MemCmd(int _cmd)
Definition: packet.hh:277
gem5::Packet::isRead
bool isRead() const
Definition: packet.hh:590
gem5::Packet::needsWritable
bool needsWritable() const
Definition: packet.hh:596
gem5::MemCmd::NeedsWritable
@ NeedsWritable
Requires writable copy to complete in-cache.
Definition: packet.hh:163
gem5::MemCmd::CleanInvalidResp
@ CleanInvalidResp
Definition: packet.hh:129
gem5::MemCmd::WriteResp
@ WriteResp
Definition: packet.hh:90
gem5::VegaISA::t
Bitfield< 51 > t
Definition: pagetable.hh:56
gem5::MemCmd::SCUpgradeReq
@ SCUpgradeReq
Definition: packet.hh:103
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:776
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:72
gem5::MemCmd::isRequest
bool isRequest() const
Definition: packet.hh:227
gem5::PacketId
uint64_t PacketId
Definition: packet.hh:73
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:291
gem5::MemCmd::UpgradeResp
@ UpgradeResp
Definition: packet.hh:104
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:385
gem5::Packet::setAddr
void setAddr(Addr _addr)
Update the address of this packet mid-transaction.
Definition: packet.hh:798
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:499
gem5::probing::Packet
ProbePointArg< PacketInfo > Packet
Packet probe point.
Definition: mem.hh:109
gem5::MemCmd::NUM_COMMAND_ATTRIBUTES
@ NUM_COMMAND_ATTRIBUTES
Definition: packet.hh:177
gem5::MemCmd::cmd
Command cmd
Definition: packet.hh:214
gem5::Packet::SenderState::~SenderState
virtual ~SenderState()
Definition: packet.hh:469
gem5::Packet::PrintReqState::LabelStackEntry
An entry in the label stack.
Definition: packet.hh:482
gem5::Packet::satisfied
bool satisfied() const
Definition: packet.hh:751
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:773
gem5::Packet::HAS_SHARERS
@ HAS_SHARERS
Definition: packet.hh:308
gem5::MemCmd::LoadLockedReq
@ LoadLockedReq
Definition: packet.hh:111
gem5::Packet::htmReturnReason
HtmCacheFailure htmReturnReason
Holds the return status of the transaction.
Definition: packet.hh:411
gem5::RequestPtr
std::shared_ptr< Request > RequestPtr
Definition: request.hh:92
gem5::Packet::getConstPtr
const T * getConstPtr() const
Definition: packet.hh:1206
gem5::MemCmd::ReadReq
@ ReadReq
Definition: packet.hh:86
gem5::MemCmd::MemSyncReq
@ MemSyncReq
Definition: packet.hh:123
gem5::MemCmd::isHWPrefetch
bool isHWPrefetch() const
Definition: packet.hh:251
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::RESPONDER_FLAGS
@ RESPONDER_FLAGS
Definition: packet.hh:304
gem5::Packet::getHtmTransactionUid
uint64_t getHtmTransactionUid() const
If a packet/request originates in a CPU executing in transactional mode, i.e.
Definition: packet.cc:525
gem5::MemCmd::testCmdAttrib
bool testCmdAttrib(MemCmd::Attribute attrib) const
Definition: packet.hh:217
gem5::Packet::suppressFuncError
bool suppressFuncError() const
Definition: packet.hh:754
gem5::MemCmd::toInt
int toInt() const
Definition: packet.hh:274
gem5::Packet::isLLSC
bool isLLSC() const
Definition: packet.hh:617
gem5::MemCmd::WritebackClean
@ WritebackClean
Definition: packet.hh:93
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:399
gem5::Packet::PrintReqState::LabelStack
std::list< LabelStackEntry > LabelStack
Definition: packet.hh:490
gem5::Packet::setExpressSnoop
void setExpressSnoop()
The express snoop flag is used for two purposes.
Definition: packet.hh:697
gem5::Packet::clearBlockCached
void clearBlockCached()
Definition: packet.hh:757
gem5::Packet::PrintReqState::curPrefix
const std::string & curPrefix()
Returns the current line prefix.
Definition: packet.hh:505
gem5::MemCmd::CleanSharedReq
@ CleanSharedReq
Definition: packet.hh:126
gem5::MemCmd::CommandInfo::CommandInfo
CommandInfo(std::initializer_list< Attribute > attrs, Command _response, const std::string &_str)
Definition: packet.hh:203
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:473
compiler.hh
gem5::Packet::id
const PacketId id
Definition: packet.hh:371
gem5::Packet::makeReadCmd
static MemCmd makeReadCmd(const RequestPtr &req)
Generate the appropriate read MemCmd based on the Request flags.
Definition: packet.hh:975
gem5::Packet::getHtmTransactionFailedInCacheRC
HtmCacheFailure getHtmTransactionFailedInCacheRC() const
If a packet/request has returned from the cache hierarchy in a failed transaction,...
Definition: packet.cc:505
gem5::Packet::_qosValue
uint8_t _qosValue
Definition: packet.hh:402
gem5::Packet::setResponderHadWritable
void setResponderHadWritable()
On responding to a snoop request (which only happens for Modified or Owned lines),...
Definition: packet.hh:709
gem5::MemCmd::isLockedRMW
bool isLockedRMW() const
Definition: packet.hh:249
gem5::Packet::pushLabel
void pushLabel(const std::string &lbl)
Push label for PrintReq (safe to call unconditionally).
Definition: packet.hh:1433
gem5::Packet::SenderState
A virtual base opaque structure used to hold state associated with the packet (e.g....
Definition: packet.hh:465
gem5::MemCmd::ReadExReq
@ ReadExReq
Definition: packet.hh:107
gem5::Packet::cmd
MemCmd cmd
The command field of the packet.
Definition: packet.hh:369
gem5::Packet::COPY_FLAGS
@ COPY_FLAGS
Definition: packet.hh:301
gem5::MemCmd::IsPrint
@ IsPrint
Print state matching address (for debugging)
Definition: packet.hh:174
gem5::Packet::isPrint
bool isPrint() const
Definition: packet.hh:620
gem5::MemCmd::isFlush
bool isFlush() const
Definition: packet.hh:256
gem5::Packet::deleteData
void deleteData()
delete the data pointed to in the data pointer.
Definition: packet.hh:1328
gem5::MemCmd::SoftPFExReq
@ SoftPFExReq
Definition: packet.hh:97
gem5::Packet::popLabel
void popLabel()
Pop label for PrintReq (safe to call unconditionally).
Definition: packet.hh:1443
gem5::Packet::responderHadWritable
bool responderHadWritable() const
Definition: packet.hh:715
gem5::MemCmd::TlbiExtSync
@ TlbiExtSync
Definition: packet.hh:148
gem5::Packet::needsResponse
bool needsResponse() const
Definition: packet.hh:605
gem5::Packet::writeData
void writeData(uint8_t *p) const
Copy data from the packet to the memory at the provided pointer.
Definition: packet.hh:1294
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:619
gem5::Packet::isLockedRMW
bool isLockedRMW() const
Definition: packet.hh:618
gem5::MemCmd::CommandInfo::attributes
const std::bitset< NUM_COMMAND_ATTRIBUTES > attributes
Set of attribute flags.
Definition: packet.hh:196
gem5::Packet::senderState
SenderState * senderState
This packet's sender state.
Definition: packet.hh:542
gem5::Packet::flags
Flags flags
Definition: packet.hh:363
gem5::MemCmd::LockedRMWReadResp
@ LockedRMWReadResp
Definition: packet.hh:116
gem5::Packet::FAILS_TRANSACTION
@ FAILS_TRANSACTION
Definition: packet.hh:336
flags.hh
gem5::MemCmd::SCUpgradeFailReq
@ SCUpgradeFailReq
Definition: packet.hh:105
addr_range.hh
gem5::Packet::popSenderState
SenderState * popSenderState()
Pop the top of the state stack and return a pointer to it.
Definition: packet.cc:338
gem5::MemCmd::InvalidateResp
@ InvalidateResp
Definition: packet.hh:142
gem5::MemCmd::toString
const std::string & toString() const
Return the string to a cmd given by idx.
Definition: packet.hh:273
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:466
gem5::Packet::dataStaticConst
void dataStaticConst(const T *p)
Set the data pointer to the following value that should not be freed.
Definition: packet.hh:1164
gem5::Packet::Command
MemCmd::Command Command
Definition: packet.hh:366
gem5::MemCmd::HTMReq
@ HTMReq
Definition: packet.hh:144
gem5::MemCmd::WriteCompleteResp
@ WriteCompleteResp
Definition: packet.hh:91
gem5::MemCmd::IsSWPrefetch
@ IsSWPrefetch
Definition: packet.hh:168
gem5::Packet::isClean
bool isClean() const
Definition: packet.hh:608
gem5::Packet::setHasSharers
void setHasSharers()
On fills, the hasSharers flag is used by the caches in combination with the cacheResponding flag,...
Definition: packet.hh:681
gem5::MemCmd::LockedRMWReadReq
@ LockedRMWReadReq
Definition: packet.hh:115
gem5::MemCmd::IsEviction
@ IsEviction
Definition: packet.hh:167
gem5::Packet::PrintReqState::LabelStackEntry::LabelStackEntry
LabelStackEntry(const std::string &_label, std::string *_prefix)
Definition: packet.cc:424
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::VegaISA::v
Bitfield< 0 > v
Definition: pagetable.hh:65
gem5::MemCmd::BadAddressError
@ BadAddressError
Definition: packet.hh:135
gem5::Packet::makeTimingResponse
void makeTimingResponse()
Definition: packet.hh:1062
gem5::Packet::isFlush
bool isFlush() const
Definition: packet.hh:621
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:901
gem5::c2
c2
Definition: intmath.hh:174
gem5::Packet::allocate
void allocate()
Allocate memory for the packet.
Definition: packet.hh:1339
gem5::MemCmd::isSWPrefetch
bool isSWPrefetch() const
Definition: packet.hh:250
gem5::Packet::SATISFIED
@ SATISFIED
Definition: packet.hh:329
gem5::Packet::Packet
Packet(const PacketPtr pkt, bool clear_flags, bool alloc_data)
Alternate constructor for copying a packet.
Definition: packet.hh:927
types.hh
gem5::Packet::PrintReqState::~PrintReqState
~PrintReqState()
Definition: packet.cc:416
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:1318
gem5::MemCmd::ReadResp
@ ReadResp
Definition: packet.hh:87
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:1044
gem5::Packet::dataDynamic
void dataDynamic(T *p)
Set the data pointer to a value that should have delete [] called on it.
Definition: packet.hh:1185
gem5::Packet::VALID_ADDR
@ VALID_ADDR
Are the 'addr' and 'size' fields valid?
Definition: packet.hh:343
gem5::MemCmd::IsClean
@ IsClean
Cleans any existing dirty blocks.
Definition: packet.hh:162
gem5::MemCmd::MemCmd
MemCmd()
Definition: packet.hh:278
gem5::MemCmd::isPrint
bool isPrint() const
Definition: packet.hh:255
gem5::Packet::clearWriteThrough
void clearWriteThrough()
Definition: packet.hh:737
gem5::MemCmd::operator!=
bool operator!=(MemCmd c2) const
Definition: packet.hh:281
gem5::MemCmd::WriteReq
@ WriteReq
Definition: packet.hh:89
gem5::MemCmd::IsResponse
@ IsResponse
Issue by responder.
Definition: packet.hh:165
gem5::Packet::setBlockCached
void setBlockCached()
Definition: packet.hh:755
gem5::MemCmd::FunctionalWriteError
@ FunctionalWriteError
Definition: packet.hh:137
logging.hh
gem5::MemCmd::InvalidateReq
@ InvalidateReq
Definition: packet.hh:141
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:609
gem5::MemCmd::CommandInfo
Structure that defines attributes and other data associated with a Command.
Definition: packet.hh:193
gem5::MemCmd::MemFenceReq
@ MemFenceReq
Definition: packet.hh:122
gem5::Packet::trySatisfyFunctional
bool trySatisfyFunctional(PacketPtr other)
Check a functional request against a memory value stored in another packet (i.e.
Definition: packet.hh:1371
gem5::Packet::PrintReqState::verbosity
const int verbosity
Definition: packet.hh:497
gem5::Packet::BLOCK_CACHED
@ BLOCK_CACHED
Definition: packet.hh:360
gem5::Packet::SenderState::SenderState
SenderState()
Definition: packet.hh:468
gem5::MemCmd::IsLockedRMW
@ IsLockedRMW
x86 locked RMW access
Definition: packet.hh:171
gem5::Packet::isExpressSnoop
bool isExpressSnoop() const
Definition: packet.hh:698
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:248
gem5::MemCmd::PrintReq
@ PrintReq
Definition: packet.hh:139
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:489
gem5::MemCmd::StoreCondResp
@ StoreCondResp
Definition: packet.hh:114
gem5::MemCmd::isWriteback
bool isWriteback() const
A writeback is an eviction that carries data.
Definition: packet.hh:239
gem5::Packet::FlagsType
uint32_t FlagsType
Definition: packet.hh:294
gem5::Packet::isMaskedWrite
bool isMaskedWrite() const
Definition: packet.hh:1413
gem5::Packet::PrintReqState::popLabel
void popLabel()
Pop a label off the label stack.
Definition: packet.cc:440
gem5::Packet::isHtmTransactional
bool isHtmTransactional() const
Returns whether or not this packet/request originates in the CPU executing in transactional mode,...
Definition: packet.cc:519
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:790
gem5::Packet::copyResponderFlags
void copyResponderFlags(const PacketPtr pkt)
Copy the reponse flags from an input packet to this packet.
Definition: packet.cc:320
gem5::Packet::bytesValid
std::vector< bool > bytesValid
Track the bytes found that satisfy a functional read.
Definition: packet.hh:399
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:176
gem5::MemCmd::MemSyncResp
@ MemSyncResp
Definition: packet.hh:124
gem5::MemCmd::InvalidCmd
@ InvalidCmd
Definition: packet.hh:85
gem5::Packet::createRead
static PacketPtr createRead(const RequestPtr &req)
Constructor-like methods that return Packets based on Request objects.
Definition: packet.hh:1020
gem5::Packet::getAddrRange
AddrRange getAddrRange() const
Get address range to which this packet belongs.
Definition: packet.cc:239
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:378
gem5::Packet::cmdToIndex
int cmdToIndex() const
Return the index of this command.
Definition: packet.hh:588
gem5::MemCmd::isPrefetch
bool isPrefetch() const
Definition: packet.hh:252
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:357
gem5::Packet::FROM_TRANSACTION
@ FROM_TRANSACTION
Definition: packet.hh:340
gem5::MemCmd::ReadRespWithInvalidate
@ ReadRespWithInvalidate
Definition: packet.hh:88
gem5::MemCmd::isRead
bool isRead() const
Definition: packet.hh:224
gem5::MemCmd::NeedsResponse
@ NeedsResponse
Requester needs response from target.
Definition: packet.hh:166
gem5::MemCmd::HTMReqResp
@ HTMReqResp
Definition: packet.hh:145
gem5::Packet::setSuppressFuncError
void setSuppressFuncError()
Definition: packet.hh:753
gem5::Packet::isBlockCached
bool isBlockCached() const
Definition: packet.hh:756
gem5::Packet::isResponse
bool isResponse() const
Definition: packet.hh:595
gem5::MemCmd::WriteLineReq
@ WriteLineReq
Definition: packet.hh:101
gem5::Packet::getSize
unsigned getSize() const
Definition: packet.hh:800
gem5::MemCmd::UpgradeFailResp
@ UpgradeFailResp
Definition: packet.hh:106
gem5::Packet::isWholeLineWrite
bool isWholeLineWrite(unsigned blk_size)
Definition: packet.hh:623
gem5::MemCmd::IsRead
@ IsRead
Data flows from responder to requester.
Definition: packet.hh:158
gem5::Packet::hasRespData
bool hasRespData() const
Definition: packet.hh:612
gem5::MemCmd::needsWritable
bool needsWritable() const
Definition: packet.hh:229
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:607
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:317
gem5::Packet::isInvalidate
bool isInvalidate() const
Definition: packet.hh:606
gem5::Packet::addr
Addr addr
The address of the request.
Definition: packet.hh:388
gem5::MemCmd::HardPFResp
@ HardPFResp
Definition: packet.hh:100
gem5::MemCmd::LockedRMWWriteResp
@ LockedRMWWriteResp
Definition: packet.hh:118
gem5::Packet::isDemand
bool isDemand() const
Definition: packet.hh:592
gem5::Packet::getPtr
T * getPtr()
get a pointer to the data ptr.
Definition: packet.hh:1197
gem5::MemCmd::SoftPFReq
@ SoftPFReq
Definition: packet.hh:96
gem5::Packet::PrintReqState
Object used to maintain state of a PrintReq.
Definition: packet.hh:476
gem5::MemCmd::isUpgrade
bool isUpgrade() const
Definition: packet.hh:226
gem5::MemCmd::InvalidDestError
@ InvalidDestError
Definition: packet.hh:134
gem5::Packet::setSize
void setSize(unsigned size)
Definition: packet.hh:1080

Generated on Thu Jul 28 2022 13:32:34 for gem5 by doxygen 1.8.17