gem5 v24.0.0.0
Loading...
Searching...
No Matches
request.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2012-2013,2017-2022 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) 2002-2005 The Regents of The University of Michigan
15 * Copyright (c) 2010,2015 Advanced Micro Devices, Inc.
16 * All rights reserved.
17 *
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions are
20 * met: redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer;
22 * redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution;
25 * neither the name of the copyright holders nor the names of its
26 * contributors may be used to endorse or promote products derived from
27 * this software without specific prior written permission.
28 *
29 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 */
41
48#ifndef __MEM_REQUEST_HH__
49#define __MEM_REQUEST_HH__
50
51#include <algorithm>
52#include <cassert>
53#include <cstdint>
54#include <functional>
55#include <limits>
56#include <memory>
57#include <vector>
58
59#include "base/amo.hh"
60#include "base/compiler.hh"
61#include "base/extensible.hh"
62#include "base/flags.hh"
63#include "base/types.hh"
64#include "cpu/inst_seq.hh"
65#include "mem/htm.hh"
66#include "sim/cur_tick.hh"
67
68namespace gem5
69{
70
78namespace context_switch_task_id
79{
80 enum TaskId
81 {
82 MaxNormalTaskId = 1021, /* Maximum number of normal tasks */
83 Prefetcher = 1022, /* For cache lines brought in by prefetcher */
84 DMA = 1023, /* Mostly Table Walker */
85 Unknown = 1024,
87 };
88}
89
90class Packet;
91class Request;
92class ThreadContext;
93
94typedef std::shared_ptr<Request> RequestPtr;
95typedef uint16_t RequestorID;
96
97class Request : public Extensible<Request>
98{
99 public:
100 typedef uint64_t FlagsType;
101 typedef uint8_t ArchFlagsType;
103
104 enum : FlagsType
105 {
113 ARCH_BITS = 0x000000FF,
115 INST_FETCH = 0x00000100,
117 PHYSICAL = 0x00000200,
125 UNCACHEABLE = 0x00000400,
135 STRICT_ORDER = 0x00000800,
137 PRIVILEGED = 0x00008000,
138
143 CACHE_BLOCK_ZERO = 0x00010000,
144
146 NO_ACCESS = 0x00080000,
154 LOCKED_RMW = 0x00100000,
156 LLSC = 0x00200000,
158 MEM_SWAP = 0x00400000,
159 MEM_SWAP_COND = 0x00800000,
161 READ_MODIFY_WRITE = 0x0020000000000000,
162
164 PREFETCH = 0x01000000,
166 PF_EXCLUSIVE = 0x02000000,
168 EVICT_NEXT = 0x04000000,
170 ACQUIRE = 0x00020000,
172 RELEASE = 0x00040000,
173
175 ATOMIC_RETURN_OP = 0x40000000,
178
183 KERNEL = 0x00001000,
184
186 SECURE = 0x10000000,
188 PT_WALK = 0x20000000,
189
191 INVALIDATE = 0x0000000100000000,
193 CLEAN = 0x0000000200000000,
194
196 DST_POU = 0x0000001000000000,
197
199 DST_POC = 0x0000002000000000,
200
202 DST_BITS = 0x0000003000000000,
203
207 HTM_START = 0x0000010000000000,
208
210 HTM_COMMIT = 0x0000020000000000,
211
213 HTM_CANCEL = 0x0000040000000000,
214
216 HTM_ABORT = 0x0000080000000000,
217
218 // What is the different between HTM cancel and abort?
219 //
220 // HTM_CANCEL will originate from a user instruction, e.g.
221 // Arm's TCANCEL or x86's XABORT. This is an explicit request
222 // to end a transaction and restore from the last checkpoint.
223 //
224 // HTM_ABORT is an internally generated request used to synchronize
225 // a transaction's failure between the core and memory subsystem.
226 // If a transaction fails in the core, e.g. because an instruction
227 // within the transaction generates an exception, the core will prepare
228 // itself to stop fetching/executing more instructions and send an
229 // HTM_ABORT to the memory subsystem before restoring the checkpoint.
230 // Similarly, the transaction could fail in the memory subsystem and
231 // this will be communicated to the core via the Packet object.
232 // Once the core notices, it will do the same as the above and send
233 // a HTM_ABORT to the memory subsystem.
234 // A HTM_CANCEL sent to the memory subsystem will ultimately return
235 // to the core which in turn will send a HTM_ABORT.
236 //
237 // This separation is necessary to ensure the disjoint components
238 // of the system work correctly together.
239
241 TLBI = 0x0000100000000000,
242
244 TLBI_SYNC = 0x0000200000000000,
245
248 TLBI_EXT_SYNC = 0x0000400000000000,
249
252 TLBI_EXT_SYNC_COMP = 0x0000800000000000,
253
259 };
262
265
266 static const FlagsType TLBI_CMD = TLBI | TLBI_SYNC |
268
271 enum : RequestorID
272 {
286 invldRequestorId = std::numeric_limits<RequestorID>::max()
287 };
290 typedef uint64_t CacheCoherenceFlagsType;
292
321 {
323 I_CACHE_INV = 0x00000001,
325 V_CACHE_INV = 0x00000002,
326 K_CACHE_INV = 0x00000004,
327 GL1_CACHE_INV = 0x00000008,
328 K_CACHE_WB = 0x00000010,
329 FLUSH_L2 = 0x00000020,
330 GL2_CACHE_INV = 0x00000040,
332 SLC_BIT = 0x00000080,
333 DLC_BIT = 0x00000100,
334 GLC_BIT = 0x00000200,
336 CACHED = 0x00000400,
337 READ_WRITE = 0x00000800,
338 SHARED = 0x00001000,
339
340 };
341
343 std::function<Cycles(ThreadContext *tc, Packet *pkt)>;
344
345 private:
346 typedef uint16_t PrivateFlagsType;
348
349 enum : PrivateFlagsType
350 {
352 VALID_SIZE = 0x00000001,
354 VALID_PADDR = 0x00000002,
356 VALID_VADDR = 0x00000004,
358 VALID_INST_SEQ_NUM = 0x00000008,
360 VALID_PC = 0x00000010,
362 VALID_CONTEXT_ID = 0x00000020,
364 VALID_EXTRA_DATA = 0x00000080,
366 VALID_STREAM_ID = 0x00000100,
367 VALID_SUBSTREAM_ID = 0x00000200,
368 // hardware transactional memory
372 VALID_INST_COUNT = 0x00000800,
378 };
379
380 private:
381
387
393 unsigned _size = 0;
394
397
402
405
408
411
418
423
429 uint32_t _streamId = 0;
430
437 uint32_t _substreamId = 0;
438
443 bool _systemReq = 0;
444
447
451 uint64_t _extraData = 0;
452
455
458
461
464
466
469
472
473 public:
474
481
487 Request(Addr paddr, unsigned size, Flags flags, RequestorID id) :
488 _paddr(paddr), _size(size), _requestorId(id), _time(curTick())
489 {
492 _byteEnable = std::vector<bool>(size, true);
493 }
494
495 Request(Addr vaddr, unsigned size, Flags flags,
496 RequestorID id, Addr pc, ContextID cid,
497 AtomicOpFunctorPtr atomic_op=nullptr)
498 {
499 setVirt(vaddr, size, flags, id, pc, std::move(atomic_op));
500 setContext(cid);
501 _byteEnable = std::vector<bool>(size, true);
502 }
503
504 Request(const Request& other)
505 : Extensible<Request>(other),
506 _paddr(other._paddr), _size(other._size),
509 _flags(other._flags),
512 _time(other._time),
513 _taskId(other._taskId), _vaddr(other._vaddr),
515 _pc(other._pc), _reqInstSeqNum(other._reqInstSeqNum),
518 accessDelta(other.accessDelta), depth(other.depth)
519 {
520 atomicOpFunctor.reset(other.atomicOpFunctor ?
521 other.atomicOpFunctor->clone() : nullptr);
522 }
523
525
530 static RequestPtr
532 {
533 auto mgmt_req = std::make_shared<Request>();
534 mgmt_req->_flags.set(flags);
535 mgmt_req->_requestorId = id;
536 mgmt_req->_time = curTick();
537
538 assert(mgmt_req->isMemMgmt());
539 return mgmt_req;
540 }
541
545 void
547 {
548 _contextId = context_id;
550 }
551
552 void
553 setStreamId(uint32_t sid)
554 {
555 _streamId = sid;
557 }
558
559 void
560 setSubstreamId(uint32_t ssid)
561 {
562 assert(hasStreamId());
563 _substreamId = ssid;
565 }
566
571 void
573 AtomicOpFunctorPtr amo_op=nullptr)
574 {
575 _vaddr = vaddr;
576 _size = size;
578 _pc = pc;
579 _time = curTick();
580
585 depth = 0;
586 accessDelta = 0;
587 translateDelta = 0;
588 atomicOpFunctor = std::move(amo_op);
589 _localAccessor = nullptr;
590 }
591
596 void
598 {
599 _paddr = paddr;
601 }
602
607 // TODO: this function is still required by TimingSimpleCPU - should be
608 // removed once TimingSimpleCPU will support arbitrarily long multi-line
609 // mem. accesses
610 void splitOnVaddr(Addr split_addr, RequestPtr &req1, RequestPtr &req2)
611 {
612 assert(hasVaddr());
613 assert(!hasPaddr());
614 assert(split_addr > _vaddr && split_addr < _vaddr + _size);
615 req1 = std::make_shared<Request>(*this);
616 req2 = std::make_shared<Request>(*this);
617 req1->_size = split_addr - _vaddr;
618 req2->_vaddr = split_addr;
619 req2->_size = _size - req1->_size;
620 req1->_byteEnable = std::vector<bool>(
621 _byteEnable.begin(),
622 _byteEnable.begin() + req1->_size);
623 req2->_byteEnable = std::vector<bool>(
624 _byteEnable.begin() + req1->_size,
625 _byteEnable.end());
626 }
627
631 bool
632 hasPaddr() const
633 {
635 }
636
637 Addr
638 getPaddr() const
639 {
640 assert(hasPaddr());
641 return _paddr;
642 }
643
647 bool
649 {
651 }
652
654 {
655 assert(hasInstCount());
656 return _instCount;
657 }
658
664
669
675
680 mutable int depth = 0;
681
685 bool
686 hasSize() const
687 {
689 }
690
691 unsigned
692 getSize() const
693 {
694 assert(hasSize());
695 return _size;
696 }
697
698 const std::vector<bool>&
700 {
701 return _byteEnable;
702 }
703
704 void
706 {
707 assert(be.size() == _size);
708 _byteEnable = be;
709 }
710
716 bool
717 isMasked() const
718 {
719 return std::find(
720 _byteEnable.begin(),
721 _byteEnable.end(),
722 false) != _byteEnable.end();
723 }
724
726 Tick
727 time() const
728 {
729 assert(hasPaddr() || hasVaddr());
730 return _time;
731 }
732
734 bool isLocalAccess() { return (bool)_localAccessor; }
738 Cycles
740 {
741 return _localAccessor(tc, pkt);
742 }
743
747 bool
749 {
750 return (bool)atomicOpFunctor;
751 }
752
755 {
756 assert(atomicOpFunctor);
757 return atomicOpFunctor.get();
758 }
759
760 void
762 {
763 atomicOpFunctor = std::move(amo_op);
764 }
765
766
770 bool
775
778 {
779 assert(hasHtmAbortCause());
780 return _htmAbortCause;
781 }
782
783 void
790
792 Flags
794 {
795 assert(hasPaddr() || hasVaddr());
796 return _flags;
797 }
798
803 void
805 {
806 assert(hasPaddr() || hasVaddr());
808 }
809
810 void
812 {
813 assert(hasPaddr() || hasVaddr());
815 }
816
817 void
819 {
820 // TODO: do mem_sync_op requests have valid paddr/vaddr?
821 assert(hasPaddr() || hasVaddr());
822 _cacheCoherenceFlags.set(extraFlags);
823 }
824
825 void
827 {
828 // TODO: do mem_sync_op requests have valid paddr/vaddr?
829 assert(hasPaddr() || hasVaddr());
830 _cacheCoherenceFlags.clear(extraFlags);
831 }
832
834 bool
835 hasVaddr() const
836 {
838 }
839
840 Addr
841 getVaddr() const
842 {
844 return _vaddr;
845 }
846
850 {
851 return _requestorId;
852 }
853
854 void
856 {
857 _requestorId = rid;
858 }
859
860 uint32_t
861 taskId() const
862 {
863 return _taskId;
864 }
865
866 void
867 taskId(uint32_t id) {
868 _taskId = id;
869 }
870
874 {
875 assert(hasPaddr() || hasVaddr());
876 return _flags & ARCH_BITS;
877 }
878
880 bool
882 {
884 }
885
887 uint64_t
889 {
890 assert(extraDataValid());
891 return _extraData;
892 }
893
895 void
896 setExtraData(uint64_t extraData)
897 {
898 _extraData = extraData;
900 }
901
902 bool
904 {
906 }
907
910 contextId() const
911 {
912 assert(hasContextId());
913 return _contextId;
914 }
915
916 /* For GPU fullsystem mark this request is not to device memory. */
917 void setSystemReq(bool sysReq) { _systemReq = sysReq; }
918 bool systemReq() const { return _systemReq; }
919
920 bool
922 {
924 }
925
926 uint32_t
927 streamId() const
928 {
929 assert(hasStreamId());
930 return _streamId;
931 }
932
933 bool
935 {
937 }
938
939 uint32_t
941 {
942 assert(hasSubstreamId());
943 return _substreamId;
944 }
945
946 void
948 {
950 _pc = pc;
951 }
952
953 bool
954 hasPC() const
955 {
957 }
958
960 Addr
961 getPC() const
962 {
963 assert(hasPC());
964 return _pc;
965 }
966
971 void incAccessDepth() const { depth++; }
972 int getAccessDepth() const { return depth; }
973
979
986
991 bool
993 {
995 }
996
999 {
1000 assert(hasInstSeqNum());
1001 return _reqInstSeqNum;
1002 }
1003
1004 void
1006 {
1008 _reqInstSeqNum = seq_num;
1009 }
1010
1013 bool isUncacheable() const { return _flags.isSet(UNCACHEABLE); }
1014 bool isStrictlyOrdered() const { return _flags.isSet(STRICT_ORDER); }
1015 bool isInstFetch() const { return _flags.isSet(INST_FETCH); }
1016 bool
1018 {
1019 return (_flags.isSet(PREFETCH | PF_EXCLUSIVE));
1020 }
1021 bool isPrefetchEx() const { return _flags.isSet(PF_EXCLUSIVE); }
1022 bool isLLSC() const { return _flags.isSet(LLSC); }
1023 bool isPriv() const { return _flags.isSet(PRIVILEGED); }
1024 bool isLockedRMW() const { return _flags.isSet(LOCKED_RMW); }
1025 bool isSwap() const { return _flags.isSet(MEM_SWAP | MEM_SWAP_COND); }
1026 bool isCondSwap() const { return _flags.isSet(MEM_SWAP_COND); }
1027 bool
1029 {
1031 }
1032 bool isSecure() const { return _flags.isSet(SECURE); }
1033 bool isPTWalk() const { return _flags.isSet(PT_WALK); }
1034 bool isRelease() const { return _flags.isSet(RELEASE); }
1035 bool isKernel() const { return _flags.isSet(KERNEL); }
1038 // hardware transactional memory
1039 bool isHTMStart() const { return _flags.isSet(HTM_START); }
1040 bool isHTMCommit() const { return _flags.isSet(HTM_COMMIT); }
1041 bool isHTMCancel() const { return _flags.isSet(HTM_CANCEL); }
1042 bool isHTMAbort() const { return _flags.isSet(HTM_ABORT); }
1043 bool
1044 isHTMCmd() const
1045 {
1046 return (isHTMStart() || isHTMCommit() ||
1047 isHTMCancel() || isHTMAbort());
1048 }
1049
1050 bool isTlbi() const { return _flags.isSet(TLBI); }
1051 bool isTlbiSync() const { return _flags.isSet(TLBI_SYNC); }
1052 bool isTlbiExtSync() const { return _flags.isSet(TLBI_EXT_SYNC); }
1054 bool
1056 {
1057 return (isTlbi() || isTlbiSync() ||
1059 }
1060 bool isMemMgmt() const { return isTlbiCmd() || isHTMCmd(); }
1061
1062 bool
1063 isAtomic() const
1064 {
1065 return _flags.isSet(ATOMIC_RETURN_OP) ||
1067 }
1068
1076 bool isToPOU() const { return _flags.isSet(DST_POU); }
1077 bool isToPOC() const { return _flags.isSet(DST_POC); }
1078 Flags getDest() const { return _flags & DST_BITS; }
1079
1081
1082
1092
1098 bool isInvL1() const { return _cacheCoherenceFlags.isSet(INV_L1); }
1100
1101 bool
1103 {
1105 }
1106
1119 bool isCacheClean() const { return _flags.isSet(CLEAN); }
1120 bool isCacheInvalidate() const { return _flags.isSet(INVALIDATE); }
1123};
1124
1125} // namespace gem5
1126
1127#endif // __MEM_REQUEST_HH__
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
Cycles is a wrapper class for representing cycle counts, i.e.
Definition types.hh:79
Wrapper that groups a few flag bits under the same undelying container.
Definition flags.hh:45
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition packet.hh:295
Tick _time
The time this request was started.
Definition request.hh:417
uint32_t streamId() const
Definition request.hh:927
bool isGLCSet() const
Accessor functions for the cache bypass flags.
Definition request.hh:1090
void setAccessLatency()
Set/Get the time taken to complete this request's access, not including the time to successfully tran...
Definition request.hh:984
Request(Addr paddr, unsigned size, Flags flags, RequestorID id)
Constructor for physical (e.g.
Definition request.hh:487
@ PT_WALK
The request is a page table walk.
Definition request.hh:188
@ SECURE
The request targets the secure memory space.
Definition request.hh:186
@ ATOMIC_RETURN_OP
The request is an atomic that returns data.
Definition request.hh:175
@ KERNEL
The request should be marked with KERNEL.
Definition request.hh:183
@ ACQUIRE
The request should be marked with ACQUIRE.
Definition request.hh:170
@ LOCKED_RMW
This request will lock or unlock the accessed memory.
Definition request.hh:154
@ INVALIDATE
The request invalidates a memory location.
Definition request.hh:191
@ STRICT_ORDER
The request is required to be strictly ordered by CPU models and is non-speculative.
Definition request.hh:135
@ ARCH_BITS
Architecture specific flags.
Definition request.hh:113
@ PHYSICAL
The virtual address is also the physical address.
Definition request.hh:117
@ CLEAN
The request cleans a memory location.
Definition request.hh:193
@ STICKY_FLAGS
These flags are not cleared when a Request object is reused (assigned a new address).
Definition request.hh:258
@ DST_POC
The request targets the point of coherence.
Definition request.hh:199
@ ATOMIC_NO_RETURN_OP
The request is an atomic that does not return data.
Definition request.hh:177
@ DST_BITS
Bits to define the destination of a request.
Definition request.hh:202
@ UNCACHEABLE
The request is to an uncacheable address.
Definition request.hh:125
@ PRIVILEGED
This request is made in privileged mode.
Definition request.hh:137
@ TLBI
The Request is a TLB shootdown.
Definition request.hh:241
@ HTM_COMMIT
The request commits a HTM transaction.
Definition request.hh:210
@ DST_POU
The request targets the point of unification.
Definition request.hh:196
@ HTM_ABORT
The request aborts a HTM transaction.
Definition request.hh:216
@ TLBI_EXT_SYNC
The Request tells the CPU model that a remote TLB Sync has been requested.
Definition request.hh:248
@ PF_EXCLUSIVE
The request should be prefetched into the exclusive state.
Definition request.hh:166
@ TLBI_EXT_SYNC_COMP
The Request tells the interconnect that a remote TLB Sync request has completed.
Definition request.hh:252
@ RELEASE
The request should be marked with RELEASE.
Definition request.hh:172
@ HTM_CANCEL
The request cancels a HTM transaction.
Definition request.hh:213
@ INST_FETCH
The request was an instruction fetch.
Definition request.hh:115
@ READ_MODIFY_WRITE
This request is a read which will be followed by a write.
Definition request.hh:161
@ MEM_SWAP
This request is for a memory swap.
Definition request.hh:158
@ PREFETCH
The request is a prefetch.
Definition request.hh:164
@ TLBI_SYNC
The Request is a TLB shootdown sync.
Definition request.hh:244
@ NO_ACCESS
The request should not cause a memory access.
Definition request.hh:146
@ EVICT_NEXT
The request should be marked as LRU.
Definition request.hh:168
@ HTM_START
hardware transactional memory
Definition request.hh:207
@ LLSC
The request is a Load locked/store conditional.
Definition request.hh:156
@ CACHE_BLOCK_ZERO
This is a write that is targeted and zeroing an entire cache block.
Definition request.hh:143
uint64_t CacheCoherenceFlagsType
Definition request.hh:290
void setPC(Addr pc)
Definition request.hh:947
static RequestPtr createMemManagement(Flags flags, RequestorID id)
Factory method for creating memory management requests, with unspecified addr and size.
Definition request.hh:531
bool isHTMCancel() const
Definition request.hh:1041
std::function< Cycles(ThreadContext *tc, Packet *pkt)> LocalAccessor
Definition request.hh:342
uint8_t ArchFlagsType
Definition request.hh:101
bool isKernel() const
Definition request.hh:1035
void setInstCount(Counter val)
Definition request.hh:659
uint32_t _streamId
The stream ID uniquely identifies a device behind the SMMU/IOMMU Each transaction arriving at the SMM...
Definition request.hh:429
void setCacheCoherenceFlags(CacheCoherenceFlags extraFlags)
Definition request.hh:818
bool isInstFetch() const
Definition request.hh:1015
bool isCondSwap() const
Definition request.hh:1026
Counter getInstCount() const
Definition request.hh:653
int depth
Level of the cache hierachy where this request was responded to (e.g.
Definition request.hh:680
AtomicOpFunctorPtr atomicOpFunctor
A pointer to an atomic operation.
Definition request.hh:463
RequestorID requestorId() const
Accesssor for the requestor id.
Definition request.hh:849
Tick time() const
Accessor for time.
Definition request.hh:727
bool isPTWalk() const
Definition request.hh:1033
bool isInvL2() const
Definition request.hh:1099
void setAtomicOpFunctor(AtomicOpFunctorPtr amo_op)
Definition request.hh:761
void setHtmAbortCause(HtmFailureFaultCause val)
Definition request.hh:784
bool isStrictlyOrdered() const
Definition request.hh:1014
@ funcRequestorId
This requestor id is used for functional requests that don't come from a particular device.
Definition request.hh:279
@ invldRequestorId
Invalid requestor id for assertion checking only.
Definition request.hh:286
@ wbRequestorId
This requestor id is used for writeback requests by the caches.
Definition request.hh:274
@ intRequestorId
This requestor id is used for message signaled interrupts.
Definition request.hh:281
ContextID _contextId
The context ID (for statistics, locks, and wakeups).
Definition request.hh:454
bool isSwap() const
Definition request.hh:1025
bool hasContextId() const
Definition request.hh:903
Flags getFlags()
Accessor for flags.
Definition request.hh:793
Tick getTranslateLatency() const
Definition request.hh:978
uint64_t FlagsType
Definition request.hh:100
bool isTlbiExtSyncComp() const
Definition request.hh:1053
void setExtraData(uint64_t extraData)
Accessor function for store conditional return value.
Definition request.hh:896
bool isSecure() const
Definition request.hh:1032
const std::vector< bool > & getByteEnable() const
Definition request.hh:699
HtmFailureFaultCause _htmAbortCause
The cause for HTM transaction abort.
Definition request.hh:471
bool isAcquire() const
Definition request.hh:1080
AtomicOpFunctor * getAtomicOpFunctor()
Definition request.hh:754
void setTranslateLatency()
Set/Get the time taken for this request to be successfully translated.
Definition request.hh:977
Cycles localAccessor(ThreadContext *tc, Packet *pkt)
Perform the installed local access.
Definition request.hh:739
Request(Addr vaddr, unsigned size, Flags flags, RequestorID id, Addr pc, ContextID cid, AtomicOpFunctorPtr atomic_op=nullptr)
Definition request.hh:495
bool isTlbiExtSync() const
Definition request.hh:1052
bool hasPaddr() const
Accessor for paddr.
Definition request.hh:632
bool isAtomicNoReturn() const
Definition request.hh:1037
gem5::Flags< PrivateFlagsType > PrivateFlags
Definition request.hh:347
void clearFlags(Flags flags)
Definition request.hh:811
bool hasHtmAbortCause() const
Accessor for hardware transactional memory abort cause.
Definition request.hh:771
static const FlagsType TLBI_CMD
Definition request.hh:266
bool isTlbiSync() const
Definition request.hh:1051
Addr _paddr
The physical address of the request.
Definition request.hh:386
bool isMemMgmt() const
Definition request.hh:1060
bool isAtomic() const
Definition request.hh:1063
bool isPrefetch() const
Definition request.hh:1017
bool isPrefetchEx() const
Definition request.hh:1021
bool hasVaddr() const
Accessor function for vaddr.
Definition request.hh:835
uint32_t _taskId
The task id associated with this request.
Definition request.hh:422
bool hasSize() const
Accessor for size.
Definition request.hh:686
bool isCacheClean() const
Accessor functions to determine whether this request is part of a cache maintenance operation.
Definition request.hh:1119
bool isHTMCmd() const
Definition request.hh:1044
uint64_t getExtraData() const
Accessor function for store conditional return value.
Definition request.hh:888
bool isHTMAbort() const
Definition request.hh:1042
RequestorID _requestorId
The requestor ID which is unique in the system for all ports that are capable of issuing a transactio...
Definition request.hh:401
uint32_t _substreamId
The substream ID identifies an "execution context" within a device behind an SMMU/IOMMU.
Definition request.hh:437
bool isInvL1() const
Accessor functions for the memory space configuration flags and used by GPU ISAs such as the Heteroge...
Definition request.hh:1098
bool hasAtomicOpFunctor()
Accessor for atomic-op functor.
Definition request.hh:748
void taskId(uint32_t id)
Definition request.hh:867
bool isCacheInvalidate() const
Definition request.hh:1120
void setLocalAccessor(LocalAccessor acc)
Set the function which will enact that access.
Definition request.hh:736
static const FlagsType HTM_CMD
Definition request.hh:263
bool hasSubstreamId() const
Definition request.hh:934
CacheCoherenceFlags _cacheCoherenceFlags
Flags that control how downstream cache system maintains coherence.
Definition request.hh:407
Addr _vaddr
The virtual address of the request.
Definition request.hh:446
bool isToPOU() const
Accessor functions for the destination of a memory request.
Definition request.hh:1076
LocalAccessor _localAccessor
Definition request.hh:465
void setByteEnable(const std::vector< bool > &be)
Definition request.hh:705
Tick getAccessLatency() const
Definition request.hh:985
Flags getDest() const
Definition request.hh:1078
uint32_t taskId() const
Definition request.hh:861
Request(const Request &other)
Definition request.hh:504
bool hasPC() const
Definition request.hh:954
bool isSLCSet() const
Definition request.hh:1091
@ I_CACHE_INV
mem_sync_op flags
Definition request.hh:323
@ CACHED
mtype flags
Definition request.hh:336
@ SLC_BIT
user-policy flags
Definition request.hh:332
void setFlags(Flags flags)
Note that unlike other accessors, this function sets specific flags (ORs them in); it does not assign...
Definition request.hh:804
std::vector< bool > _byteEnable
Byte-enable mask for writes.
Definition request.hh:396
bool isMasked() const
Returns true if the memory request is masked, which means there is at least one byteEnable element wh...
Definition request.hh:717
bool extraDataValid() const
Accessor function to check if sc result is valid.
Definition request.hh:881
bool isUncacheable() const
Accessor functions for flags.
Definition request.hh:1013
Request()
Minimal constructor.
Definition request.hh:480
bool hasInstSeqNum() const
Accessor for the sequence number of instruction that creates the request.
Definition request.hh:992
Addr getVaddr() const
Definition request.hh:841
bool _systemReq
For fullsystem GPU simulation, this determines if a requests destination is system (host) memory or d...
Definition request.hh:443
void clearCacheCoherenceFlags(CacheCoherenceFlags extraFlags)
Definition request.hh:826
bool isLockedRMW() const
Definition request.hh:1024
bool isLocalAccess()
Is this request for a local memory mapped resource/register?
Definition request.hh:734
int getAccessDepth() const
Definition request.hh:972
PrivateFlags privateFlags
Private flags for field validity checking.
Definition request.hh:410
bool isTlbiCmd() const
Definition request.hh:1055
bool isPriv() const
Definition request.hh:1023
bool systemReq() const
Definition request.hh:918
bool isHTMStart() const
Definition request.hh:1039
InstSeqNum getReqInstSeqNum() const
Definition request.hh:998
void incAccessDepth() const
Increment/Get the depth at which this request is responded to.
Definition request.hh:971
void requestorId(RequestorID rid)
Definition request.hh:855
gem5::Flags< CacheCoherenceFlagsType > CacheCoherenceFlags
Definition request.hh:291
HtmFailureFaultCause getHtmAbortCause() const
Definition request.hh:777
Flags _flags
Flag structure for the request.
Definition request.hh:404
Addr getPaddr() const
Definition request.hh:638
bool isLLSC() const
Definition request.hh:1022
bool isToPOC() const
Definition request.hh:1077
bool isCacheMaintenance() const
Definition request.hh:1121
unsigned getSize() const
Definition request.hh:692
bool isReadModifyWrite() const
Definition request.hh:1028
void setPaddr(Addr paddr)
Set just the physical address.
Definition request.hh:597
ArchFlagsType getArchFlags() const
Accessor function for architecture-specific flags.
Definition request.hh:873
Counter _instCount
The instruction count at the time this request is created.
Definition request.hh:468
static const FlagsType STORE_NO_DATA
Definition request.hh:260
unsigned _size
The size of the request.
Definition request.hh:393
void setVirt(Addr vaddr, unsigned size, Flags flags, RequestorID id, Addr pc, AtomicOpFunctorPtr amo_op=nullptr)
Set up a virtual (e.g., CPU) request in a previously allocated Request object.
Definition request.hh:572
bool hasStreamId() const
Definition request.hh:921
uint64_t _extraData
Extra data for the request, such as the return value of store conditional or the compare value for a ...
Definition request.hh:451
void setContext(ContextID context_id)
Set up Context numbers.
Definition request.hh:546
Addr _pc
program counter of initiating access; for tracing/debugging
Definition request.hh:457
bool isAtomicReturn() const
Definition request.hh:1036
bool isHTMCommit() const
Definition request.hh:1040
Addr getPC() const
Accessor function for pc.
Definition request.hh:961
gem5::Flags< FlagsType > Flags
Definition request.hh:102
uint32_t substreamId() const
Definition request.hh:940
uint16_t PrivateFlagsType
Definition request.hh:346
void setStreamId(uint32_t sid)
Definition request.hh:553
@ VALID_PADDR
Whether or not paddr is valid (has been written yet).
Definition request.hh:354
@ VALID_SIZE
Whether or not the size is valid.
Definition request.hh:352
@ VALID_INST_COUNT
Whether or not the instruction count is valid.
Definition request.hh:372
@ VALID_INST_SEQ_NUM
Whether or not the instruction sequence number is valid.
Definition request.hh:358
@ VALID_CONTEXT_ID
Whether or not the context ID is valid.
Definition request.hh:362
@ VALID_STREAM_ID
Whether or not the stream ID and substream ID is valid.
Definition request.hh:366
@ VALID_HTM_ABORT_CAUSE
Whether or not the abort cause is valid.
Definition request.hh:370
@ VALID_PC
Whether or not the pc is valid.
Definition request.hh:360
@ STICKY_PRIVATE_FLAGS
These flags are not cleared when a Request object is reused (assigned a new address).
Definition request.hh:377
@ VALID_EXTRA_DATA
Whether or not the sc result is valid.
Definition request.hh:364
@ VALID_VADDR
Whether or not the vaddr is valid.
Definition request.hh:356
void setReqInstSeqNum(const InstSeqNum seq_num)
Definition request.hh:1005
bool hasInstCount() const
Accessor for instruction count.
Definition request.hh:648
Tick translateDelta
Time for the TLB/table walker to successfully translate this request.
Definition request.hh:668
InstSeqNum _reqInstSeqNum
Sequence number of the instruction that creates the request.
Definition request.hh:460
bool isRelease() const
Definition request.hh:1034
Tick accessDelta
Access latency to complete this memory transaction not including translation time.
Definition request.hh:674
void splitOnVaddr(Addr split_addr, RequestPtr &req1, RequestPtr &req2)
Generate two requests as if this request had been split into two pieces.
Definition request.hh:610
bool isGL2CacheFlush() const
Definition request.hh:1102
ContextID contextId() const
Accessor function for context ID.
Definition request.hh:910
void setSubstreamId(uint32_t ssid)
Definition request.hh:560
void setSystemReq(bool sysReq)
Definition request.hh:917
bool isTlbi() const
Definition request.hh:1050
Static instruction class for unknown (illegal) instructions.
Definition unknown.hh:53
ThreadContext is the external interface to all thread state for anything outside of the CPU.
STL vector class.
Definition stl.hh:37
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
Definition amo.hh:269
void set(Type mask)
Set all flag's bits matching the given mask.
Definition flags.hh:116
bool isSet(Type mask) const
Verifies whether any bit matching the given mask is set.
Definition flags.hh:83
void clear()
Clear all flag's bits.
Definition flags.hh:102
uint8_t flags
Definition helpers.cc:87
Bitfield< 33 > id
Bitfield< 4 > pc
Bitfield< 15 > be
Bitfield< 63 > val
Definition misc.hh:804
double Counter
All counters are of 64-bit values.
Definition types.hh:46
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
std::shared_ptr< Request > RequestPtr
Definition request.hh:94
Tick curTick()
The universal simulation clock.
Definition cur_tick.hh:46
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
uint64_t Tick
Tick count type.
Definition types.hh:58
const Tick MaxTick
Definition types.hh:60
uint16_t RequestorID
Definition request.hh:95
int ContextID
Globally unique thread context ID.
Definition types.hh:239
const ContextID InvalidContextID
Definition types.hh:240
const Addr MaxAddr
Definition types.hh:171
HtmFailureFaultCause
Definition htm.hh:48
uint64_t InstSeqNum
Definition inst_seq.hh:40

Generated on Tue Jun 18 2024 16:24:05 for gem5 by doxygen 1.11.0