31 #include "debug/RubyQueue.hh"
32 #include "mem/protocol/MemoryMsg.hh"
41 m_clusterID(p->cluster_id),
42 m_masterId(p->
system->getMasterId(
name())), m_is_blocking(false),
43 m_number_of_TBEs(p->number_of_TBEs),
44 m_transitions_per_cycle(p->transitions_per_cycle),
45 m_buffer_size(p->buffer_size), m_recycle_latency(p->recycle_latency),
58 params()->ruby_system->registerAbstractController(
this);
61 for (uint32_t
i = 0;
i <
size;
i++) {
72 for (uint32_t
i = 0;
i <
size;
i++) {
84 .
desc(
"cycles for which number of transistions == max transitions")
166 for (MsgVecType::iterator vec_iter = buf_iter->second->begin();
167 vec_iter != buf_iter->second->end();
172 if (*vec_iter != NULL &&
173 (wokeUpMsgBufs.count(*vec_iter) == 0)) {
174 (*vec_iter)->reanalyzeAllMessages(
clockEdge());
175 wokeUpMsgBufs.insert(*vec_iter);
178 wokeUpMsgVecs.push_back(buf_iter->second);
182 wb_iter != wokeUpMsgVecs.end();
285 uint8_t *newData =
new uint8_t[
size];
305 int num_functional_writes = 0;
309 num_functional_writes++;
314 return num_functional_writes + 1;
323 std::shared_ptr<MemoryMsg> msg = std::make_shared<MemoryMsg>(
clockEdge());
324 (*msg).m_addr = pkt->
getAddr();
328 (*msg).m_OriginalRequestorMachId = s->
id;
332 (*msg).m_Type = MemoryRequestType_MEMORY_READ;
333 (*msg).m_MessageSize = MessageSizeType_Response_Data;
336 (*msg).m_DataBlk.setData(pkt->
getPtr<uint8_t>(), 0,
339 (*msg).m_Type = MemoryRequestType_MEMORY_WB;
340 (*msg).m_MessageSize = MessageSizeType_Writeback_Control;
342 panic(
"Incorrect packet type received from memory controller!");
359 const std::string &_label)
361 reqQueue(*_controller, *this, _label),
362 snoopRespQueue(*_controller, *this, _label),
363 controller(_controller)
RubyTester::SenderState SenderState
bool recvTimingResp(PacketPtr pkt)
Receive a timing response from the slave port.
virtual MessageBuffer * getMemoryQueue() const =0
WaitingBufType m_waiting_buffers
Cycles is a wrapper class for representing cycle counts, i.e.
const std::string & name()
void recvTimingResp(PacketPtr pkt)
virtual void regStats()
Register statistics for this object.
Tick cyclesToTicks(Cycles c) const
AbstractController(const Params *p)
static uint32_t getNumberOfVirtualNetworks()
The QueuedMasterPort combines two queues, a request queue and a snoop response queue, that both share the same port.
AbstractController * controller
std::map< Addr, MessageBuffer * > m_block_map
Histogram & init(size_type size)
Set the parameters of this histogram.
std::set< MessageBuffer * > MsgBufType
void queueMemoryRead(const MachineID &id, Addr addr, Cycles latency)
std::vector< MessageBuffer * > MsgVecType
void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
T * getPtr()
get a pointer to the data ptr.
bool isBlocked(Addr) const
static bool getWarmupEnabled()
void queueMemoryWrite(const MachineID &id, Addr addr, Cycles latency, const DataBlock &block)
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...
std::string csprintf(const char *format, const Args &...args)
Callback class used for collating statistics from all the controller of this type.
virtual void resetStats()=0
Reset statistics associated with this object.
bool checkFunctional(PacketPtr pkt)
Check the list of buffered packets against the supplied functional request.
std::vector< Stats::Histogram * > m_delayVCHistogram
const RequestPtr req
A pointer to the original request.
int functionalMemoryWrite(PacketPtr)
Addr getOffset(Addr addr)
void profileMsgDelay(uint32_t virtualNetwork, Cycles delay)
Profiles the delay associated with messages.
Stats::Scalar m_fully_busy_cycles
Counter for the number of cycles when the transitions carried out were equal to the maximum allowed...
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
void reset()
Reset stat value to default.
unsigned int m_cur_in_port
void registerDumpCallback(Callback *cb)
Register a callback that should be called whenever statistics are about to be dumped.
void blockOnQueue(Addr, MessageBuffer *)
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
const uint8_t * getData(int offset, int len) const
virtual const std::string name() const
MemoryPort(const std::string &_name, AbstractController *_controller, const std::string &_label)
void schedTimingReq(PacketPtr pkt, Tick when)
Schedule the sending of a timing request.
void wakeUpBuffers(Addr addr)
const Params * params() const
SenderState * senderState
This packet's sender state.
The MemObject class extends the ClockedObject with accessor functions to get its master and slave por...
A BaseMasterPort is a protocol-agnostic master port, responsible only for the structural connection t...
void queueMemoryWritePartial(const MachineID &id, Addr addr, Cycles latency, const DataBlock &block, int size)
static PacketPtr createRead(const RequestPtr req)
Constructor-like methods that return Packets based on Request objects.
void stallBuffer(MessageBuffer *buf, Addr addr)
void dataDynamic(T *p)
Set the data pointer to a value that should have delete [] called on it.
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...
const MasterID m_masterId
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
void functionalMemoryRead(PacketPtr)
static PacketPtr createWrite(const RequestPtr req)
const FlagsType nozero
Don't print if this is zero.
static uint32_t getBlockSizeBytes()
void enqueue(MsgPtr message, Tick curTime, Tick delta)
void regStats() override
Register statistics for this object.
void sample(const U &v, int n=1)
Add a value to the distribtion n times.
Stats::Histogram m_delayHistogram
Histogram for profiling delay for the messages this controller cares for.
void sendFunctional(PacketPtr pkt)
Send a functional request packet, where the data is instantly updated everywhere in the memory system...
BaseMasterPort & getMasterPort(const std::string &if_name, PortID idx=InvalidPortID)
A function used to return the port associated with this bus object.