gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
noncoherent_cache.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2018 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  * All rights reserved.
16  *
17  * Redistribution and use in source and binary forms, with or without
18  * modification, are permitted provided that the following conditions are
19  * met: redistributions of source code must retain the above copyright
20  * notice, this list of conditions and the following disclaimer;
21  * redistributions in binary form must reproduce the above copyright
22  * notice, this list of conditions and the following disclaimer in the
23  * documentation and/or other materials provided with the distribution;
24  * neither the name of the copyright holders nor the names of its
25  * contributors may be used to endorse or promote products derived from
26  * this software without specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39  */
40 
49 #ifndef __MEM_CACHE_NONCOHERENT_CACHE_HH__
50 #define __MEM_CACHE_NONCOHERENT_CACHE_HH__
51 
52 #include "base/compiler.hh"
53 #include "base/logging.hh"
54 #include "base/types.hh"
55 #include "mem/cache/base.hh"
56 #include "mem/packet.hh"
57 
58 namespace gem5
59 {
60 
61 class CacheBlk;
62 class MSHR;
63 struct NoncoherentCacheParams;
64 
69 {
70  protected:
71  bool access(PacketPtr pkt, CacheBlk *&blk, Cycles &lat,
72  PacketList &writebacks) override;
73 
74  void handleTimingReqMiss(PacketPtr pkt, CacheBlk *blk,
75  Tick forward_time,
76  Tick request_time) override;
77 
78  void recvTimingReq(PacketPtr pkt) override;
79 
80  void doWritebacks(PacketList& writebacks,
81  Tick forward_time) override;
82 
83  void doWritebacksAtomic(PacketList& writebacks) override;
84 
85  void serviceMSHRTargets(MSHR *mshr, const PacketPtr pkt,
86  CacheBlk *blk) override;
87 
88  void recvTimingResp(PacketPtr pkt) override;
89 
90  void recvTimingSnoopReq(PacketPtr pkt) override {
91  panic("Unexpected timing snoop request %s", pkt->print());
92  }
93 
94  void recvTimingSnoopResp(PacketPtr pkt) override {
95  panic("Unexpected timing snoop response %s", pkt->print());
96  }
97 
99  PacketList &writebacks) override;
100 
101  Tick recvAtomic(PacketPtr pkt) override;
102 
104  panic("Unexpected atomic snoop request %s", pkt->print());
105  }
106 
107  void functionalAccess(PacketPtr pkt, bool from_cpu_side) override;
108 
109  void satisfyRequest(PacketPtr pkt, CacheBlk *blk,
110  bool deferred_response = false,
111  bool pending_downgrade = false) override;
112 
113  /*
114  * Creates a new packet with the request to be send to the memory
115  * below. The noncoherent cache is below the point of coherence
116  * and therefore all fills bring in writable, therefore the
117  * needs_writeble parameter is ignored.
118  */
120  bool needs_writable,
121  bool is_whole_line_write) const override;
122 
123  [[nodiscard]] PacketPtr evictBlock(CacheBlk *blk) override;
124 
125  public:
126  NoncoherentCache(const NoncoherentCacheParams &p);
127 };
128 
129 } // namespace gem5
130 
131 #endif // __MEM_CACHE_NONCOHERENTCACHE_HH__
gem5::NoncoherentCache::recvTimingSnoopReq
void recvTimingSnoopReq(PacketPtr pkt) override
Snoops bus transactions to maintain coherence.
Definition: noncoherent_cache.hh:90
gem5::NoncoherentCache::recvAtomic
Tick recvAtomic(PacketPtr pkt) override
Performs the access specified by the request.
Definition: noncoherent_cache.cc:220
gem5::MSHR
Miss Status and handling Register.
Definition: mshr.hh:74
gem5::NoncoherentCache::recvTimingResp
void recvTimingResp(PacketPtr pkt) override
Handles a response (cache line fill/write ack) from the bus.
Definition: noncoherent_cache.cc:325
gem5::NoncoherentCache::recvTimingReq
void recvTimingReq(PacketPtr pkt) override
Performs the access specified by the request.
Definition: noncoherent_cache.cc:135
gem5::NoncoherentCache::serviceMSHRTargets
void serviceMSHRTargets(MSHR *mshr, const PacketPtr pkt, CacheBlk *blk) override
Service non-deferred MSHR targets using the received response.
Definition: noncoherent_cache.cc:242
base.hh
gem5::NoncoherentCache::NoncoherentCache
NoncoherentCache(const NoncoherentCacheParams &p)
Definition: noncoherent_cache.cc:62
gem5::NoncoherentCache::doWritebacks
void doWritebacks(PacketList &writebacks, Tick forward_time) override
Insert writebacks into the write buffer.
Definition: noncoherent_cache.cc:98
gem5::NoncoherentCache::handleAtomicReqMiss
Cycles handleAtomicReqMiss(PacketPtr pkt, CacheBlk *&blk, PacketList &writebacks) override
Handle a request in atomic mode that missed in this cache.
Definition: noncoherent_cache.cc:171
gem5::NoncoherentCache::createMissPacket
PacketPtr createMissPacket(PacketPtr cpu_pkt, CacheBlk *blk, bool needs_writable, bool is_whole_line_write) const override
Create an appropriate downstream bus request packet.
Definition: noncoherent_cache.cc:147
gem5::NoncoherentCache::access
bool access(PacketPtr pkt, CacheBlk *&blk, Cycles &lat, PacketList &writebacks) override
Does all the processing necessary to perform the provided request.
Definition: noncoherent_cache.cc:80
gem5::CacheBlk
A Basic Cache block.
Definition: cache_blk.hh:70
packet.hh
gem5::Cycles
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:78
gem5::NoncoherentCache::recvAtomicSnoop
Tick recvAtomicSnoop(PacketPtr pkt) override
Snoop for the provided request in the cache and return the estimated time taken.
Definition: noncoherent_cache.hh:103
gem5::NoncoherentCache::evictBlock
PacketPtr evictBlock(CacheBlk *blk) override
Evict a cache block.
Definition: noncoherent_cache.cc:343
gem5::VegaISA::p
Bitfield< 54 > p
Definition: pagetable.hh:70
gem5::Packet::print
void print(std::ostream &o, int verbosity=0, const std::string &prefix="") const
Definition: packet.cc:368
gem5::BaseCache
A basic cache interface.
Definition: base.hh:94
gem5::NoncoherentCache::functionalAccess
void functionalAccess(PacketPtr pkt, bool from_cpu_side) override
Performs the access specified by the request.
Definition: noncoherent_cache.cc:233
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:294
gem5::Tick
uint64_t Tick
Tick count type.
Definition: types.hh:58
gem5::NoncoherentCache::recvTimingSnoopResp
void recvTimingSnoopResp(PacketPtr pkt) override
Handle a snoop response.
Definition: noncoherent_cache.hh:94
compiler.hh
types.hh
logging.hh
std::list
STL list class.
Definition: stl.hh:51
gem5::NoncoherentCache::doWritebacksAtomic
void doWritebacksAtomic(PacketList &writebacks) override
Send writebacks down the memory hierarchy in atomic mode.
Definition: noncoherent_cache.cc:108
gem5::NoncoherentCache
A non-coherent cache.
Definition: noncoherent_cache.hh:68
gem5::NoncoherentCache::satisfyRequest
void satisfyRequest(PacketPtr pkt, CacheBlk *blk, bool deferred_response=false, bool pending_downgrade=false) override
Perform any necessary updates to the block and perform any data exchange between the packet and the b...
Definition: noncoherent_cache.cc:70
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::NoncoherentCache::handleTimingReqMiss
void handleTimingReqMiss(PacketPtr pkt, CacheBlk *blk, Tick forward_time, Tick request_time) override
Definition: noncoherent_cache.cc:119
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:188

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