arch-power: Fix disassembly for compare instructions
[gem5.git] / src / mem / packet.hh
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
42 /**
43 * @file
44 * Declaration of the Packet class.
45 */
46
47 #ifndef __MEM_PACKET_HH__
48 #define __MEM_PACKET_HH__
49
50 #include <bitset>
51 #include <cassert>
52 #include <list>
53
54 #include "base/addr_range.hh"
55 #include "base/cast.hh"
56 #include "base/compiler.hh"
57 #include "base/flags.hh"
58 #include "base/logging.hh"
59 #include "base/printable.hh"
60 #include "base/types.hh"
61 #include "mem/htm.hh"
62 #include "mem/request.hh"
63 #include "sim/byteswap.hh"
64 #include "sim/core.hh"
65
66 class Packet;
67 typedef Packet *PacketPtr;
68 typedef uint8_t* PacketDataPtr;
69 typedef std::list<PacketPtr> PacketList;
70 typedef uint64_t PacketId;
71
72 class MemCmd
73 {
74 friend class Packet;
75
76 public:
77 /**
78 * List of all commands associated with a packet.
79 */
80 enum Command
81 {
82 InvalidCmd,
83 ReadReq,
84 ReadResp,
85 ReadRespWithInvalidate,
86 WriteReq,
87 WriteResp,
88 WriteCompleteResp,
89 WritebackDirty,
90 WritebackClean,
91 WriteClean, // writes dirty data below without evicting
92 CleanEvict,
93 SoftPFReq,
94 SoftPFExReq,
95 HardPFReq,
96 SoftPFResp,
97 HardPFResp,
98 WriteLineReq,
99 UpgradeReq,
100 SCUpgradeReq, // Special "weak" upgrade for StoreCond
101 UpgradeResp,
102 SCUpgradeFailReq, // Failed SCUpgradeReq in MSHR (never sent)
103 UpgradeFailResp, // Valid for SCUpgradeReq only
104 ReadExReq,
105 ReadExResp,
106 ReadCleanReq,
107 ReadSharedReq,
108 LoadLockedReq,
109 StoreCondReq,
110 StoreCondFailReq, // Failed StoreCondReq in MSHR (never sent)
111 StoreCondResp,
112 SwapReq,
113 SwapResp,
114 // MessageReq and MessageResp are deprecated.
115 MemFenceReq = SwapResp + 3,
116 MemSyncReq, // memory synchronization request (e.g., cache invalidate)
117 MemSyncResp, // memory synchronization response
118 MemFenceResp,
119 CleanSharedReq,
120 CleanSharedResp,
121 CleanInvalidReq,
122 CleanInvalidResp,
123 // Error responses
124 // @TODO these should be classified as responses rather than
125 // requests; coding them as requests initially for backwards
126 // compatibility
127 InvalidDestError, // packet dest field invalid
128 BadAddressError, // memory address invalid
129 FunctionalReadError, // unable to fulfill functional read
130 FunctionalWriteError, // unable to fulfill functional write
131 // Fake simulator-only commands
132 PrintReq, // Print state matching address
133 FlushReq, //request for a cache flush
134 InvalidateReq, // request for address to be invalidated
135 InvalidateResp,
136 // hardware transactional memory
137 HTMReq,
138 HTMReqResp,
139 HTMAbort,
140 NUM_MEM_CMDS
141 };
142
143 private:
144 /**
145 * List of command attributes.
146 */
147 enum Attribute
148 {
149 IsRead, //!< Data flows from responder to requester
150 IsWrite, //!< Data flows from requester to responder
151 IsUpgrade,
152 IsInvalidate,
153 IsClean, //!< Cleans any existing dirty blocks
154 NeedsWritable, //!< Requires writable copy to complete in-cache
155 IsRequest, //!< Issued by requester
156 IsResponse, //!< Issue by responder
157 NeedsResponse, //!< Requester needs response from target
158 IsEviction,
159 IsSWPrefetch,
160 IsHWPrefetch,
161 IsLlsc, //!< Alpha/MIPS LL or SC access
162 HasData, //!< There is an associated payload
163 IsError, //!< Error response
164 IsPrint, //!< Print state matching address (for debugging)
165 IsFlush, //!< Flush the address from caches
166 FromCache, //!< Request originated from a caching agent
167 NUM_COMMAND_ATTRIBUTES
168 };
169
170 /**
171 * Structure that defines attributes and other data associated
172 * with a Command.
173 */
174 struct CommandInfo
175 {
176 /// Set of attribute flags.
177 const std::bitset<NUM_COMMAND_ATTRIBUTES> attributes;
178 /// Corresponding response for requests; InvalidCmd if no
179 /// response is applicable.
180 const Command response;
181 /// String representation (for printing)
182 const std::string str;
183 };
184
185 /// Array to map Command enum to associated info.
186 static const CommandInfo commandInfo[];
187
188 private:
189
190 Command cmd;
191
192 bool
193 testCmdAttrib(MemCmd::Attribute attrib) const
194 {
195 return commandInfo[cmd].attributes[attrib] != 0;
196 }
197
198 public:
199
200 bool isRead() const { return testCmdAttrib(IsRead); }
201 bool isWrite() const { return testCmdAttrib(IsWrite); }
202 bool isUpgrade() const { return testCmdAttrib(IsUpgrade); }
203 bool isRequest() const { return testCmdAttrib(IsRequest); }
204 bool isResponse() const { return testCmdAttrib(IsResponse); }
205 bool needsWritable() const { return testCmdAttrib(NeedsWritable); }
206 bool needsResponse() const { return testCmdAttrib(NeedsResponse); }
207 bool isInvalidate() const { return testCmdAttrib(IsInvalidate); }
208 bool isEviction() const { return testCmdAttrib(IsEviction); }
209 bool isClean() const { return testCmdAttrib(IsClean); }
210 bool fromCache() const { return testCmdAttrib(FromCache); }
211
212 /**
213 * A writeback is an eviction that carries data.
214 */
215 bool isWriteback() const { return testCmdAttrib(IsEviction) &&
216 testCmdAttrib(HasData); }
217
218 /**
219 * Check if this particular packet type carries payload data. Note
220 * that this does not reflect if the data pointer of the packet is
221 * valid or not.
222 */
223 bool hasData() const { return testCmdAttrib(HasData); }
224 bool isLLSC() const { return testCmdAttrib(IsLlsc); }
225 bool isSWPrefetch() const { return testCmdAttrib(IsSWPrefetch); }
226 bool isHWPrefetch() const { return testCmdAttrib(IsHWPrefetch); }
227 bool isPrefetch() const { return testCmdAttrib(IsSWPrefetch) ||
228 testCmdAttrib(IsHWPrefetch); }
229 bool isError() const { return testCmdAttrib(IsError); }
230 bool isPrint() const { return testCmdAttrib(IsPrint); }
231 bool isFlush() const { return testCmdAttrib(IsFlush); }
232
233 Command
234 responseCommand() const
235 {
236 return commandInfo[cmd].response;
237 }
238
239 /// Return the string to a cmd given by idx.
240 const std::string &toString() const { return commandInfo[cmd].str; }
241 int toInt() const { return (int)cmd; }
242
243 MemCmd(Command _cmd) : cmd(_cmd) { }
244 MemCmd(int _cmd) : cmd((Command)_cmd) { }
245 MemCmd() : cmd(InvalidCmd) { }
246
247 bool operator==(MemCmd c2) const { return (cmd == c2.cmd); }
248 bool operator!=(MemCmd c2) const { return (cmd != c2.cmd); }
249 };
250
251 /**
252 * A Packet is used to encapsulate a transfer between two objects in
253 * the memory system (e.g., the L1 and L2 cache). (In contrast, a
254 * single Request travels all the way from the requestor to the
255 * ultimate destination and back, possibly being conveyed by several
256 * different Packets along the way.)
257 */
258 class Packet : public Printable
259 {
260 public:
261 typedef uint32_t FlagsType;
262 typedef ::Flags<FlagsType> Flags;
263
264 private:
265
266 enum : FlagsType {
267 // Flags to transfer across when copying a packet
268 COPY_FLAGS = 0x000000FF,
269
270 // Flags that are used to create reponse packets
271 RESPONDER_FLAGS = 0x00000009,
272
273 // Does this packet have sharers (which means it should not be
274 // considered writable) or not. See setHasSharers below.
275 HAS_SHARERS = 0x00000001,
276
277 // Special control flags
278 /// Special timing-mode atomic snoop for multi-level coherence.
279 EXPRESS_SNOOP = 0x00000002,
280
281 /// Allow a responding cache to inform the cache hierarchy
282 /// that it had a writable copy before responding. See
283 /// setResponderHadWritable below.
284 RESPONDER_HAD_WRITABLE = 0x00000004,
285
286 // Snoop co-ordination flag to indicate that a cache is
287 // responding to a snoop. See setCacheResponding below.
288 CACHE_RESPONDING = 0x00000008,
289
290 // The writeback/writeclean should be propagated further
291 // downstream by the receiver
292 WRITE_THROUGH = 0x00000010,
293
294 // Response co-ordination flag for cache maintenance
295 // operations
296 SATISFIED = 0x00000020,
297
298 // hardware transactional memory
299
300 // Indicates that this packet/request has returned from the
301 // cache hierarchy in a failed transaction. The core is
302 // notified like this.
303 FAILS_TRANSACTION = 0x00000040,
304
305 // Indicates that this packet/request originates in the CPU executing
306 // in transactional mode, i.e. in a transaction.
307 FROM_TRANSACTION = 0x00000080,
308
309 /// Are the 'addr' and 'size' fields valid?
310 VALID_ADDR = 0x00000100,
311 VALID_SIZE = 0x00000200,
312
313 /// Is the data pointer set to a value that shouldn't be freed
314 /// when the packet is destroyed?
315 STATIC_DATA = 0x00001000,
316 /// The data pointer points to a value that should be freed when
317 /// the packet is destroyed. The pointer is assumed to be pointing
318 /// to an array, and delete [] is consequently called
319 DYNAMIC_DATA = 0x00002000,
320
321 /// suppress the error if this packet encounters a functional
322 /// access failure.
323 SUPPRESS_FUNC_ERROR = 0x00008000,
324
325 // Signal block present to squash prefetch and cache evict packets
326 // through express snoop flag
327 BLOCK_CACHED = 0x00010000
328 };
329
330 Flags flags;
331
332 public:
333 typedef MemCmd::Command Command;
334
335 /// The command field of the packet.
336 MemCmd cmd;
337
338 const PacketId id;
339
340 /// A pointer to the original request.
341 RequestPtr req;
342
343 private:
344 /**
345 * A pointer to the data being transferred. It can be different
346 * sizes at each level of the hierarchy so it belongs to the
347 * packet, not request. This may or may not be populated when a
348 * responder receives the packet. If not populated memory should
349 * be allocated.
350 */
351 PacketDataPtr data;
352
353 /// The address of the request. This address could be virtual or
354 /// physical, depending on the system configuration.
355 Addr addr;
356
357 /// True if the request targets the secure memory space.
358 bool _isSecure;
359
360 /// The size of the request or transfer.
361 unsigned size;
362
363 /**
364 * Track the bytes found that satisfy a functional read.
365 */
366 std::vector<bool> bytesValid;
367
368 // Quality of Service priority value
369 uint8_t _qosValue;
370
371 // hardware transactional memory
372
373 /**
374 * Holds the return status of the transaction.
375 * The default case will be NO_FAIL, otherwise this will specify the
376 * reason for the transaction's failure in the memory subsystem.
377 */
378 HtmCacheFailure htmReturnReason;
379
380 /**
381 * A global unique identifier of the transaction.
382 * This is used for correctness/debugging only.
383 */
384 uint64_t htmTransactionUid;
385
386 public:
387
388 /**
389 * The extra delay from seeing the packet until the header is
390 * transmitted. This delay is used to communicate the crossbar
391 * forwarding latency to the neighbouring object (e.g. a cache)
392 * that actually makes the packet wait. As the delay is relative,
393 * a 32-bit unsigned should be sufficient.
394 */
395 uint32_t headerDelay;
396
397 /**
398 * Keep track of the extra delay incurred by snooping upwards
399 * before sending a request down the memory system. This is used
400 * by the coherent crossbar to account for the additional request
401 * delay.
402 */
403 uint32_t snoopDelay;
404
405 /**
406 * The extra pipelining delay from seeing the packet until the end of
407 * payload is transmitted by the component that provided it (if
408 * any). This includes the header delay. Similar to the header
409 * delay, this is used to make up for the fact that the
410 * crossbar does not make the packet wait. As the delay is
411 * relative, a 32-bit unsigned should be sufficient.
412 */
413 uint32_t payloadDelay;
414
415 /**
416 * A virtual base opaque structure used to hold state associated
417 * with the packet (e.g., an MSHR), specific to a SimObject that
418 * sees the packet. A pointer to this state is returned in the
419 * packet's response so that the SimObject in question can quickly
420 * look up the state needed to process it. A specific subclass
421 * would be derived from this to carry state specific to a
422 * particular sending device.
423 *
424 * As multiple SimObjects may add their SenderState throughout the
425 * memory system, the SenderStates create a stack, where a
426 * SimObject can add a new Senderstate, as long as the
427 * predecessing SenderState is restored when the response comes
428 * back. For this reason, the predecessor should always be
429 * populated with the current SenderState of a packet before
430 * modifying the senderState field in the request packet.
431 */
432 struct SenderState
433 {
434 SenderState* predecessor;
435 SenderState() : predecessor(NULL) {}
436 virtual ~SenderState() {}
437 };
438
439 /**
440 * Object used to maintain state of a PrintReq. The senderState
441 * field of a PrintReq should always be of this type.
442 */
443 class PrintReqState : public SenderState
444 {
445 private:
446 /**
447 * An entry in the label stack.
448 */
449 struct LabelStackEntry
450 {
451 const std::string label;
452 std::string *prefix;
453 bool labelPrinted;
454 LabelStackEntry(const std::string &_label, std::string *_prefix);
455 };
456
457 typedef std::list<LabelStackEntry> LabelStack;
458 LabelStack labelStack;
459
460 std::string *curPrefixPtr;
461
462 public:
463 std::ostream &os;
464 const int verbosity;
465
466 PrintReqState(std::ostream &os, int verbosity = 0);
467 ~PrintReqState();
468
469 /**
470 * Returns the current line prefix.
471 */
472 const std::string &curPrefix() { return *curPrefixPtr; }
473
474 /**
475 * Push a label onto the label stack, and prepend the given
476 * prefix string onto the current prefix. Labels will only be
477 * printed if an object within the label's scope is printed.
478 */
479 void pushLabel(const std::string &lbl,
480 const std::string &prefix = " ");
481
482 /**
483 * Pop a label off the label stack.
484 */
485 void popLabel();
486
487 /**
488 * Print all of the pending unprinted labels on the
489 * stack. Called by printObj(), so normally not called by
490 * users unless bypassing printObj().
491 */
492 void printLabels();
493
494 /**
495 * Print a Printable object to os, because it matched the
496 * address on a PrintReq.
497 */
498 void printObj(Printable *obj);
499 };
500
501 /**
502 * This packet's sender state. Devices should use dynamic_cast<>
503 * to cast to the state appropriate to the sender. The intent of
504 * this variable is to allow a device to attach extra information
505 * to a request. A response packet must return the sender state
506 * that was attached to the original request (even if a new packet
507 * is created).
508 */
509 SenderState *senderState;
510
511 /**
512 * Push a new sender state to the packet and make the current
513 * sender state the predecessor of the new one. This should be
514 * prefered over direct manipulation of the senderState member
515 * variable.
516 *
517 * @param sender_state SenderState to push at the top of the stack
518 */
519 void pushSenderState(SenderState *sender_state);
520
521 /**
522 * Pop the top of the state stack and return a pointer to it. This
523 * assumes the current sender state is not NULL. This should be
524 * preferred over direct manipulation of the senderState member
525 * variable.
526 *
527 * @return The current top of the stack
528 */
529 SenderState *popSenderState();
530
531 /**
532 * Go through the sender state stack and return the first instance
533 * that is of type T (as determined by a dynamic_cast). If there
534 * is no sender state of type T, NULL is returned.
535 *
536 * @return The topmost state of type T
537 */
538 template <typename T>
539 T * findNextSenderState() const
540 {
541 T *t = NULL;
542 SenderState* sender_state = senderState;
543 while (t == NULL && sender_state != NULL) {
544 t = dynamic_cast<T*>(sender_state);
545 sender_state = sender_state->predecessor;
546 }
547 return t;
548 }
549
550 /// Return the string name of the cmd field (for debugging and
551 /// tracing).
552 const std::string &cmdString() const { return cmd.toString(); }
553
554 /// Return the index of this command.
555 inline int cmdToIndex() const { return cmd.toInt(); }
556
557 bool isRead() const { return cmd.isRead(); }
558 bool isWrite() const { return cmd.isWrite(); }
559 bool isUpgrade() const { return cmd.isUpgrade(); }
560 bool isRequest() const { return cmd.isRequest(); }
561 bool isResponse() const { return cmd.isResponse(); }
562 bool needsWritable() const
563 {
564 // we should never check if a response needsWritable, the
565 // request has this flag, and for a response we should rather
566 // look at the hasSharers flag (if not set, the response is to
567 // be considered writable)
568 assert(isRequest());
569 return cmd.needsWritable();
570 }
571 bool needsResponse() const { return cmd.needsResponse(); }
572 bool isInvalidate() const { return cmd.isInvalidate(); }
573 bool isEviction() const { return cmd.isEviction(); }
574 bool isClean() const { return cmd.isClean(); }
575 bool fromCache() const { return cmd.fromCache(); }
576 bool isWriteback() const { return cmd.isWriteback(); }
577 bool hasData() const { return cmd.hasData(); }
578 bool hasRespData() const
579 {
580 MemCmd resp_cmd = cmd.responseCommand();
581 return resp_cmd.hasData();
582 }
583 bool isLLSC() const { return cmd.isLLSC(); }
584 bool isError() const { return cmd.isError(); }
585 bool isPrint() const { return cmd.isPrint(); }
586 bool isFlush() const { return cmd.isFlush(); }
587
588 bool isWholeLineWrite(unsigned blk_size)
589 {
590 return (cmd == MemCmd::WriteReq || cmd == MemCmd::WriteLineReq) &&
591 getOffset(blk_size) == 0 && getSize() == blk_size;
592 }
593
594 //@{
595 /// Snoop flags
596 /**
597 * Set the cacheResponding flag. This is used by the caches to
598 * signal another cache that they are responding to a request. A
599 * cache will only respond to snoops if it has the line in either
600 * Modified or Owned state. Note that on snoop hits we always pass
601 * the line as Modified and never Owned. In the case of an Owned
602 * line we proceed to invalidate all other copies.
603 *
604 * On a cache fill (see Cache::handleFill), we check hasSharers
605 * first, ignoring the cacheResponding flag if hasSharers is set.
606 * A line is consequently allocated as:
607 *
608 * hasSharers cacheResponding state
609 * true false Shared
610 * true true Shared
611 * false false Exclusive
612 * false true Modified
613 */
614 void setCacheResponding()
615 {
616 assert(isRequest());
617 assert(!flags.isSet(CACHE_RESPONDING));
618 flags.set(CACHE_RESPONDING);
619 }
620 bool cacheResponding() const { return flags.isSet(CACHE_RESPONDING); }
621 /**
622 * On fills, the hasSharers flag is used by the caches in
623 * combination with the cacheResponding flag, as clarified
624 * above. If the hasSharers flag is not set, the packet is passing
625 * writable. Thus, a response from a memory passes the line as
626 * writable by default.
627 *
628 * The hasSharers flag is also used by upstream caches to inform a
629 * downstream cache that they have the block (by calling
630 * setHasSharers on snoop request packets that hit in upstream
631 * cachs tags or MSHRs). If the snoop packet has sharers, a
632 * downstream cache is prevented from passing a dirty line upwards
633 * if it was not explicitly asked for a writable copy. See
634 * Cache::satisfyCpuSideRequest.
635 *
636 * The hasSharers flag is also used on writebacks, in
637 * combination with the WritbackClean or WritebackDirty commands,
638 * to allocate the block downstream either as:
639 *
640 * command hasSharers state
641 * WritebackDirty false Modified
642 * WritebackDirty true Owned
643 * WritebackClean false Exclusive
644 * WritebackClean true Shared
645 */
646 void setHasSharers() { flags.set(HAS_SHARERS); }
647 bool hasSharers() const { return flags.isSet(HAS_SHARERS); }
648 //@}
649
650 /**
651 * The express snoop flag is used for two purposes. Firstly, it is
652 * used to bypass flow control for normal (non-snoop) requests
653 * going downstream in the memory system. In cases where a cache
654 * is responding to a snoop from another cache (it had a dirty
655 * line), but the line is not writable (and there are possibly
656 * other copies), the express snoop flag is set by the downstream
657 * cache to invalidate all other copies in zero time. Secondly,
658 * the express snoop flag is also set to be able to distinguish
659 * snoop packets that came from a downstream cache, rather than
660 * snoop packets from neighbouring caches.
661 */
662 void setExpressSnoop() { flags.set(EXPRESS_SNOOP); }
663 bool isExpressSnoop() const { return flags.isSet(EXPRESS_SNOOP); }
664
665 /**
666 * On responding to a snoop request (which only happens for
667 * Modified or Owned lines), make sure that we can transform an
668 * Owned response to a Modified one. If this flag is not set, the
669 * responding cache had the line in the Owned state, and there are
670 * possibly other Shared copies in the memory system. A downstream
671 * cache helps in orchestrating the invalidation of these copies
672 * by sending out the appropriate express snoops.
673 */
674 void setResponderHadWritable()
675 {
676 assert(cacheResponding());
677 assert(!responderHadWritable());
678 flags.set(RESPONDER_HAD_WRITABLE);
679 }
680 bool responderHadWritable() const
681 { return flags.isSet(RESPONDER_HAD_WRITABLE); }
682
683 /**
684 * Copy the reponse flags from an input packet to this packet. The
685 * reponse flags determine whether a responder has been found and
686 * the state at which the block will be at the destination.
687 *
688 * @pkt The packet that we will copy flags from
689 */
690 void copyResponderFlags(const PacketPtr pkt);
691
692 /**
693 * A writeback/writeclean cmd gets propagated further downstream
694 * by the receiver when the flag is set.
695 */
696 void setWriteThrough()
697 {
698 assert(cmd.isWrite() &&
699 (cmd.isEviction() || cmd == MemCmd::WriteClean));
700 flags.set(WRITE_THROUGH);
701 }
702 void clearWriteThrough() { flags.clear(WRITE_THROUGH); }
703 bool writeThrough() const { return flags.isSet(WRITE_THROUGH); }
704
705 /**
706 * Set when a request hits in a cache and the cache is not going
707 * to respond. This is used by the crossbar to coordinate
708 * responses for cache maintenance operations.
709 */
710 void setSatisfied()
711 {
712 assert(cmd.isClean());
713 assert(!flags.isSet(SATISFIED));
714 flags.set(SATISFIED);
715 }
716 bool satisfied() const { return flags.isSet(SATISFIED); }
717
718 void setSuppressFuncError() { flags.set(SUPPRESS_FUNC_ERROR); }
719 bool suppressFuncError() const { return flags.isSet(SUPPRESS_FUNC_ERROR); }
720 void setBlockCached() { flags.set(BLOCK_CACHED); }
721 bool isBlockCached() const { return flags.isSet(BLOCK_CACHED); }
722 void clearBlockCached() { flags.clear(BLOCK_CACHED); }
723
724 /**
725 * QoS Value getter
726 * Returns 0 if QoS value was never set (constructor default).
727 *
728 * @return QoS priority value of the packet
729 */
730 inline uint8_t qosValue() const { return _qosValue; }
731
732 /**
733 * QoS Value setter
734 * Interface for setting QoS priority value of the packet.
735 *
736 * @param qos_value QoS priority value
737 */
738 inline void qosValue(const uint8_t qos_value)
739 { _qosValue = qos_value; }
740
741 inline RequestorID requestorId() const { return req->requestorId(); }
742
743 // Network error conditions... encapsulate them as methods since
744 // their encoding keeps changing (from result field to command
745 // field, etc.)
746 void
747 setBadAddress()
748 {
749 assert(isResponse());
750 cmd = MemCmd::BadAddressError;
751 }
752
753 void copyError(Packet *pkt) { assert(pkt->isError()); cmd = pkt->cmd; }
754
755 Addr getAddr() const { assert(flags.isSet(VALID_ADDR)); return addr; }
756 /**
757 * Update the address of this packet mid-transaction. This is used
758 * by the address mapper to change an already set address to a new
759 * one based on the system configuration. It is intended to remap
760 * an existing address, so it asserts that the current address is
761 * valid.
762 */
763 void setAddr(Addr _addr) { assert(flags.isSet(VALID_ADDR)); addr = _addr; }
764
765 unsigned getSize() const { assert(flags.isSet(VALID_SIZE)); return size; }
766
767 /**
768 * Get address range to which this packet belongs.
769 *
770 * @return Address range of this packet.
771 */
772 AddrRange getAddrRange() const;
773
774 Addr getOffset(unsigned int blk_size) const
775 {
776 return getAddr() & Addr(blk_size - 1);
777 }
778
779 Addr getBlockAddr(unsigned int blk_size) const
780 {
781 return getAddr() & ~(Addr(blk_size - 1));
782 }
783
784 bool isSecure() const
785 {
786 assert(flags.isSet(VALID_ADDR));
787 return _isSecure;
788 }
789
790 /**
791 * Accessor function to atomic op.
792 */
793 AtomicOpFunctor *getAtomicOp() const { return req->getAtomicOpFunctor(); }
794 bool isAtomicOp() const { return req->isAtomic(); }
795
796 /**
797 * It has been determined that the SC packet should successfully update
798 * memory. Therefore, convert this SC packet to a normal write.
799 */
800 void
801 convertScToWrite()
802 {
803 assert(isLLSC());
804 assert(isWrite());
805 cmd = MemCmd::WriteReq;
806 }
807
808 /**
809 * When ruby is in use, Ruby will monitor the cache line and the
810 * phys memory should treat LL ops as normal reads.
811 */
812 void
813 convertLlToRead()
814 {
815 assert(isLLSC());
816 assert(isRead());
817 cmd = MemCmd::ReadReq;
818 }
819
820 /**
821 * Constructor. Note that a Request object must be constructed
822 * first, but the Requests's physical address and size fields need
823 * not be valid. The command must be supplied.
824 */
825 Packet(const RequestPtr &_req, MemCmd _cmd)
826 : cmd(_cmd), id((PacketId)_req.get()), req(_req),
827 data(nullptr), addr(0), _isSecure(false), size(0),
828 _qosValue(0),
829 htmReturnReason(HtmCacheFailure::NO_FAIL),
830 htmTransactionUid(0),
831 headerDelay(0), snoopDelay(0),
832 payloadDelay(0), senderState(NULL)
833 {
834 flags.clear();
835 if (req->hasPaddr()) {
836 addr = req->getPaddr();
837 flags.set(VALID_ADDR);
838 _isSecure = req->isSecure();
839 }
840
841 /**
842 * hardware transactional memory
843 *
844 * This is a bit of a hack!
845 * Technically the address of a HTM command is set to zero
846 * but is not valid. The reason that we pretend it's valid is
847 * to void the getAddr() function from failing. It would be
848 * cumbersome to add control flow in many places to check if the
849 * packet represents a HTM command before calling getAddr().
850 */
851 if (req->isHTMCmd()) {
852 flags.set(VALID_ADDR);
853 assert(addr == 0x0);
854 }
855 if (req->hasSize()) {
856 size = req->getSize();
857 flags.set(VALID_SIZE);
858 }
859 }
860
861 /**
862 * Alternate constructor if you are trying to create a packet with
863 * a request that is for a whole block, not the address from the
864 * req. this allows for overriding the size/addr of the req.
865 */
866 Packet(const RequestPtr &_req, MemCmd _cmd, int _blkSize, PacketId _id = 0)
867 : cmd(_cmd), id(_id ? _id : (PacketId)_req.get()), req(_req),
868 data(nullptr), addr(0), _isSecure(false),
869 _qosValue(0),
870 htmReturnReason(HtmCacheFailure::NO_FAIL),
871 htmTransactionUid(0),
872 headerDelay(0),
873 snoopDelay(0), payloadDelay(0), senderState(NULL)
874 {
875 flags.clear();
876 if (req->hasPaddr()) {
877 addr = req->getPaddr() & ~(_blkSize - 1);
878 flags.set(VALID_ADDR);
879 _isSecure = req->isSecure();
880 }
881 size = _blkSize;
882 flags.set(VALID_SIZE);
883 }
884
885 /**
886 * Alternate constructor for copying a packet. Copy all fields
887 * *except* if the original packet's data was dynamic, don't copy
888 * that, as we can't guarantee that the new packet's lifetime is
889 * less than that of the original packet. In this case the new
890 * packet should allocate its own data.
891 */
892 Packet(const PacketPtr pkt, bool clear_flags, bool alloc_data)
893 : cmd(pkt->cmd), id(pkt->id), req(pkt->req),
894 data(nullptr),
895 addr(pkt->addr), _isSecure(pkt->_isSecure), size(pkt->size),
896 bytesValid(pkt->bytesValid),
897 _qosValue(pkt->qosValue()),
898 htmReturnReason(HtmCacheFailure::NO_FAIL),
899 htmTransactionUid(0),
900 headerDelay(pkt->headerDelay),
901 snoopDelay(0),
902 payloadDelay(pkt->payloadDelay),
903 senderState(pkt->senderState)
904 {
905 if (!clear_flags)
906 flags.set(pkt->flags & COPY_FLAGS);
907
908 flags.set(pkt->flags & (VALID_ADDR|VALID_SIZE));
909
910 if (pkt->isHtmTransactional())
911 setHtmTransactional(pkt->getHtmTransactionUid());
912
913 if (pkt->htmTransactionFailedInCache()) {
914 setHtmTransactionFailedInCache(
915 pkt->getHtmTransactionFailedInCacheRC()
916 );
917 }
918
919 // should we allocate space for data, or not, the express
920 // snoops do not need to carry any data as they only serve to
921 // co-ordinate state changes
922 if (alloc_data) {
923 // even if asked to allocate data, if the original packet
924 // holds static data, then the sender will not be doing
925 // any memcpy on receiving the response, thus we simply
926 // carry the pointer forward
927 if (pkt->flags.isSet(STATIC_DATA)) {
928 data = pkt->data;
929 flags.set(STATIC_DATA);
930 } else {
931 allocate();
932 }
933 }
934 }
935
936 /**
937 * Generate the appropriate read MemCmd based on the Request flags.
938 */
939 static MemCmd
940 makeReadCmd(const RequestPtr &req)
941 {
942 if (req->isHTMCmd()) {
943 if (req->isHTMAbort())
944 return MemCmd::HTMAbort;
945 else
946 return MemCmd::HTMReq;
947 } else if (req->isLLSC())
948 return MemCmd::LoadLockedReq;
949 else if (req->isPrefetchEx())
950 return MemCmd::SoftPFExReq;
951 else if (req->isPrefetch())
952 return MemCmd::SoftPFReq;
953 else
954 return MemCmd::ReadReq;
955 }
956
957 /**
958 * Generate the appropriate write MemCmd based on the Request flags.
959 */
960 static MemCmd
961 makeWriteCmd(const RequestPtr &req)
962 {
963 if (req->isLLSC())
964 return MemCmd::StoreCondReq;
965 else if (req->isSwap() || req->isAtomic())
966 return MemCmd::SwapReq;
967 else if (req->isCacheInvalidate()) {
968 return req->isCacheClean() ? MemCmd::CleanInvalidReq :
969 MemCmd::InvalidateReq;
970 } else if (req->isCacheClean()) {
971 return MemCmd::CleanSharedReq;
972 } else
973 return MemCmd::WriteReq;
974 }
975
976 /**
977 * Constructor-like methods that return Packets based on Request objects.
978 * Fine-tune the MemCmd type if it's not a vanilla read or write.
979 */
980 static PacketPtr
981 createRead(const RequestPtr &req)
982 {
983 return new Packet(req, makeReadCmd(req));
984 }
985
986 static PacketPtr
987 createWrite(const RequestPtr &req)
988 {
989 return new Packet(req, makeWriteCmd(req));
990 }
991
992 /**
993 * clean up packet variables
994 */
995 ~Packet()
996 {
997 deleteData();
998 }
999
1000 /**
1001 * Take a request packet and modify it in place to be suitable for
1002 * returning as a response to that request.
1003 */
1004 void
1005 makeResponse()
1006 {
1007 assert(needsResponse());
1008 assert(isRequest());
1009 cmd = cmd.responseCommand();
1010
1011 // responses are never express, even if the snoop that
1012 // triggered them was
1013 flags.clear(EXPRESS_SNOOP);
1014 }
1015
1016 void
1017 makeAtomicResponse()
1018 {
1019 makeResponse();
1020 }
1021
1022 void
1023 makeTimingResponse()
1024 {
1025 makeResponse();
1026 }
1027
1028 void
1029 setFunctionalResponseStatus(bool success)
1030 {
1031 if (!success) {
1032 if (isWrite()) {
1033 cmd = MemCmd::FunctionalWriteError;
1034 } else {
1035 cmd = MemCmd::FunctionalReadError;
1036 }
1037 }
1038 }
1039
1040 void
1041 setSize(unsigned size)
1042 {
1043 assert(!flags.isSet(VALID_SIZE));
1044
1045 this->size = size;
1046 flags.set(VALID_SIZE);
1047 }
1048
1049 /**
1050 * Check if packet corresponds to a given block-aligned address and
1051 * address space.
1052 *
1053 * @param addr The address to compare against.
1054 * @param is_secure Whether addr belongs to the secure address space.
1055 * @param blk_size Block size in bytes.
1056 * @return Whether packet matches description.
1057 */
1058 bool matchBlockAddr(const Addr addr, const bool is_secure,
1059 const int blk_size) const;
1060
1061 /**
1062 * Check if this packet refers to the same block-aligned address and
1063 * address space as another packet.
1064 *
1065 * @param pkt The packet to compare against.
1066 * @param blk_size Block size in bytes.
1067 * @return Whether packet matches description.
1068 */
1069 bool matchBlockAddr(const PacketPtr pkt, const int blk_size) const;
1070
1071 /**
1072 * Check if packet corresponds to a given address and address space.
1073 *
1074 * @param addr The address to compare against.
1075 * @param is_secure Whether addr belongs to the secure address space.
1076 * @return Whether packet matches description.
1077 */
1078 bool matchAddr(const Addr addr, const bool is_secure) const;
1079
1080 /**
1081 * Check if this packet refers to the same address and address space as
1082 * another packet.
1083 *
1084 * @param pkt The packet to compare against.
1085 * @return Whether packet matches description.
1086 */
1087 bool matchAddr(const PacketPtr pkt) const;
1088
1089 public:
1090 /**
1091 * @{
1092 * @name Data accessor mehtods
1093 */
1094
1095 /**
1096 * Set the data pointer to the following value that should not be
1097 * freed. Static data allows us to do a single memcpy even if
1098 * multiple packets are required to get from source to destination
1099 * and back. In essence the pointer is set calling dataStatic on
1100 * the original packet, and whenever this packet is copied and
1101 * forwarded the same pointer is passed on. When a packet
1102 * eventually reaches the destination holding the data, it is
1103 * copied once into the location originally set. On the way back
1104 * to the source, no copies are necessary.
1105 */
1106 template <typename T>
1107 void
1108 dataStatic(T *p)
1109 {
1110 assert(flags.noneSet(STATIC_DATA|DYNAMIC_DATA));
1111 data = (PacketDataPtr)p;
1112 flags.set(STATIC_DATA);
1113 }
1114
1115 /**
1116 * Set the data pointer to the following value that should not be
1117 * freed. This version of the function allows the pointer passed
1118 * to us to be const. To avoid issues down the line we cast the
1119 * constness away, the alternative would be to keep both a const
1120 * and non-const data pointer and cleverly choose between
1121 * them. Note that this is only allowed for static data.
1122 */
1123 template <typename T>
1124 void
1125 dataStaticConst(const T *p)
1126 {
1127 assert(flags.noneSet(STATIC_DATA|DYNAMIC_DATA));
1128 data = const_cast<PacketDataPtr>(p);
1129 flags.set(STATIC_DATA);
1130 }
1131
1132 /**
1133 * Set the data pointer to a value that should have delete []
1134 * called on it. Dynamic data is local to this packet, and as the
1135 * packet travels from source to destination, forwarded packets
1136 * will allocate their own data. When a packet reaches the final
1137 * destination it will populate the dynamic data of that specific
1138 * packet, and on the way back towards the source, memcpy will be
1139 * invoked in every step where a new packet was created e.g. in
1140 * the caches. Ultimately when the response reaches the source a
1141 * final memcpy is needed to extract the data from the packet
1142 * before it is deallocated.
1143 */
1144 template <typename T>
1145 void
1146 dataDynamic(T *p)
1147 {
1148 assert(flags.noneSet(STATIC_DATA|DYNAMIC_DATA));
1149 data = (PacketDataPtr)p;
1150 flags.set(DYNAMIC_DATA);
1151 }
1152
1153 /**
1154 * get a pointer to the data ptr.
1155 */
1156 template <typename T>
1157 T*
1158 getPtr()
1159 {
1160 assert(flags.isSet(STATIC_DATA|DYNAMIC_DATA));
1161 assert(!isMaskedWrite());
1162 return (T*)data;
1163 }
1164
1165 template <typename T>
1166 const T*
1167 getConstPtr() const
1168 {
1169 assert(flags.isSet(STATIC_DATA|DYNAMIC_DATA));
1170 return (const T*)data;
1171 }
1172
1173 /**
1174 * Get the data in the packet byte swapped from big endian to
1175 * host endian.
1176 */
1177 template <typename T>
1178 T getBE() const;
1179
1180 /**
1181 * Get the data in the packet byte swapped from little endian to
1182 * host endian.
1183 */
1184 template <typename T>
1185 T getLE() const;
1186
1187 /**
1188 * Get the data in the packet byte swapped from the specified
1189 * endianness.
1190 */
1191 template <typename T>
1192 T get(ByteOrder endian) const;
1193
1194 /** Set the value in the data pointer to v as big endian. */
1195 template <typename T>
1196 void setBE(T v);
1197
1198 /** Set the value in the data pointer to v as little endian. */
1199 template <typename T>
1200 void setLE(T v);
1201
1202 /**
1203 * Set the value in the data pointer to v using the specified
1204 * endianness.
1205 */
1206 template <typename T>
1207 void set(T v, ByteOrder endian);
1208
1209 /**
1210 * Get the data in the packet byte swapped from the specified
1211 * endianness and zero-extended to 64 bits.
1212 */
1213 uint64_t getUintX(ByteOrder endian) const;
1214
1215 /**
1216 * Set the value in the word w after truncating it to the length
1217 * of the packet and then byteswapping it to the desired
1218 * endianness.
1219 */
1220 void setUintX(uint64_t w, ByteOrder endian);
1221
1222 /**
1223 * Copy data into the packet from the provided pointer.
1224 */
1225 void
1226 setData(const uint8_t *p)
1227 {
1228 // we should never be copying data onto itself, which means we
1229 // must idenfity packets with static data, as they carry the
1230 // same pointer from source to destination and back
1231 assert(p != getPtr<uint8_t>() || flags.isSet(STATIC_DATA));
1232
1233 if (p != getPtr<uint8_t>()) {
1234 // for packet with allocated dynamic data, we copy data from
1235 // one to the other, e.g. a forwarded response to a response
1236 std::memcpy(getPtr<uint8_t>(), p, getSize());
1237 }
1238 }
1239
1240 /**
1241 * Copy data into the packet from the provided block pointer,
1242 * which is aligned to the given block size.
1243 */
1244 void
1245 setDataFromBlock(const uint8_t *blk_data, int blkSize)
1246 {
1247 setData(blk_data + getOffset(blkSize));
1248 }
1249
1250 /**
1251 * Copy data from the packet to the memory at the provided pointer.
1252 * @param p Pointer to which data will be copied.
1253 */
1254 void
1255 writeData(uint8_t *p) const
1256 {
1257 if (!isMaskedWrite()) {
1258 std::memcpy(p, getConstPtr<uint8_t>(), getSize());
1259 } else {
1260 assert(req->getByteEnable().size() == getSize());
1261 // Write only the enabled bytes
1262 const uint8_t *base = getConstPtr<uint8_t>();
1263 for (int i = 0; i < getSize(); i++) {
1264 if (req->getByteEnable()[i]) {
1265 p[i] = *(base + i);
1266 }
1267 // Disabled bytes stay untouched
1268 }
1269 }
1270 }
1271
1272 /**
1273 * Copy data from the packet to the provided block pointer, which
1274 * is aligned to the given block size.
1275 * @param blk_data Pointer to block to which data will be copied.
1276 * @param blkSize Block size in bytes.
1277 */
1278 void
1279 writeDataToBlock(uint8_t *blk_data, int blkSize) const
1280 {
1281 writeData(blk_data + getOffset(blkSize));
1282 }
1283
1284 /**
1285 * delete the data pointed to in the data pointer. Ok to call to
1286 * matter how data was allocted.
1287 */
1288 void
1289 deleteData()
1290 {
1291 if (flags.isSet(DYNAMIC_DATA))
1292 delete [] data;
1293
1294 flags.clear(STATIC_DATA|DYNAMIC_DATA);
1295 data = NULL;
1296 }
1297
1298 /** Allocate memory for the packet. */
1299 void
1300 allocate()
1301 {
1302 // if either this command or the response command has a data
1303 // payload, actually allocate space
1304 if (hasData() || hasRespData()) {
1305 assert(flags.noneSet(STATIC_DATA|DYNAMIC_DATA));
1306 flags.set(DYNAMIC_DATA);
1307 data = new uint8_t[getSize()];
1308 }
1309 }
1310
1311 /** @} */
1312
1313 /** Get the data in the packet without byte swapping. */
1314 template <typename T>
1315 T getRaw() const;
1316
1317 /** Set the value in the data pointer to v without byte swapping. */
1318 template <typename T>
1319 void setRaw(T v);
1320
1321 public:
1322 /**
1323 * Check a functional request against a memory value stored in
1324 * another packet (i.e. an in-transit request or
1325 * response). Returns true if the current packet is a read, and
1326 * the other packet provides the data, which is then copied to the
1327 * current packet. If the current packet is a write, and the other
1328 * packet intersects this one, then we update the data
1329 * accordingly.
1330 */
1331 bool
1332 trySatisfyFunctional(PacketPtr other)
1333 {
1334 if (other->isMaskedWrite()) {
1335 // Do not forward data if overlapping with a masked write
1336 if (_isSecure == other->isSecure() &&
1337 getAddr() <= (other->getAddr() + other->getSize() - 1) &&
1338 other->getAddr() <= (getAddr() + getSize() - 1)) {
1339 warn("Trying to check against a masked write, skipping."
1340 " (addr: 0x%x, other addr: 0x%x)", getAddr(),
1341 other->getAddr());
1342 }
1343 return false;
1344 }
1345 // all packets that are carrying a payload should have a valid
1346 // data pointer
1347 return trySatisfyFunctional(other, other->getAddr(), other->isSecure(),
1348 other->getSize(),
1349 other->hasData() ?
1350 other->getPtr<uint8_t>() : NULL);
1351 }
1352
1353 /**
1354 * Does the request need to check for cached copies of the same block
1355 * in the memory hierarchy above.
1356 **/
1357 bool
1358 mustCheckAbove() const
1359 {
1360 return cmd == MemCmd::HardPFReq || isEviction();
1361 }
1362
1363 /**
1364 * Is this packet a clean eviction, including both actual clean
1365 * evict packets, but also clean writebacks.
1366 */
1367 bool
1368 isCleanEviction() const
1369 {
1370 return cmd == MemCmd::CleanEvict || cmd == MemCmd::WritebackClean;
1371 }
1372
1373 bool
1374 isMaskedWrite() const
1375 {
1376 return (cmd == MemCmd::WriteReq && req->isMasked());
1377 }
1378
1379 /**
1380 * Check a functional request against a memory value represented
1381 * by a base/size pair and an associated data array. If the
1382 * current packet is a read, it may be satisfied by the memory
1383 * value. If the current packet is a write, it may update the
1384 * memory value.
1385 */
1386 bool
1387 trySatisfyFunctional(Printable *obj, Addr base, bool is_secure, int size,
1388 uint8_t *_data);
1389
1390 /**
1391 * Push label for PrintReq (safe to call unconditionally).
1392 */
1393 void
1394 pushLabel(const std::string &lbl)
1395 {
1396 if (isPrint())
1397 safe_cast<PrintReqState*>(senderState)->pushLabel(lbl);
1398 }
1399
1400 /**
1401 * Pop label for PrintReq (safe to call unconditionally).
1402 */
1403 void
1404 popLabel()
1405 {
1406 if (isPrint())
1407 safe_cast<PrintReqState*>(senderState)->popLabel();
1408 }
1409
1410 void print(std::ostream &o, int verbosity = 0,
1411 const std::string &prefix = "") const;
1412
1413 /**
1414 * A no-args wrapper of print(std::ostream...)
1415 * meant to be invoked from DPRINTFs
1416 * avoiding string overheads in fast mode
1417 * @return string with the request's type and start<->end addresses
1418 */
1419 std::string print() const;
1420
1421 // hardware transactional memory
1422
1423 /**
1424 * Communicates to the core that a packet was processed by the memory
1425 * subsystem while running in transactional mode.
1426 * It may happen that the transaction has failed at the memory subsystem
1427 * and this needs to be communicated to the core somehow.
1428 * This function decorates the response packet with flags to indicate
1429 * such a situation has occurred.
1430 */
1431 void makeHtmTransactionalReqResponse(const HtmCacheFailure ret_code);
1432
1433 /**
1434 * Stipulates that this packet/request originates in the CPU executing
1435 * in transactional mode, i.e. within a transaction.
1436 */
1437 void setHtmTransactional(uint64_t val);
1438
1439 /**
1440 * Returns whether or not this packet/request originates in the CPU
1441 * executing in transactional mode, i.e. within a transaction.
1442 */
1443 bool isHtmTransactional() const;
1444
1445 /**
1446 * If a packet/request originates in a CPU executing in transactional
1447 * mode, i.e. within a transaction, this function returns the unique ID
1448 * of the transaction. This is used for verifying correctness
1449 * and debugging.
1450 */
1451 uint64_t getHtmTransactionUid() const;
1452
1453 /**
1454 * Stipulates that this packet/request has returned from the
1455 * cache hierarchy in a failed transaction. The core is
1456 * notified like this.
1457 */
1458 void setHtmTransactionFailedInCache(const HtmCacheFailure ret_code);
1459
1460 /**
1461 * Returns whether or not this packet/request has returned from the
1462 * cache hierarchy in a failed transaction. The core is
1463 * notified liked this.
1464 */
1465 bool htmTransactionFailedInCache() const;
1466
1467 /**
1468 * If a packet/request has returned from the cache hierarchy in a
1469 * failed transaction, this function returns the failure reason.
1470 */
1471 HtmCacheFailure getHtmTransactionFailedInCacheRC() const;
1472 };
1473
1474 #endif //__MEM_PACKET_HH