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