gem5  v21.1.0.2
packet.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2019 ARM Limited
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Copyright (c) 2006 The Regents of The University of Michigan
15  * Copyright (c) 2010,2015 Advanced Micro Devices, Inc.
16  * All rights reserved.
17  *
18  * Redistribution and use in source and binary forms, with or without
19  * modification, are permitted provided that the following conditions are
20  * met: redistributions of source code must retain the above copyright
21  * notice, this list of conditions and the following disclaimer;
22  * redistributions in binary form must reproduce the above copyright
23  * notice, this list of conditions and the following disclaimer in the
24  * documentation and/or other materials provided with the distribution;
25  * neither the name of the copyright holders nor the names of its
26  * contributors may be used to endorse or promote products derived from
27  * this software without specific prior written permission.
28  *
29  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  */
41 
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)
117  // MessageReq and MessageResp are deprecated.
119  MemSyncReq, // memory synchronization request (e.g., cache invalidate)
120  MemSyncResp, // memory synchronization response
126  // Error responses
127  // @TODO these should be classified as responses rather than
128  // requests; coding them as requests initially for backwards
129  // compatibility
130  InvalidDestError, // packet dest field invalid
131  BadAddressError, // memory address invalid
132  FunctionalReadError, // unable to fulfill functional read
133  FunctionalWriteError, // unable to fulfill functional write
134  // Fake simulator-only commands
135  PrintReq, // Print state matching address
136  FlushReq, //request for a cache flush
137  InvalidateReq, // request for address to be invalidated
139  // hardware transactional memory
144  };
145 
146  private:
151  {
171  };
172 
173  static constexpr unsigned long long
174  buildAttributes(std::initializer_list<Attribute> attrs)
175  {
176  unsigned long long ret = 0;
177  for (const auto &attr: attrs)
178  ret |= (1ULL << attr);
179  return ret;
180  }
181 
186  struct CommandInfo
187  {
189  const std::bitset<NUM_COMMAND_ATTRIBUTES> attributes;
194  const std::string str;
195 
196  CommandInfo(std::initializer_list<Attribute> attrs,
197  Command _response, const std::string &_str) :
198  attributes(buildAttributes(attrs)), response(_response), str(_str)
199  {}
200  };
201 
203  static const CommandInfo commandInfo[];
204 
205  private:
206 
208 
209  bool
211  {
212  return commandInfo[cmd].attributes[attrib] != 0;
213  }
214 
215  public:
216 
217  bool isRead() const { return testCmdAttrib(IsRead); }
218  bool isWrite() const { return testCmdAttrib(IsWrite); }
219  bool isUpgrade() const { return testCmdAttrib(IsUpgrade); }
220  bool isRequest() const { return testCmdAttrib(IsRequest); }
221  bool isResponse() const { return testCmdAttrib(IsResponse); }
222  bool needsWritable() const { return testCmdAttrib(NeedsWritable); }
223  bool needsResponse() const { return testCmdAttrib(NeedsResponse); }
224  bool isInvalidate() const { return testCmdAttrib(IsInvalidate); }
225  bool isEviction() const { return testCmdAttrib(IsEviction); }
226  bool isClean() const { return testCmdAttrib(IsClean); }
227  bool fromCache() const { return testCmdAttrib(FromCache); }
228 
232  bool isWriteback() const { return testCmdAttrib(IsEviction) &&
234 
240  bool hasData() const { return testCmdAttrib(HasData); }
241  bool isLLSC() const { return testCmdAttrib(IsLlsc); }
242  bool isSWPrefetch() const { return testCmdAttrib(IsSWPrefetch); }
243  bool isHWPrefetch() const { return testCmdAttrib(IsHWPrefetch); }
244  bool isPrefetch() const { return testCmdAttrib(IsSWPrefetch) ||
246  bool isError() const { return testCmdAttrib(IsError); }
247  bool isPrint() const { return testCmdAttrib(IsPrint); }
248  bool isFlush() const { return testCmdAttrib(IsFlush); }
249 
250  bool
251  isDemand() const
252  {
253  return (cmd == ReadReq || cmd == WriteReq ||
254  cmd == WriteLineReq || cmd == ReadExReq ||
255  cmd == ReadCleanReq || cmd == ReadSharedReq);
256  }
257 
258  Command
260  {
261  return commandInfo[cmd].response;
262  }
263 
265  const std::string &toString() const { return commandInfo[cmd].str; }
266  int toInt() const { return (int)cmd; }
267 
268  MemCmd(Command _cmd) : cmd(_cmd) { }
269  MemCmd(int _cmd) : cmd((Command)_cmd) { }
271 
272  bool operator==(MemCmd c2) const { return (cmd == c2.cmd); }
273  bool operator!=(MemCmd c2) const { return (cmd != c2.cmd); }
274 };
275 
283 class Packet : public Printable
284 {
285  public:
286  typedef uint32_t FlagsType;
288 
289  private:
290  enum : FlagsType
291  {
292  // Flags to transfer across when copying a packet
293  COPY_FLAGS = 0x000000FF,
294 
295  // Flags that are used to create reponse packets
296  RESPONDER_FLAGS = 0x00000009,
297 
298  // Does this packet have sharers (which means it should not be
299  // considered writable) or not. See setHasSharers below.
300  HAS_SHARERS = 0x00000001,
301 
302  // Special control flags
304  EXPRESS_SNOOP = 0x00000002,
305 
310 
311  // Snoop co-ordination flag to indicate that a cache is
312  // responding to a snoop. See setCacheResponding below.
313  CACHE_RESPONDING = 0x00000008,
314 
315  // The writeback/writeclean should be propagated further
316  // downstream by the receiver
317  WRITE_THROUGH = 0x00000010,
318 
319  // Response co-ordination flag for cache maintenance
320  // operations
321  SATISFIED = 0x00000020,
322 
323  // hardware transactional memory
324 
325  // Indicates that this packet/request has returned from the
326  // cache hierarchy in a failed transaction. The core is
327  // notified like this.
328  FAILS_TRANSACTION = 0x00000040,
329 
330  // Indicates that this packet/request originates in the CPU executing
331  // in transactional mode, i.e. in a transaction.
332  FROM_TRANSACTION = 0x00000080,
333 
335  VALID_ADDR = 0x00000100,
336  VALID_SIZE = 0x00000200,
337 
340  STATIC_DATA = 0x00001000,
344  DYNAMIC_DATA = 0x00002000,
345 
348  SUPPRESS_FUNC_ERROR = 0x00008000,
349 
350  // Signal block present to squash prefetch and cache evict packets
351  // through express snoop flag
352  BLOCK_CACHED = 0x00010000
353  };
354 
356 
357  public:
359 
362 
363  const PacketId id;
364 
367 
368  private:
377 
381 
383  bool _isSecure;
384 
386  unsigned size;
387 
392 
393  // Quality of Service priority value
394  uint8_t _qosValue;
395 
396  // hardware transactional memory
397 
404 
410 
411  public:
412 
420  uint32_t headerDelay;
421 
428  uint32_t snoopDelay;
429 
438  uint32_t payloadDelay;
439 
457  struct SenderState
458  {
461  virtual ~SenderState() {}
462  };
463 
468  class PrintReqState : public SenderState
469  {
470  private:
475  {
476  const std::string label;
477  std::string *prefix;
479  LabelStackEntry(const std::string &_label, std::string *_prefix);
480  };
481 
484 
485  std::string *curPrefixPtr;
486 
487  public:
488  std::ostream &os;
489  const int verbosity;
490 
491  PrintReqState(std::ostream &os, int verbosity = 0);
492  ~PrintReqState();
493 
497  const std::string &curPrefix() { return *curPrefixPtr; }
498 
504  void pushLabel(const std::string &lbl,
505  const std::string &prefix = " ");
506 
510  void popLabel();
511 
517  void printLabels();
518 
523  void printObj(Printable *obj);
524  };
525 
535 
544  void pushSenderState(SenderState *sender_state);
545 
555 
563  template <typename T>
565  {
566  T *t = NULL;
567  SenderState* sender_state = senderState;
568  while (t == NULL && sender_state != NULL) {
569  t = dynamic_cast<T*>(sender_state);
570  sender_state = sender_state->predecessor;
571  }
572  return t;
573  }
574 
577  const std::string &cmdString() const { return cmd.toString(); }
578 
580  inline int cmdToIndex() const { return cmd.toInt(); }
581 
582  bool isRead() const { return cmd.isRead(); }
583  bool isWrite() const { return cmd.isWrite(); }
584  bool isDemand() const { return cmd.isDemand(); }
585  bool isUpgrade() const { return cmd.isUpgrade(); }
586  bool isRequest() const { return cmd.isRequest(); }
587  bool isResponse() const { return cmd.isResponse(); }
588  bool needsWritable() const
589  {
590  // we should never check if a response needsWritable, the
591  // request has this flag, and for a response we should rather
592  // look at the hasSharers flag (if not set, the response is to
593  // be considered writable)
594  assert(isRequest());
595  return cmd.needsWritable();
596  }
597  bool needsResponse() const { return cmd.needsResponse(); }
598  bool isInvalidate() const { return cmd.isInvalidate(); }
599  bool isEviction() const { return cmd.isEviction(); }
600  bool isClean() const { return cmd.isClean(); }
601  bool fromCache() const { return cmd.fromCache(); }
602  bool isWriteback() const { return cmd.isWriteback(); }
603  bool hasData() const { return cmd.hasData(); }
604  bool hasRespData() const
605  {
606  MemCmd resp_cmd = cmd.responseCommand();
607  return resp_cmd.hasData();
608  }
609  bool isLLSC() const { return cmd.isLLSC(); }
610  bool isError() const { return cmd.isError(); }
611  bool isPrint() const { return cmd.isPrint(); }
612  bool isFlush() const { return cmd.isFlush(); }
613 
614  bool isWholeLineWrite(unsigned blk_size)
615  {
616  return (cmd == MemCmd::WriteReq || cmd == MemCmd::WriteLineReq) &&
617  getOffset(blk_size) == 0 && getSize() == blk_size;
618  }
619 
621 
641  {
642  assert(isRequest());
643  assert(!flags.isSet(CACHE_RESPONDING));
645  }
646  bool cacheResponding() const { return flags.isSet(CACHE_RESPONDING); }
673  bool hasSharers() const { return flags.isSet(HAS_SHARERS); }
675 
689  bool isExpressSnoop() const { return flags.isSet(EXPRESS_SNOOP); }
690 
701  {
702  assert(cacheResponding());
703  assert(!responderHadWritable());
705  }
706  bool responderHadWritable() const
707  { return flags.isSet(RESPONDER_HAD_WRITABLE); }
708 
716  void copyResponderFlags(const PacketPtr pkt);
717 
723  {
724  assert(cmd.isWrite() &&
727  }
729  bool writeThrough() const { return flags.isSet(WRITE_THROUGH); }
730 
737  {
738  assert(cmd.isClean());
739  assert(!flags.isSet(SATISFIED));
741  }
742  bool satisfied() const { return flags.isSet(SATISFIED); }
743 
747  bool isBlockCached() const { return flags.isSet(BLOCK_CACHED); }
749 
756  inline uint8_t qosValue() const { return _qosValue; }
757 
764  inline void qosValue(const uint8_t qos_value)
765  { _qosValue = qos_value; }
766 
767  inline RequestorID requestorId() const { return req->requestorId(); }
768 
769  // Network error conditions... encapsulate them as methods since
770  // their encoding keeps changing (from result field to command
771  // field, etc.)
772  void
774  {
775  assert(isResponse());
777  }
778 
779  void copyError(Packet *pkt) { assert(pkt->isError()); cmd = pkt->cmd; }
780 
781  Addr getAddr() const { assert(flags.isSet(VALID_ADDR)); return addr; }
789  void setAddr(Addr _addr) { assert(flags.isSet(VALID_ADDR)); addr = _addr; }
790 
791  unsigned getSize() const { assert(flags.isSet(VALID_SIZE)); return size; }
792 
798  AddrRange getAddrRange() const;
799 
800  Addr getOffset(unsigned int blk_size) const
801  {
802  return getAddr() & Addr(blk_size - 1);
803  }
804 
805  Addr getBlockAddr(unsigned int blk_size) const
806  {
807  return getAddr() & ~(Addr(blk_size - 1));
808  }
809 
810  bool isSecure() const
811  {
812  assert(flags.isSet(VALID_ADDR));
813  return _isSecure;
814  }
815 
819  AtomicOpFunctor *getAtomicOp() const { return req->getAtomicOpFunctor(); }
820  bool isAtomicOp() const { return req->isAtomic(); }
821 
826  void
828  {
829  assert(isLLSC());
830  assert(isWrite());
832  }
833 
838  void
840  {
841  assert(isLLSC());
842  assert(isRead());
844  }
845 
851  Packet(const RequestPtr &_req, MemCmd _cmd)
852  : cmd(_cmd), id((PacketId)_req.get()), req(_req),
853  data(nullptr), addr(0), _isSecure(false), size(0),
854  _qosValue(0),
857  headerDelay(0), snoopDelay(0),
858  payloadDelay(0), senderState(NULL)
859  {
860  flags.clear();
861  if (req->hasPaddr()) {
862  addr = req->getPaddr();
864  _isSecure = req->isSecure();
865  }
866 
877  if (req->isHTMCmd()) {
879  assert(addr == 0x0);
880  }
881  if (req->hasSize()) {
882  size = req->getSize();
884  }
885  }
886 
892  Packet(const RequestPtr &_req, MemCmd _cmd, int _blkSize, PacketId _id = 0)
893  : cmd(_cmd), id(_id ? _id : (PacketId)_req.get()), req(_req),
894  data(nullptr), addr(0), _isSecure(false),
895  _qosValue(0),
898  headerDelay(0),
899  snoopDelay(0), payloadDelay(0), senderState(NULL)
900  {
901  flags.clear();
902  if (req->hasPaddr()) {
903  addr = req->getPaddr() & ~(_blkSize - 1);
905  _isSecure = req->isSecure();
906  }
907  size = _blkSize;
909  }
910 
918  Packet(const PacketPtr pkt, bool clear_flags, bool alloc_data)
919  : cmd(pkt->cmd), id(pkt->id), req(pkt->req),
920  data(nullptr),
921  addr(pkt->addr), _isSecure(pkt->_isSecure), size(pkt->size),
922  bytesValid(pkt->bytesValid),
923  _qosValue(pkt->qosValue()),
926  headerDelay(pkt->headerDelay),
927  snoopDelay(0),
930  {
931  if (!clear_flags)
932  flags.set(pkt->flags & COPY_FLAGS);
933 
934  flags.set(pkt->flags & (VALID_ADDR|VALID_SIZE));
935 
936  if (pkt->isHtmTransactional())
938 
939  if (pkt->htmTransactionFailedInCache()) {
942  );
943  }
944 
945  // should we allocate space for data, or not, the express
946  // snoops do not need to carry any data as they only serve to
947  // co-ordinate state changes
948  if (alloc_data) {
949  // even if asked to allocate data, if the original packet
950  // holds static data, then the sender will not be doing
951  // any memcpy on receiving the response, thus we simply
952  // carry the pointer forward
953  if (pkt->flags.isSet(STATIC_DATA)) {
954  data = pkt->data;
956  } else {
957  allocate();
958  }
959  }
960  }
961 
965  static MemCmd
967  {
968  if (req->isHTMCmd()) {
969  if (req->isHTMAbort())
970  return MemCmd::HTMAbort;
971  else
972  return MemCmd::HTMReq;
973  } else if (req->isLLSC())
974  return MemCmd::LoadLockedReq;
975  else if (req->isPrefetchEx())
976  return MemCmd::SoftPFExReq;
977  else if (req->isPrefetch())
978  return MemCmd::SoftPFReq;
979  else
980  return MemCmd::ReadReq;
981  }
982 
986  static MemCmd
988  {
989  if (req->isLLSC())
990  return MemCmd::StoreCondReq;
991  else if (req->isSwap() || req->isAtomic())
992  return MemCmd::SwapReq;
993  else if (req->isCacheInvalidate()) {
994  return req->isCacheClean() ? MemCmd::CleanInvalidReq :
996  } else if (req->isCacheClean()) {
997  return MemCmd::CleanSharedReq;
998  } else
999  return MemCmd::WriteReq;
1000  }
1001 
1006  static PacketPtr
1008  {
1009  return new Packet(req, makeReadCmd(req));
1010  }
1011 
1012  static PacketPtr
1014  {
1015  return new Packet(req, makeWriteCmd(req));
1016  }
1017 
1022  {
1023  deleteData();
1024  }
1025 
1030  void
1032  {
1033  assert(needsResponse());
1034  assert(isRequest());
1035  cmd = cmd.responseCommand();
1036 
1037  // responses are never express, even if the snoop that
1038  // triggered them was
1040  }
1041 
1042  void
1044  {
1045  makeResponse();
1046  }
1047 
1048  void
1050  {
1051  makeResponse();
1052  }
1053 
1054  void
1056  {
1057  if (!success) {
1058  if (isWrite()) {
1060  } else {
1062  }
1063  }
1064  }
1065 
1066  void
1067  setSize(unsigned size)
1068  {
1069  assert(!flags.isSet(VALID_SIZE));
1070 
1071  this->size = size;
1072  flags.set(VALID_SIZE);
1073  }
1074 
1084  bool matchBlockAddr(const Addr addr, const bool is_secure,
1085  const int blk_size) const;
1086 
1095  bool matchBlockAddr(const PacketPtr pkt, const int blk_size) const;
1096 
1104  bool matchAddr(const Addr addr, const bool is_secure) const;
1105 
1113  bool matchAddr(const PacketPtr pkt) const;
1114 
1115  public:
1132  template <typename T>
1133  void
1135  {
1137  data = (PacketDataPtr)p;
1139  }
1140 
1149  template <typename T>
1150  void
1151  dataStaticConst(const T *p)
1152  {
1154  data = const_cast<PacketDataPtr>(p);
1156  }
1157 
1170  template <typename T>
1171  void
1173  {
1175  data = (PacketDataPtr)p;
1177  }
1178 
1182  template <typename T>
1183  T*
1185  {
1187  assert(!isMaskedWrite());
1188  return (T*)data;
1189  }
1190 
1191  template <typename T>
1192  const T*
1193  getConstPtr() const
1194  {
1196  return (const T*)data;
1197  }
1198 
1203  template <typename T>
1204  T getBE() const;
1205 
1210  template <typename T>
1211  T getLE() const;
1212 
1217  template <typename T>
1218  T get(ByteOrder endian) const;
1219 
1221  template <typename T>
1222  void setBE(T v);
1223 
1225  template <typename T>
1226  void setLE(T v);
1227 
1232  template <typename T>
1233  void set(T v, ByteOrder endian);
1234 
1239  uint64_t getUintX(ByteOrder endian) const;
1240 
1246  void setUintX(uint64_t w, ByteOrder endian);
1247 
1251  void
1252  setData(const uint8_t *p)
1253  {
1254  // we should never be copying data onto itself, which means we
1255  // must idenfity packets with static data, as they carry the
1256  // same pointer from source to destination and back
1257  assert(p != getPtr<uint8_t>() || flags.isSet(STATIC_DATA));
1258 
1259  if (p != getPtr<uint8_t>()) {
1260  // for packet with allocated dynamic data, we copy data from
1261  // one to the other, e.g. a forwarded response to a response
1262  std::memcpy(getPtr<uint8_t>(), p, getSize());
1263  }
1264  }
1265 
1270  void
1271  setDataFromBlock(const uint8_t *blk_data, int blkSize)
1272  {
1273  setData(blk_data + getOffset(blkSize));
1274  }
1275 
1280  void
1281  writeData(uint8_t *p) const
1282  {
1283  if (!isMaskedWrite()) {
1284  std::memcpy(p, getConstPtr<uint8_t>(), getSize());
1285  } else {
1286  assert(req->getByteEnable().size() == getSize());
1287  // Write only the enabled bytes
1288  const uint8_t *base = getConstPtr<uint8_t>();
1289  for (int i = 0; i < getSize(); i++) {
1290  if (req->getByteEnable()[i]) {
1291  p[i] = *(base + i);
1292  }
1293  // Disabled bytes stay untouched
1294  }
1295  }
1296  }
1297 
1304  void
1305  writeDataToBlock(uint8_t *blk_data, int blkSize) const
1306  {
1307  writeData(blk_data + getOffset(blkSize));
1308  }
1309 
1314  void
1316  {
1317  if (flags.isSet(DYNAMIC_DATA))
1318  delete [] data;
1319 
1321  data = NULL;
1322  }
1323 
1325  void
1327  {
1328  // if either this command or the response command has a data
1329  // payload, actually allocate space
1330  if (hasData() || hasRespData()) {
1333  data = new uint8_t[getSize()];
1334  }
1335  }
1336 
1340  template <typename T>
1341  T getRaw() const;
1342 
1344  template <typename T>
1345  void setRaw(T v);
1346 
1347  public:
1357  bool
1359  {
1360  if (other->isMaskedWrite()) {
1361  // Do not forward data if overlapping with a masked write
1362  if (_isSecure == other->isSecure() &&
1363  getAddr() <= (other->getAddr() + other->getSize() - 1) &&
1364  other->getAddr() <= (getAddr() + getSize() - 1)) {
1365  warn("Trying to check against a masked write, skipping."
1366  " (addr: 0x%x, other addr: 0x%x)", getAddr(),
1367  other->getAddr());
1368  }
1369  return false;
1370  }
1371  // all packets that are carrying a payload should have a valid
1372  // data pointer
1373  return trySatisfyFunctional(other, other->getAddr(), other->isSecure(),
1374  other->getSize(),
1375  other->hasData() ?
1376  other->getPtr<uint8_t>() : NULL);
1377  }
1378 
1383  bool
1385  {
1386  return cmd == MemCmd::HardPFReq || isEviction();
1387  }
1388 
1393  bool
1395  {
1397  }
1398 
1399  bool
1401  {
1402  return (cmd == MemCmd::WriteReq && req->isMasked());
1403  }
1404 
1412  bool
1413  trySatisfyFunctional(Printable *obj, Addr base, bool is_secure, int size,
1414  uint8_t *_data);
1415 
1419  void
1420  pushLabel(const std::string &lbl)
1421  {
1422  if (isPrint())
1423  safe_cast<PrintReqState*>(senderState)->pushLabel(lbl);
1424  }
1425 
1429  void
1431  {
1432  if (isPrint())
1433  safe_cast<PrintReqState*>(senderState)->popLabel();
1434  }
1435 
1436  void print(std::ostream &o, int verbosity = 0,
1437  const std::string &prefix = "") const;
1438 
1445  std::string print() const;
1446 
1447  // hardware transactional memory
1448 
1457  void makeHtmTransactionalReqResponse(const HtmCacheFailure ret_code);
1458 
1463  void setHtmTransactional(uint64_t val);
1464 
1469  bool isHtmTransactional() const;
1470 
1477  uint64_t getHtmTransactionUid() const;
1478 
1484  void setHtmTransactionFailedInCache(const HtmCacheFailure ret_code);
1485 
1491  bool htmTransactionFailedInCache() const;
1492 
1498 };
1499 
1500 } // namespace gem5
1501 
1502 #endif //__MEM_PACKET_HH
gem5::Packet::getBlockAddr
Addr getBlockAddr(unsigned int blk_size) const
Definition: packet.hh:805
gem5::Packet::makeWriteCmd
static MemCmd makeWriteCmd(const RequestPtr &req)
Generate the appropriate write MemCmd based on the Request flags.
Definition: packet.hh:987
gem5::Packet::cmdString
const std::string & cmdString() const
Return the string name of the cmd field (for debugging and tracing).
Definition: packet.hh:577
gem5::Packet::EXPRESS_SNOOP
@ EXPRESS_SNOOP
Special timing-mode atomic snoop for multi-level coherence.
Definition: packet.hh:304
gem5::MemCmd::StoreCondReq
@ StoreCondReq
Definition: packet.hh:112
gem5::Packet::isAtomicOp
bool isAtomicOp() const
Definition: packet.hh:820
gem5::Packet::PrintReqState::PrintReqState
PrintReqState(std::ostream &os, int verbosity=0)
Definition: packet.cc:419
gem5::Packet::FAILS_TRANSACTION
@ FAILS_TRANSACTION
Definition: packet.hh:328
gem5::Packet::isRequest
bool isRequest() const
Definition: packet.hh:586
warn
#define warn(...)
Definition: logging.hh:245
gem5::MemCmd::isClean
bool isClean() const
Definition: packet.hh:226
gem5::MemCmd::HasData
@ HasData
There is an associated payload.
Definition: packet.hh:165
gem5::Packet::setFunctionalResponseStatus
void setFunctionalResponseStatus(bool success)
Definition: packet.hh:1055
gem5::MemCmd::FunctionalReadError
@ FunctionalReadError
Definition: packet.hh:132
gem5::Packet::getUintX
uint64_t getUintX(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness and zero-extended to 64 bits.
Definition: packet.cc:334
gem5::MemCmd::WriteClean
@ WriteClean
Definition: packet.hh:94
gem5::Packet::PrintReqState::labelStack
LabelStack labelStack
Definition: packet.hh:483
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:268
gem5::MipsISA::w
Bitfield< 0 > w
Definition: pra_constants.hh:281
gem5::Packet::getOffset
Addr getOffset(unsigned int blk_size) const
Definition: packet.hh:800
gem5::MemCmd::CleanEvict
@ CleanEvict
Definition: packet.hh:95
gem5::Packet::size
unsigned size
The size of the request or transfer.
Definition: packet.hh:386
gem5::MemCmd::IsHWPrefetch
@ IsHWPrefetch
Definition: packet.hh:163
gem5::Packet::_isSecure
bool _isSecure
True if the request targets the secure memory space.
Definition: packet.hh:383
gem5::MemCmd::SwapReq
@ SwapReq
Definition: packet.hh:115
gem5::MemCmd::CleanSharedResp
@ CleanSharedResp
Definition: packet.hh:123
gem5::MemCmd::commandInfo
static const CommandInfo commandInfo[]
Array to map Command enum to associated info.
Definition: packet.hh:203
gem5::MemCmd::Attribute
Attribute
List of command attributes.
Definition: packet.hh:150
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:1394
gem5::AtomicOpFunctor
Definition: amo.hh:43
gem5::MemCmd::ReadExResp
@ ReadExResp
Definition: packet.hh:108
gem5::MemCmd::IsInvalidate
@ IsInvalidate
Definition: packet.hh:155
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:564
gem5::Packet::setData
void setData(const uint8_t *p)
Copy data into the packet from the provided pointer.
Definition: packet.hh:1252
gem5::MemCmd::hasData
bool hasData() const
Check if this particular packet type carries payload data.
Definition: packet.hh:240
gem5::Packet::pushSenderState
void pushSenderState(SenderState *sender_state)
Push a new sender state to the packet and make the current sender state the predecessor of the new on...
Definition: packet.cc:316
gem5::HtmCacheFailure::NO_FAIL
@ NO_FAIL
gem5::ArmISA::attr
attr
Definition: misc_types.hh:655
gem5::Flags::set
void set(Type mask)
Set all flag's bits matching the given mask.
Definition: flags.hh:116
gem5::Packet::req
RequestPtr req
A pointer to the original request.
Definition: packet.hh:366
gem5::MemCmd::responseCommand
Command responseCommand() const
Definition: packet.hh:259
gem5::Packet::convertScToWrite
void convertScToWrite()
It has been determined that the SC packet should successfully update memory.
Definition: packet.hh:827
gem5::Packet::setBadAddress
void setBadAddress()
Definition: packet.hh:773
gem5::MemCmd::IsFlush
@ IsFlush
Flush the address from caches.
Definition: packet.hh:168
gem5::Flags::clear
void clear()
Clear all flag's bits.
Definition: flags.hh:102
gem5::MemCmd::FlushReq
@ FlushReq
Definition: packet.hh:136
gem5::Packet::data
PacketDataPtr data
A pointer to the data being transferred.
Definition: packet.hh:376
gem5::MemCmd::CommandInfo::str
const std::string str
String representation (for printing)
Definition: packet.hh:194
gem5::Packet::VALID_ADDR
@ VALID_ADDR
Are the 'addr' and 'size' fields valid?
Definition: packet.hh:335
gem5::Packet::COPY_FLAGS
@ COPY_FLAGS
Definition: packet.hh:293
gem5::Packet::writeThrough
bool writeThrough() const
Definition: packet.hh:729
gem5::MemCmd::CleanInvalidReq
@ CleanInvalidReq
Definition: packet.hh:124
gem5::Packet::htmTransactionUid
uint64_t htmTransactionUid
A global unique identifier of the transaction.
Definition: packet.hh:409
htm.hh
gem5::MemCmd::buildAttributes
static constexpr unsigned long long buildAttributes(std::initializer_list< Attribute > attrs)
Definition: packet.hh:174
gem5::Packet::qosValue
uint8_t qosValue() const
QoS Value getter Returns 0 if QoS value was never set (constructor default).
Definition: packet.hh:756
gem5::HtmCacheFailure
HtmCacheFailure
Definition: htm.hh:59
gem5::Packet::setCacheResponding
void setCacheResponding()
Snoop flags.
Definition: packet.hh:640
gem5::MemCmd::needsResponse
bool needsResponse() const
Definition: packet.hh:223
gem5::Packet::isWriteback
bool isWriteback() const
Definition: packet.hh:602
gem5::MemCmd::isInvalidate
bool isInvalidate() const
Definition: packet.hh:224
gem5::Packet::~Packet
~Packet()
clean up packet variables
Definition: packet.hh:1021
gem5::Packet::setHtmTransactional
void setHtmTransactional(uint64_t val)
Stipulates that this packet/request originates in the CPU executing in transactional mode,...
Definition: packet.cc:521
gem5::Packet::VALID_SIZE
@ VALID_SIZE
Definition: packet.hh:336
gem5::X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:775
gem5::MemCmd::SoftPFResp
@ SoftPFResp
Definition: packet.hh:99
gem5::Packet::cacheResponding
bool cacheResponding() const
Definition: packet.hh:646
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:440
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:779
gem5::Packet::isUpgrade
bool isUpgrade() const
Definition: packet.hh:585
gem5::MemCmd::SwapResp
@ SwapResp
Definition: packet.hh:116
cast.hh
gem5::Packet::isWrite
bool isWrite() const
Definition: packet.hh:583
gem5::Packet::isSecure
bool isSecure() const
Definition: packet.hh:810
gem5::MemCmd::NUM_MEM_CMDS
@ NUM_MEM_CMDS
Definition: packet.hh:143
gem5::Packet::setWriteThrough
void setWriteThrough()
A writeback/writeclean cmd gets propagated further downstream by the receiver when the flag is set.
Definition: packet.hh:722
gem5::Packet::hasSharers
bool hasSharers() const
Definition: packet.hh:673
gem5::Packet::createWrite
static PacketPtr createWrite(const RequestPtr &req)
Definition: packet.hh:1013
gem5::MemCmd::IsLlsc
@ IsLlsc
Alpha/MIPS LL or SC access.
Definition: packet.hh:164
gem5::MemCmd::UpgradeReq
@ UpgradeReq
Definition: packet.hh:102
std::vector< bool >
gem5::MemCmd::isWrite
bool isWrite() const
Definition: packet.hh:218
gem5::MemCmd::IsWrite
@ IsWrite
Data flows from requester to responder.
Definition: packet.hh:153
gem5::MemCmd::fromCache
bool fromCache() const
Definition: packet.hh:227
gem5::Packet::makeAtomicResponse
void makeAtomicResponse()
Definition: packet.hh:1043
gem5::Packet::PrintReqState::LabelStackEntry::labelPrinted
bool labelPrinted
Definition: packet.hh:478
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:1271
gem5::MemCmd::isDemand
bool isDemand() const
Definition: packet.hh:251
gem5::X86ISA::base
Bitfield< 51, 12 > base
Definition: pagetable.hh:141
gem5::MemCmd::IsRequest
@ IsRequest
Issued by requester.
Definition: packet.hh:158
gem5::PacketDataPtr
uint8_t * PacketDataPtr
Definition: packet.hh:71
gem5::ArmISA::i
Bitfield< 7 > i
Definition: misc_types.hh:66
gem5::MemCmd::operator==
bool operator==(MemCmd c2) const
Definition: packet.hh:272
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:420
gem5::Packet::PrintReqState::LabelStackEntry::label
const std::string label
Definition: packet.hh:476
gem5::Packet::setSatisfied
void setSatisfied()
Set when a request hits in a cache and the cache is not going to respond.
Definition: packet.hh:736
gem5::Packet::Flags
gem5::Flags< FlagsType > Flags
Definition: packet.hh:287
gem5::Packet::PrintReqState::printLabels
void printLabels()
Print all of the pending unprinted labels on the stack.
Definition: packet.cc:458
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:428
gem5::Packet::SenderState::predecessor
SenderState * predecessor
Definition: packet.hh:459
printable.hh
gem5::Packet::Packet
Packet(const RequestPtr &_req, MemCmd _cmd)
Constructor.
Definition: packet.hh:851
gem5::MemCmd::ReadCleanReq
@ ReadCleanReq
Definition: packet.hh:109
gem5::Packet::PrintReqState::LabelStackEntry::prefix
std::string * prefix
Definition: packet.hh:477
gem5::PacketPtr
Packet * PacketPtr
Definition: thread_context.hh:75
gem5::MemCmd::StoreCondFailReq
@ StoreCondFailReq
Definition: packet.hh:113
gem5::MemCmd::WritebackDirty
@ WritebackDirty
Definition: packet.hh:92
gem5::MemCmd::IsUpgrade
@ IsUpgrade
Definition: packet.hh:154
gem5::MemCmd::MemFenceResp
@ MemFenceResp
Definition: packet.hh:121
gem5::Packet::hasData
bool hasData() const
Definition: packet.hh:603
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:839
gem5::MemCmd::isError
bool isError() const
Definition: packet.hh:246
gem5::MemCmd
Definition: packet.hh:75
gem5::MemCmd::isResponse
bool isResponse() const
Definition: packet.hh:221
gem5::Packet::HAS_SHARERS
@ HAS_SHARERS
Definition: packet.hh:300
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:1384
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:819
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:438
gem5::Packet::PrintReqState::curPrefixPtr
std::string * curPrefixPtr
Definition: packet.hh:485
gem5::Packet::dataStatic
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
Definition: packet.hh:1134
gem5::MemCmd::IsError
@ IsError
Error response.
Definition: packet.hh:166
gem5::MemCmd::CommandInfo::response
const Command response
Corresponding response for requests; InvalidCmd if no response is applicable.
Definition: packet.hh:192
gem5::MemCmd::isEviction
bool isEviction() const
Definition: packet.hh:225
gem5::Flags< FlagsType >
gem5::MemCmd::HTMAbort
@ HTMAbort
Definition: packet.hh:142
gem5::Packet::PrintReqState::os
std::ostream & os
Definition: packet.hh:488
gem5::MemCmd::MemCmd
MemCmd(int _cmd)
Definition: packet.hh:269
gem5::Packet::isRead
bool isRead() const
Definition: packet.hh:582
gem5::Packet::needsWritable
bool needsWritable() const
Definition: packet.hh:588
gem5::MemCmd::NeedsWritable
@ NeedsWritable
Requires writable copy to complete in-cache.
Definition: packet.hh:157
gem5::MemCmd::CleanInvalidResp
@ CleanInvalidResp
Definition: packet.hh:125
gem5::MemCmd::WriteResp
@ WriteResp
Definition: packet.hh:90
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:767
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:220
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:283
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:394
gem5::Packet::setAddr
void setAddr(Addr _addr)
Update the address of this packet mid-transaction.
Definition: packet.hh:789
gem5::Packet::htmTransactionFailedInCache
bool htmTransactionFailedInCache() const
Returns whether or not this packet/request has returned from the cache hierarchy in a failed transact...
Definition: packet.cc:508
gem5::probing::Packet
ProbePointArg< PacketInfo > Packet
Packet probe point.
Definition: mem.hh:109
gem5::MemCmd::NUM_COMMAND_ATTRIBUTES
@ NUM_COMMAND_ATTRIBUTES
Definition: packet.hh:170
gem5::MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:326
gem5::MemCmd::cmd
Command cmd
Definition: packet.hh:207
gem5::Packet::SenderState::~SenderState
virtual ~SenderState()
Definition: packet.hh:461
gem5::Packet::PrintReqState::LabelStackEntry
An entry in the label stack.
Definition: packet.hh:474
gem5::Packet::satisfied
bool satisfied() const
Definition: packet.hh:742
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:764
gem5::ArmISA::v
Bitfield< 28 > v
Definition: misc_types.hh:54
gem5::MemCmd::LoadLockedReq
@ LoadLockedReq
Definition: packet.hh:111
gem5::Packet::htmReturnReason
HtmCacheFailure htmReturnReason
Holds the return status of the transaction.
Definition: packet.hh:403
gem5::RequestPtr
std::shared_ptr< Request > RequestPtr
Definition: request.hh:92
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:309
gem5::Packet::getConstPtr
const T * getConstPtr() const
Definition: packet.hh:1193
gem5::MemCmd::ReadReq
@ ReadReq
Definition: packet.hh:86
gem5::MemCmd::MemSyncReq
@ MemSyncReq
Definition: packet.hh:119
gem5::MemCmd::isHWPrefetch
bool isHWPrefetch() const
Definition: packet.hh:243
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:534
gem5::MemCmd::testCmdAttrib
bool testCmdAttrib(MemCmd::Attribute attrib) const
Definition: packet.hh:210
gem5::Packet::suppressFuncError
bool suppressFuncError() const
Definition: packet.hh:745
gem5::MemCmd::toInt
int toInt() const
Definition: packet.hh:266
gem5::Packet::isLLSC
bool isLLSC() const
Definition: packet.hh:609
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:408
gem5::Packet::PrintReqState::LabelStack
std::list< LabelStackEntry > LabelStack
Definition: packet.hh:482
gem5::Packet::setExpressSnoop
void setExpressSnoop()
The express snoop flag is used for two purposes.
Definition: packet.hh:688
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:344
gem5::Packet::clearBlockCached
void clearBlockCached()
Definition: packet.hh:748
gem5::Packet::PrintReqState::curPrefix
const std::string & curPrefix()
Returns the current line prefix.
Definition: packet.hh:497
gem5::MemCmd::CleanSharedReq
@ CleanSharedReq
Definition: packet.hh:122
gem5::MemCmd::CommandInfo::CommandInfo
CommandInfo(std::initializer_list< Attribute > attrs, Command _response, const std::string &_str)
Definition: packet.hh:196
gem5::Packet::makeHtmTransactionalReqResponse
void makeHtmTransactionalReqResponse(const HtmCacheFailure ret_code)
Communicates to the core that a packet was processed by the memory subsystem while running in transac...
Definition: packet.cc:482
compiler.hh
gem5::Packet::id
const PacketId id
Definition: packet.hh:363
gem5::Packet::makeReadCmd
static MemCmd makeReadCmd(const RequestPtr &req)
Generate the appropriate read MemCmd based on the Request flags.
Definition: packet.hh:966
gem5::Packet::getHtmTransactionFailedInCacheRC
HtmCacheFailure getHtmTransactionFailedInCacheRC() const
If a packet/request has returned from the cache hierarchy in a failed transaction,...
Definition: packet.cc:514
gem5::Packet::_qosValue
uint8_t _qosValue
Definition: packet.hh:394
gem5::Packet::setResponderHadWritable
void setResponderHadWritable()
On responding to a snoop request (which only happens for Modified or Owned lines),...
Definition: packet.hh:700
gem5::Packet::pushLabel
void pushLabel(const std::string &lbl)
Push label for PrintReq (safe to call unconditionally).
Definition: packet.hh:1420
gem5::Packet::SenderState
A virtual base opaque structure used to hold state associated with the packet (e.g....
Definition: packet.hh:457
gem5::MemCmd::ReadExReq
@ ReadExReq
Definition: packet.hh:107
gem5::Packet::cmd
MemCmd cmd
The command field of the packet.
Definition: packet.hh:361
gem5::ArmISA::t
Bitfield< 5 > t
Definition: misc_types.hh:70
gem5::MemCmd::IsPrint
@ IsPrint
Print state matching address (for debugging)
Definition: packet.hh:167
gem5::Packet::isPrint
bool isPrint() const
Definition: packet.hh:611
gem5::MemCmd::isFlush
bool isFlush() const
Definition: packet.hh:248
gem5::Packet::deleteData
void deleteData()
delete the data pointed to in the data pointer.
Definition: packet.hh:1315
gem5::MemCmd::SoftPFExReq
@ SoftPFExReq
Definition: packet.hh:97
gem5::Packet::popLabel
void popLabel()
Pop label for PrintReq (safe to call unconditionally).
Definition: packet.hh:1430
gem5::Packet::responderHadWritable
bool responderHadWritable() const
Definition: packet.hh:706
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:340
gem5::Packet::needsResponse
bool needsResponse() const
Definition: packet.hh:597
gem5::Packet::writeData
void writeData(uint8_t *p) const
Copy data from the packet to the memory at the provided pointer.
Definition: packet.hh:1281
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:610
gem5::MemCmd::CommandInfo::attributes
const std::bitset< NUM_COMMAND_ATTRIBUTES > attributes
Set of attribute flags.
Definition: packet.hh:189
gem5::Packet::senderState
SenderState * senderState
This packet's sender state.
Definition: packet.hh:534
gem5::Packet::flags
Flags flags
Definition: packet.hh:355
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:324
gem5::MemCmd::InvalidateResp
@ InvalidateResp
Definition: packet.hh:138
gem5::MemCmd::toString
const std::string & toString() const
Return the string to a cmd given by idx.
Definition: packet.hh:265
gem5::Packet::PrintReqState::printObj
void printObj(Printable *obj)
Print a Printable object to os, because it matched the address on a PrintReq.
Definition: packet.cc:475
gem5::Packet::dataStaticConst
void dataStaticConst(const T *p)
Set the data pointer to the following value that should not be freed.
Definition: packet.hh:1151
gem5::Packet::Command
MemCmd::Command Command
Definition: packet.hh:358
gem5::MemCmd::HTMReq
@ HTMReq
Definition: packet.hh:140
gem5::MemCmd::WriteCompleteResp
@ WriteCompleteResp
Definition: packet.hh:91
gem5::MemCmd::IsSWPrefetch
@ IsSWPrefetch
Definition: packet.hh:162
gem5::Packet::isClean
bool isClean() const
Definition: packet.hh:600
gem5::Packet::setHasSharers
void setHasSharers()
On fills, the hasSharers flag is used by the caches in combination with the cacheResponding flag,...
Definition: packet.hh:672
gem5::MemCmd::IsEviction
@ IsEviction
Definition: packet.hh:161
gem5::Packet::PrintReqState::LabelStackEntry::LabelStackEntry
LabelStackEntry(const std::string &_label, std::string *_prefix)
Definition: packet.cc:433
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::RESPONDER_FLAGS
@ RESPONDER_FLAGS
Definition: packet.hh:296
gem5::MemCmd::BadAddressError
@ BadAddressError
Definition: packet.hh:131
gem5::Packet::makeTimingResponse
void makeTimingResponse()
Definition: packet.hh:1049
gem5::Packet::isFlush
bool isFlush() const
Definition: packet.hh:612
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:892
gem5::c2
c2
Definition: intmath.hh:174
gem5::Packet::allocate
void allocate()
Allocate memory for the packet.
Definition: packet.hh:1326
gem5::MemCmd::isSWPrefetch
bool isSWPrefetch() const
Definition: packet.hh:242
gem5::Packet::Packet
Packet(const PacketPtr pkt, bool clear_flags, bool alloc_data)
Alternate constructor for copying a packet.
Definition: packet.hh:918
types.hh
gem5::Packet::PrintReqState::~PrintReqState
~PrintReqState()
Definition: packet.cc:425
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:1305
gem5::Packet::FROM_TRANSACTION
@ FROM_TRANSACTION
Definition: packet.hh:332
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:1031
gem5::Packet::dataDynamic
void dataDynamic(T *p)
Set the data pointer to a value that should have delete [] called on it.
Definition: packet.hh:1172
gem5::MemCmd::IsClean
@ IsClean
Cleans any existing dirty blocks.
Definition: packet.hh:156
gem5::MemCmd::MemCmd
MemCmd()
Definition: packet.hh:270
gem5::MemCmd::isPrint
bool isPrint() const
Definition: packet.hh:247
gem5::Packet::clearWriteThrough
void clearWriteThrough()
Definition: packet.hh:728
gem5::MemCmd::operator!=
bool operator!=(MemCmd c2) const
Definition: packet.hh:273
gem5::MemCmd::WriteReq
@ WriteReq
Definition: packet.hh:89
gem5::MemCmd::IsResponse
@ IsResponse
Issue by responder.
Definition: packet.hh:159
gem5::Packet::setBlockCached
void setBlockCached()
Definition: packet.hh:746
gem5::MemCmd::FunctionalWriteError
@ FunctionalWriteError
Definition: packet.hh:133
logging.hh
gem5::MemCmd::InvalidateReq
@ InvalidateReq
Definition: packet.hh:137
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:601
gem5::MemCmd::CommandInfo
Structure that defines attributes and other data associated with a Command.
Definition: packet.hh:186
gem5::MemCmd::MemFenceReq
@ MemFenceReq
Definition: packet.hh:118
gem5::Packet::trySatisfyFunctional
bool trySatisfyFunctional(PacketPtr other)
Check a functional request against a memory value stored in another packet (i.e.
Definition: packet.hh:1358
gem5::Packet::SUPPRESS_FUNC_ERROR
@ SUPPRESS_FUNC_ERROR
suppress the error if this packet encounters a functional access failure.
Definition: packet.hh:348
gem5::Packet::PrintReqState::verbosity
const int verbosity
Definition: packet.hh:489
gem5::Packet::SenderState::SenderState
SenderState()
Definition: packet.hh:460
gem5::Packet::isExpressSnoop
bool isExpressSnoop() const
Definition: packet.hh:689
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:241
gem5::MemCmd::PrintReq
@ PrintReq
Definition: packet.hh:135
gem5::Packet::setHtmTransactionFailedInCache
void setHtmTransactionFailedInCache(const HtmCacheFailure ret_code)
Stipulates that this packet/request has returned from the cache hierarchy in a failed transaction.
Definition: packet.cc:498
gem5::MemCmd::StoreCondResp
@ StoreCondResp
Definition: packet.hh:114
gem5::MemCmd::isWriteback
bool isWriteback() const
A writeback is an eviction that carries data.
Definition: packet.hh:232
gem5::Packet::FlagsType
uint32_t FlagsType
Definition: packet.hh:286
gem5::Packet::isMaskedWrite
bool isMaskedWrite() const
Definition: packet.hh:1400
gem5::Packet::PrintReqState::popLabel
void popLabel()
Pop a label off the label stack.
Definition: packet.cc:449
gem5::Packet::isHtmTransactional
bool isHtmTransactional() const
Returns whether or not this packet/request originates in the CPU executing in transactional mode,...
Definition: packet.cc:528
gem5::AddrRange
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
Definition: addr_range.hh:71
std::list
STL list class.
Definition: stl.hh:51
gem5::Packet::getAddr
Addr getAddr() const
Definition: packet.hh:781
gem5::Packet::copyResponderFlags
void copyResponderFlags(const PacketPtr pkt)
Copy the reponse flags from an input packet to this packet.
Definition: packet.cc:306
gem5::Packet::bytesValid
std::vector< bool > bytesValid
Track the bytes found that satisfy a functional read.
Definition: packet.hh:391
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::MemCmd::FromCache
@ FromCache
Request originated from a caching agent.
Definition: packet.hh:169
gem5::MemCmd::MemSyncResp
@ MemSyncResp
Definition: packet.hh:120
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:1007
gem5::Packet::getAddrRange
AddrRange getAddrRange() const
Get address range to which this packet belongs.
Definition: packet.cc:225
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:387
gem5::Packet::cmdToIndex
int cmdToIndex() const
Return the index of this command.
Definition: packet.hh:580
gem5::MemCmd::isPrefetch
bool isPrefetch() const
Definition: packet.hh:244
gem5::Packet::setUintX
void setUintX(uint64_t w, ByteOrder endian)
Set the value in the word w after truncating it to the length of the packet and then byteswapping it ...
Definition: packet.cc:351
gem5::MemCmd::ReadRespWithInvalidate
@ ReadRespWithInvalidate
Definition: packet.hh:88
gem5::MemCmd::isRead
bool isRead() const
Definition: packet.hh:217
gem5::MemCmd::NeedsResponse
@ NeedsResponse
Requester needs response from target.
Definition: packet.hh:160
gem5::MemCmd::HTMReqResp
@ HTMReqResp
Definition: packet.hh:141
gem5::Packet::setSuppressFuncError
void setSuppressFuncError()
Definition: packet.hh:744
gem5::Packet::BLOCK_CACHED
@ BLOCK_CACHED
Definition: packet.hh:352
gem5::Packet::isBlockCached
bool isBlockCached() const
Definition: packet.hh:747
gem5::Packet::isResponse
bool isResponse() const
Definition: packet.hh:587
gem5::Packet::CACHE_RESPONDING
@ CACHE_RESPONDING
Definition: packet.hh:313
gem5::MemCmd::WriteLineReq
@ WriteLineReq
Definition: packet.hh:101
gem5::Packet::getSize
unsigned getSize() const
Definition: packet.hh:791
gem5::MemCmd::UpgradeFailResp
@ UpgradeFailResp
Definition: packet.hh:106
gem5::Packet::isWholeLineWrite
bool isWholeLineWrite(unsigned blk_size)
Definition: packet.hh:614
gem5::MemCmd::IsRead
@ IsRead
Data flows from responder to requester.
Definition: packet.hh:152
gem5::Packet::hasRespData
bool hasRespData() const
Definition: packet.hh:604
gem5::MemCmd::needsWritable
bool needsWritable() const
Definition: packet.hh:222
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:599
gem5::Packet::isInvalidate
bool isInvalidate() const
Definition: packet.hh:598
gem5::Packet::addr
Addr addr
The address of the request.
Definition: packet.hh:380
gem5::MemCmd::HardPFResp
@ HardPFResp
Definition: packet.hh:100
gem5::Packet::WRITE_THROUGH
@ WRITE_THROUGH
Definition: packet.hh:317
gem5::Packet::SATISFIED
@ SATISFIED
Definition: packet.hh:321
gem5::Packet::isDemand
bool isDemand() const
Definition: packet.hh:584
gem5::Packet::getPtr
T * getPtr()
get a pointer to the data ptr.
Definition: packet.hh:1184
gem5::MemCmd::SoftPFReq
@ SoftPFReq
Definition: packet.hh:96
gem5::Packet::PrintReqState
Object used to maintain state of a PrintReq.
Definition: packet.hh:468
gem5::MemCmd::isUpgrade
bool isUpgrade() const
Definition: packet.hh:219
gem5::MemCmd::InvalidDestError
@ InvalidDestError
Definition: packet.hh:130
gem5::Packet::setSize
void setSize(unsigned size)
Definition: packet.hh:1067

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