32#ifndef __MEM_RUBY_SYSTEM_GPU_COALESCER_HH__
33#define __MEM_RUBY_SYSTEM_GPU_COALESCER_HH__
36#include <unordered_map>
44#include "mem/ruby/protocol/PrefetchBit.hh"
45#include "mem/ruby/protocol/RubyAccessMode.hh"
46#include "mem/ruby/protocol/RubyRequestType.hh"
47#include "mem/ruby/protocol/SequencerRequestType.hh"
54struct RubyGPUCoalescerParams;
154 bool usingRubyTester)
159 if (!usingRubyTester) {
185 if (!usingRubyTester) {
274 Cycles initialRequestTime,
275 Cycles forwardRequestTime,
282 Cycles initialRequestTime,
283 Cycles forwardRequestTime,
284 Cycles firstResponseTime);
299 Cycles initialRequestTime,
300 Cycles forwardRequestTime,
301 Cycles firstResponseTime);
306 Cycles initialRequestTime,
307 Cycles forwardRequestTime,
334 void print(std::ostream& out)
const;
378 Addr pc, RubyAccessMode access_mode,
392 Cycles initialRequestTime,
393 Cycles forwardRequestTime,
398 Cycles initialRequestTime,
399 Cycles forwardRequestTime,
401 bool success,
bool isRegion);
Cycles is a wrapper class for representing cycle counts, i.e.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
SenderState * senderState
This packet's sender state.
Ports are used to interface objects to each other.
const PortID id
A numeric identifier to distinguish ports in a vector, and set to InvalidPortID in case this port is ...
const std::string name() const
Return port name (for DPRINTF).
bool sendTimingResp(PacketPtr pkt)
Attempt to send a timing response to the request port by calling its corresponding receive function.
CoalescedRequest(uint64_t _seqNum)
uint64_t getSeqNum() const
std::vector< PacketPtr > pkts
void setSeqNum(uint64_t _seqNum)
void setIssueTime(Cycles _issueTime)
void insertPacket(PacketPtr pkt)
Cycles getIssueTime() const
void setRubyType(RubyRequestType type)
PacketPtr getFirstPkt() const
RubyRequestType getRubyType() const
std::vector< PacketPtr > & getPackets()
GMTokenPort(const std::string &name, PortID id=InvalidPortID)
Tick recvAtomic(PacketPtr)
Receive an atomic request packet from the peer.
void recvFunctional(PacketPtr)
Receive a functional request packet from the peer.
AddrRangeList getAddrRanges() const
Get a list of the non-overlapping address ranges the owner is responsible for.
bool recvTimingReq(PacketPtr)
Receive a timing request from the peer.
virtual RubyRequestType getRequestType(PacketPtr pkt)
void writeCompleteCallback(Addr address, uint64_t instSeqNum, MachineType mach)
void writeCallback(Addr address, DataBlock &data)
statistics::Histogram & getFirstResponseToCompletionDelayHist(const MachineType t) const
std::vector< statistics::Histogram * > m_IssueToInitialDelayHist
Histograms for recording the breakdown of miss latency.
GPUCoalescer & operator=(const GPUCoalescer &obj)
int m_store_waiting_on_load_cycles
void evictionCallback(Addr address)
void kernelCallback(int wavefront_id)
statistics::Histogram & getInitialToForwardDelayHist(const MachineType t) const
virtual void atomicCallback(Addr address, MachineType mach, const DataBlock &data)
virtual void issueMemSyncRequest(PacketPtr pkt)
void printRequestTable(std::stringstream &ss)
int m_max_outstanding_requests
GMTokenPort & getGMTokenPort()
std::vector< statistics::Histogram * > m_missMachLatencyHist
Histograms for profiling the latencies for requests that required external messages.
statistics::Histogram & getIssueToInitialDelayHist(uint32_t t) const
statistics::Histogram m_latencyHist
Histogram for holding latency profile of all requests.
void resetStats() override
Callback to reset stats.
statistics::Histogram & getOutstandReqHist()
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
statistics::Histogram & getForwardRequestToFirstResponseHist(const MachineType t) const
RubyGPUCoalescerParams Params
void printProgress(std::ostream &out) const
void hitCallback(CoalescedRequest *crequest, MachineType mach, DataBlock &data, bool success, Cycles initialRequestTime, Cycles forwardRequestTime, Cycles firstResponseTime, bool isRegion)
std::unordered_map< uint64_t, std::deque< CoalescedRequest * > > coalescedReqs
UncoalescedTable uncoalescedTable
void insertKernel(int wavefront_id, PacketPtr pkt)
statistics::Histogram & getTypeLatencyHist(uint32_t t)
std::unordered_map< int, PacketPtr > kernelEndList
virtual void issueRequest(CoalescedRequest *crequest)=0
statistics::Histogram & getMissLatencyHist()
bool tryCacheAccess(Addr addr, RubyRequestType type, Addr pc, RubyAccessMode access_mode, int size, DataBlock *&data_ptr)
bool isDeadlockEventScheduled() const override
statistics::Histogram m_missLatencyHist
Histogram for holding latency profile of all requests that miss in the controller connected to this s...
bool m_deadlock_check_scheduled
statistics::Histogram & getMissTypeMachLatencyHist(uint32_t r, uint32_t t) const
bool coalescePacket(PacketPtr pkt)
int m_load_waiting_on_load_cycles
int m_store_waiting_on_store_cycles
std::vector< statistics::Histogram * > m_InitialToForwardDelayHist
Cycles m_deadlock_threshold
std::vector< statistics::Histogram * > m_FirstResponseToCompletionDelayHist
std::vector< statistics::Histogram * > m_ForwardToFirstResponseDelayHist
RequestStatus makeRequest(PacketPtr pkt) override
bool assumingRfOCoherence
void readCallback(Addr address, DataBlock &data)
void completeHitCallback(std::vector< PacketPtr > &mylist)
void recordMissLatency(CoalescedRequest *crequest, MachineType mach, Cycles initialRequestTime, Cycles forwardRequestTime, Cycles firstResponseTime, bool success, bool isRegion)
std::unordered_map< uint64_t, PendingWriteInst > pendingWriteInsts
std::vector< statistics::Histogram * > m_typeLatencyHist
GPUCoalescer(const Params &)
void print(std::ostream &out) const
statistics::Histogram & getMissMachLatencyHist(uint32_t t) const
int m_load_waiting_on_store_cycles
std::map< Addr, std::deque< CoalescedRequest * > > coalescedTable
std::vector< int > newKernelEnds
std::vector< statistics::Histogram * > m_missTypeLatencyHist
std::vector< std::vector< statistics::Histogram * > > m_missTypeMachLatencyHist
int outstandingCount() const override
statistics::Histogram & getMissTypeLatencyHist(uint32_t t)
CacheMemory * m_instCache_ptr
statistics::Histogram & getLatencyHist()
bool m_runningGarnetStandalone
CacheMemory * m_dataCache_ptr
statistics::Histogram m_outstandReqHist
Histogram for number of outstanding requests per cycle.
void descheduleDeadlockEvent() override
EventFunctionWrapper issueEvent
GPUDynInstPtr getDynInst(PacketPtr pkt) const
GPUCoalescer(const GPUCoalescer &obj)
EventFunctionWrapper deadlockCheckEvent
void addPendingReq(RubyPort::MemResponsePort *port, GPUDynInstPtr inst, bool usingRubyTester)
void ackWriteCompletion(bool usingRubyTester)
int getNumPendingStores()
bool receiveWriteCompleteAck()
RubyPort::MemResponsePort * originalPort
GPUDynInstPtr gpuDynInstPtr
void setPacketsRemaining(InstSeqNum seqNum, int count)
std::map< InstSeqNum, RubyRequestType > reqTypeMap
void insertPacket(PacketPtr pkt)
void printRequestTable(std::stringstream &ss)
bool areRequestsDone(const InstSeqNum instSeqNum)
void insertReqType(PacketPtr pkt, RubyRequestType type)
std::map< InstSeqNum, PerInstPackets > instMap
UncoalescedTable(GPUCoalescer *gc)
void initPacketsRemaining(InstSeqNum seqNum, int count)
int getPacketsRemaining(InstSeqNum seqNum)
void checkDeadlock(Tick threshold)
PerInstPackets * getInstPackets(int offset)
std::map< InstSeqNum, int > instPktsRemaining
void deschedule(Event &event)
bool scheduled() const
Determine if the current event is scheduled.
std::list< PacketPtr > PerInstPackets
std::ostream & operator<<(std::ostream &os, const BoolVec &myvector)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
const PortID InvalidPortID
std::shared_ptr< GPUDynInst > GPUDynInstPtr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
uint64_t Tick
Tick count type.
Declaration of a request, the overall memory request consisting of the parts of the request that are ...
Declaration of Statistics objects.