Go to the documentation of this file.
29 #ifndef __LEARNING_GEM5_SIMPLE_CACHE_SIMPLE_CACHE_HH__
30 #define __LEARNING_GEM5_SIMPLE_CACHE_SIMPLE_CACHE_HH__
32 #include <unordered_map>
36 #include "params/SimpleCache.hh"
111 {
panic(
"recvAtomic unimpl."); }
331 #endif // __LEARNING_GEM5_SIMPLE_CACHE_SIMPLE_CACHE_HH__
This is a simple scalar statistic, like a counter.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
bool handleRequest(PacketPtr pkt, int port_id)
Handle the request from the CPU side.
statistics::Histogram missLatency
const std::string name() const
Return port name (for DPRINTF).
void recvFunctional(PacketPtr pkt) override
Receive a functional request packet from the request port.
int waitingPortId
The port to send the response when we recieve it back.
PacketPtr blockedPacket
If we tried to send a packet and it was blocked, store it here.
A very simple cache object.
Tick recvAtomic(PacketPtr pkt) override
Receive an atomic request packet from the request port.
void sendRangeChange() const
Tell the CPU side to ask for our memory ranges.
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the response port.
void recvRespRetry() override
Called by the request port if sendTimingResp was called on this response port (causing recvTimingResp...
bool accessFunctional(PacketPtr pkt)
This is where we actually update / read from the cache.
const PortID InvalidPortID
void sendResponse(PacketPtr pkt)
Send the packet to the CPU side.
bool handleResponse(PacketPtr pkt)
Handle the respone from the memory side.
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
Cycles is a wrapper class for representing cycle counts, i.e.
statistics::Formula hitRatio
Port on the memory-side that receives responses.
const unsigned blockSize
The block size for the cache.
CPUSidePort(const std::string &name, int id, SimpleCache *owner)
Constructor.
MemSidePort memPort
Instantiation of the memory-side port.
int id
Since this is a vector port, need to know what number this one is.
bool needRetry
True if the port needs to send a retry req.
statistics::Scalar misses
const Params & params() const
void trySendRetry()
Send a retry to the peer port only if it is needed.
gem5::SimpleCache::SimpleCacheStats stats
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
uint64_t Tick
Tick count type.
std::vector< CPUSidePort > cpuPorts
Instantiation of the CPU-side port.
PacketPtr originalPacket
Packet that we are currently handling.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
MemSidePort(const std::string &name, SimpleCache *owner)
Constructor.
PacketPtr blockedPacket
If we tried to send a packet and it was blocked, store it here.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
void handleFunctional(PacketPtr pkt)
Handle a packet functionally.
bool recvTimingReq(PacketPtr pkt) override
Receive a timing request from the request port.
AddrRangeList getAddrRanges() const override
Get a list of the non-overlapping address ranges the owner is responsible for.
A ResponsePort is a specialization of a port.
Port on the CPU-side that receives requests.
const unsigned capacity
Number of blocks in the cache (size of cache / block size)
Tick missTime
For tracking the miss latency.
Ports are used to interface objects to each other.
SimpleCache(const SimpleCacheParams ¶ms)
constructor
SimpleCacheStats(statistics::Group *parent)
void recvReqRetry() override
Called by the response port if sendTimingReq was called on this request port (causing recvTimingReq t...
void sendPacket(PacketPtr pkt)
Send a packet across this port.
const Cycles latency
Latency to check the cache. Number of cycles for both hit and miss.
void sendPacket(PacketPtr pkt)
Send a packet across this port.
void recvRangeChange() override
Called to receive an address range change from the peer response port.
std::unordered_map< Addr, uint8_t * > cacheStore
An incredibly simple cache storage. Maps block addresses to data.
SimpleCache * owner
The object that owns this object (SimpleCache)
AddrRangeList getAddrRanges() const
Return the address ranges this cache is responsible for.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
SimpleCache * owner
The object that owns this object (SimpleCache)
void accessTiming(PacketPtr pkt)
Access the cache for a timing access.
void insert(PacketPtr pkt)
Insert a block into the cache.
#define panic(...)
This implements a cprintf based panic() function.
bool blocked
True if this cache is currently blocked waiting for a response.
Generated on Sun Jul 30 2023 01:56:57 for gem5 by doxygen 1.8.17