38#ifndef __MEM_RUBY_PROTOCOL_CHI_CHIGenericController_HH__
39#define __MEM_RUBY_PROTOCOL_CHI_CHIGenericController_HH__
47#include "mem/ruby/protocol/AccessPermission.hh"
50#include "params/CHIGenericController.hh"
53#include "mem/ruby/protocol/CHI/CHIDataMsg.hh"
54#include "mem/ruby/protocol/CHI/CHIRequestMsg.hh"
55#include "mem/ruby/protocol/CHI/CHIResponseMsg.hh"
56#include "mem/ruby/protocol/CHI/Cache_Controller.hh"
77 void print(std::ostream& out)
const override;
166 template<
typename MsgType>
168 const std::function<
bool(
const MsgType*)> &callback)
170 bool pending =
false;
172 while (buffer->
isReady(cur_tick)) {
174 dynamic_cast<const MsgType*
>(buffer->
peek());
186 template<
typename MessageType>
ClockedObjectParams Params
Parameters of ClockedObject.
Tick cyclesToTicks(Cycles c) const
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
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
const int dataMsgsPerLine
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.
std::shared_ptr< CHIDataMsg > CHIDataMsgPtr
bool sendSnoopMsg(CHIRequestMsgPtr msg)
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
std::shared_ptr< CHIResponseMsg > CHIResponseMsgPtr
std::shared_ptr< CHIRequestMsg > CHIRequestMsgPtr
const int dataChannelSize
bool sendDataMsg(CHIDataMsgPtr msg)
CHI::CHIRequestMsg CHIRequestMsg
bool sendResponseMsg(CHIResponseMsgPtr msg)
int functionalWriteBuffers(PacketPtr &) override
The return value indicates the number of messages written with the data from the packet.
MessageBuffer *const reqOut
bool sendRequestMsg(CHIRequestMsgPtr msg)
PARAMS(CHIGenericController)
MessageBuffer * getMemReqQueue() const override
bool receiveAllRdyMessages(MessageBuffer *buffer, const std::function< bool(const MsgType *)> &callback)
MessageBuffer * getMandatoryQueue() const override
CHI::CHIDataMsg CHIDataMsg
bool sendMessage(MessageType &msg, MessageBuffer *buffer)
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
bool areNSlotsAvailable(unsigned int n, Tick curTime)
bool isReady(Tick current_time) const
const Message * peek() const
Function for extracting the message at the head of the message queue.
Tick dequeue(Tick current_time, bool decrement_messages=true)
Updates the delay cycles of the message at the head of the queue, removes it from the queue and retur...
void enqueue(MsgPtr message, Tick curTime, Tick delta, bool ruby_is_random, bool ruby_warmup, bool bypassStrictFIFO=false)
Copyright (c) 2024 Arm Limited All rights reserved.
Tick curTick()
The universal simulation clock.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.