Go to the documentation of this file.
43 #include "debug/RubyQueue.hh"
45 #include "mem/ruby/protocol/MemoryMsg.hh"
52 m_clusterID(
p->cluster_id),
53 m_id(
p->
system->getRequestorId(this)), m_is_blocking(false),
54 m_number_of_TBEs(
p->number_of_TBEs),
55 m_transitions_per_cycle(
p->transitions_per_cycle),
56 m_buffer_size(
p->buffer_size), m_recycle_latency(
p->recycle_latency),
57 m_mandatory_queue_latency(
p->mandatory_queue_latency),
59 addrRanges(
p->addr_ranges.begin(),
p->addr_ranges.end())
73 for (uint32_t
i = 0;
i < size;
i++) {
88 for (uint32_t
i = 0;
i < size;
i++) {
100 .
desc(
"cycles for which number of transistions == max transitions")
181 for (MsgVecType::iterator vec_iter = buf_iter->second->begin();
182 vec_iter != buf_iter->second->end();
187 if (*vec_iter != NULL &&
188 (wokeUpMsgBufs.count(*vec_iter) == 0)) {
189 (*vec_iter)->reanalyzeAllMessages(
clockEdge());
190 wokeUpMsgBufs.insert(*vec_iter);
193 wokeUpMsgVecs.push_back(buf_iter->second);
197 wb_iter != wokeUpMsgVecs.end();
215 const MemoryMsg *mem_msg = (
const MemoryMsg*)mem_queue->peek();
217 if (mem_msg->m_Len > 0) {
218 req_size = mem_msg->m_Len;
222 = std::make_shared<Request>(mem_msg->m_addr, req_size, 0,
m_id);
224 if (mem_msg->getType() == MemoryRequestType_MEMORY_WB) {
229 }
else if (mem_msg->getType() == MemoryRequestType_MEMORY_READ) {
231 uint8_t *newData =
new uint8_t[req_size];
234 panic(
"Unknown memory request type (%s) for addr %p",
235 MemoryRequestType_to_string(mem_msg->getType()),
307 int num_functional_writes = 0;
311 return num_functional_writes + 1;
320 std::shared_ptr<MemoryMsg> msg = std::make_shared<MemoryMsg>(
clockEdge());
321 (*msg).m_addr = pkt->
getAddr();
325 (*msg).m_OriginalRequestorMachId =
s->id;
329 (*msg).m_Type = MemoryRequestType_MEMORY_READ;
330 (*msg).m_MessageSize = MessageSizeType_Response_Data;
333 (*msg).m_DataBlk.setData(pkt->
getPtr<uint8_t>(), 0,
336 (*msg).m_Type = MemoryRequestType_MEMORY_WB;
337 (*msg).m_MessageSize = MessageSizeType_Writeback_Control;
339 panic(
"Incorrect packet type received from memory controller!");
370 controller->serviceMemoryQueue();
376 :
RequestPort(_name, _controller,
id), controller(_controller)
void blockOnQueue(Addr, MessageBuffer *)
virtual void regStats()
Callback to set stat parameters.
WaitingBufType m_waiting_buffers
static uint32_t getBlockSizeBytes()
Tick recvAtomic(PacketPtr pkt)
AbstractController * controller
std::vector< Stats::Histogram * > m_delayVCHistogram
virtual MessageBuffer * getMemReqQueue() const =0
NodeID addressToNodeID(Addr addr, MachineType mtype)
Map an address to the correct NodeID.
void registerDumpCallback(const std::function< void()> &callback)
Register a callback that should be called whenever statistics are about to be dumped.
void stallBuffer(MessageBuffer *buf, Addr addr)
bool recvTimingResp(PacketPtr pkt)
Receive a timing response from the peer.
uint64_t Tick
Tick count type.
MachineID mapAddressToMachine(Addr addr, MachineType mtype) const
Map an address to the correct MachineID.
MemoryPort(const std::string &_name, AbstractController *_controller, PortID id=InvalidPortID)
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
std::shared_ptr< Request > RequestPtr
void dataDynamic(T *p)
Set the data pointer to a value that should have delete [] called on it.
void sendFunctional(PacketPtr pkt) const
Send a functional request packet, where the data is instantly updated everywhere in the memory system...
void setConsumer(Consumer *consumer)
unsigned int m_cur_in_port
void enqueue(MsgPtr message, Tick curTime, Tick delta)
bool serviceMemoryQueue()
bool isBlocked(Addr) const
void setData(const uint8_t *p)
Copy data into the packet from the provided pointer.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
void wakeUpBuffers(Addr addr)
Tick cyclesToTicks(Cycles c) const
virtual void regStats()
Callback to set stat parameters.
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the responder port by calling its corresponding receive function.
RubyTester::SenderState SenderState
static PacketPtr createRead(const RequestPtr &req)
Constructor-like methods that return Packets based on Request objects.
Ports are used to interface objects to each other.
Tick clockEdge(Cycles cycles=Cycles(0)) const
Determine the tick when a cycle begins, by default the current one, but the argument also enables the...
int functionalMemoryWrite(PacketPtr)
void recvTimingResp(PacketPtr pkt)
std::map< Addr, MessageBuffer * > m_block_map
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
Stats::Histogram m_delayHistogram
Histogram for profiling delay for the messages this controller cares for.
virtual void collateStats()
Function for collating statistics from all the controllers of this particular type.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Stats::Scalar m_fully_busy_cycles
Counter for the number of cycles when the transitions carried out were equal to the maximum allowed.
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
const std::string & name()
static uint32_t getNumberOfVirtualNetworks()
const FlagsType nozero
Don't print if this is zero.
void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
virtual const std::string name() const
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
A function used to return the port associated with this bus object.
static PacketPtr createWrite(const RequestPtr &req)
void pushSenderState(SenderState *sender_state)
Push a new sender state to the packet and make the current sender state the predecessor of the new on...
static bool getWarmupEnabled()
Cycles ticksToCycles(Tick t) const
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void recvReqRetry()
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
Addr getOffset(Addr addr)
void reset()
Reset stat value to default.
RubyControllerParams Params
void sample(const U &v, int n=1)
Add a value to the distribtion n times.
Cycles is a wrapper class for representing cycle counts, i.e.
T * getPtr()
get a pointer to the data ptr.
std::set< MessageBuffer * > MsgBufType
Histogram & init(size_type size)
Set the parameters of this histogram.
SenderState * senderState
This packet's sender state.
Tick sendAtomic(PacketPtr pkt)
Send an atomic request packet, where the data is moved and the state is updated in zero time,...
void profileMsgDelay(uint32_t virtualNetwork, Cycles delay)
Profiles the delay associated with messages.
void allocate()
Allocate memory for the packet.
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
virtual MessageBuffer * getMemRespQueue() const =0
std::string csprintf(const char *format, const Args &...args)
std::vector< MessageBuffer * > MsgVecType
void scheduleEvent(Cycles timeDelta)
#define panic(...)
This implements a cprintf based panic() function.
AbstractController(const Params *p)
virtual void resetStats()=0
Callback to reset stats.
void functionalMemoryRead(PacketPtr)
Generated on Wed Sep 30 2020 14:02:13 for gem5 by doxygen 1.8.17