48#include "debug/RubyCHIGeneric.hh"
50#include "mem/ruby/protocol/MemoryMsg.hh"
64 reqOut(
p.reqOut), snpOut(
p.snpOut),
65 rspOut(
p.rspOut), datOut(
p.datOut),
66 reqIn(
p.reqIn), snpIn(
p.snpIn),
67 rspIn(
p.rspIn), datIn(
p.datIn),
68 cacheLineSize(
p.ruby_system->getBlockSizeBytes()),
70 dataChannelSize(
p.data_channel_size),
71 dataMsgsPerLine(cacheLineSize /
p.data_channel_size)
75 p.ruby_system->registerAbstractController(
76 this, std::make_unique<CHIProtocolInfo>());
123 assert(seq !=
nullptr);
130 out <<
"[CHIGenericController " <<
m_version <<
"]";
197 bool pending =
false;
199 DPRINTF(RubyCHIGeneric,
"wakeup: checking incoming rsp messages\n");
200 pending = pending || receiveAllRdyMessages<CHIResponseMsg>(
rspIn,
203 DPRINTF(RubyCHIGeneric,
"wakeup: checking incoming dat messages\n");
204 pending = pending || receiveAllRdyMessages<CHIDataMsg>(
datIn,
207 DPRINTF(RubyCHIGeneric,
"wakeup: checking incoming snp messages\n");
208 pending = pending || receiveAllRdyMessages<CHIRequestMsg>(
snpIn,
211 DPRINTF(RubyCHIGeneric,
"wakeup: checking incoming req messages\n");
212 pending = pending || receiveAllRdyMessages<CHIRequestMsg>(
reqIn,
216 DPRINTF(RubyCHIGeneric,
"wakeup: messages pending\n");
224 panic(
"CHIGenericController doesn't implement recordCacheTrace");
230 return AccessPermission_NotPresent;
237 panic(
"CHIGenericController doesn't expect functionalRead");
244 panic(
"CHIGenericController doesn't expect functionalRead");
251 int num_functional_writes = 0;
260 return num_functional_writes;
ClockedObjectParams Params
Parameters of ClockedObject.
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....
RubySystem * m_ruby_system
virtual void regStats()
Callback to set stat parameters.
void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
virtual void resetStats()=0
Callback to reset stats.
bool functionalReadBuffers(PacketPtr &) override
These functions are used by ruby system to read/write the data blocks that exist with in the controll...
void initNetQueues() override
Initialize the message buffers.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
virtual bool recvResponseMsg(const CHIResponseMsg *msg)=0
GPUCoalescer * getGPUCoalescer() const override
std::vector< RubyPort * > sequencers
virtual bool recvSnoopMsg(const CHIRequestMsg *msg)=0
MessageBuffer *const datOut
DMASequencer * getDMASequencer() const override
virtual bool recvRequestMsg(const CHIRequestMsg *msg)=0
MessageBuffer *const rspOut
int functionalWrite(const Addr ¶m_addr, Packet *param_pkt) override
void resetStats() override
Callback to reset stats.
Sequencer * getCPUSequencer() const override
MessageBuffer *const rspIn
void collateStats() override
Function for collating statistics from all the controllers of this particular type.
MessageBuffer *const snpOut
CHI::CHIRequestMsg CHIRequestMsg
int functionalWriteBuffers(PacketPtr &) override
The return value indicates the number of messages written with the data from the packet.
MessageBuffer *const reqOut
MessageBuffer * getMemReqQueue() const override
MessageBuffer * getMandatoryQueue() const override
CHI::CHIDataMsg CHIDataMsg
CHIGenericController(const Params &p)
void regStats() override
Callback to set stat parameters.
void print(std::ostream &out) const override
CHI::CHIResponseMsg CHIResponseMsg
MessageBuffer *const snpIn
MessageBuffer *const datIn
void addSequencer(RubyPort *seq)
MessageBuffer *const reqIn
virtual bool recvDataMsg(const CHIDataMsg *msg)=0
void recordCacheTrace(int cntrl, CacheRecorder *tr) override
void functionalRead(const Addr ¶m_addr, Packet *param_pkt, WriteMask ¶m_mask) override
AccessPermission getAccessPermission(const Addr ¶m_addr) override
MessageBuffer * getMemRespQueue() const override
void scheduleEvent(Cycles timeDelta)
void setConsumer(Consumer *consumer)
bool functionalRead(Packet *pkt)
uint32_t functionalWrite(Packet *pkt)
void setToNetQueue(NodeID global_id, bool ordered, int netNumber, std::string vnet_type, MessageBuffer *b)
virtual void setFromNetQueue(NodeID global_id, bool ordered, int netNumber, std::string vnet_type, MessageBuffer *b)
int MachineType_base_number(const MachineType &obj)
static constexpr std::enable_if_t< std::is_integral_v< T >, int > floorLog2(T x)
#define panic(...)
This implements a cprintf based panic() function.
Copyright (c) 2024 Arm Limited All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
NodeID num
range: 0 ... number of this machine's components in system - 1