virtual std::string getDescription() = 0;
// Called from the directory:
- virtual void enqueue(const MsgPtr& message, int latency ) = 0;
+ virtual void enqueue(const MsgPtr& message, Cycles latency) = 0;
virtual void enqueueMemRef(MemoryNode& memRef) = 0;
virtual void dequeue() = 0;
virtual const Message* peek() = 0;
#include <iostream>
-#include "mem/protocol/MemoryRequestType.hh"
-#include "mem/ruby/common/Global.hh"
#include "mem/ruby/common/TypeDefines.hh"
#include "mem/ruby/slicc_interface/Message.hh"
{
public:
// old constructor
- MemoryNode(const Time& time, int counter, const MsgPtr& msgptr,
+ MemoryNode(const Cycles& time, int counter, const MsgPtr& msgptr,
const physical_address_t addr, const bool is_mem_read)
+ : m_time(time)
{
- m_time = time;
m_msg_counter = counter;
m_msgptr = msgptr;
m_addr = addr;
}
// new constructor
- MemoryNode(const Time& time, const MsgPtr& msgptr,
+ MemoryNode(const Cycles& time, const MsgPtr& msgptr,
const physical_address_t addr, const bool is_mem_read,
const bool is_dirty_wb)
+ : m_time(time)
{
- m_time = time;
m_msg_counter = 0;
m_msgptr = msgptr;
m_addr = addr;
void print(std::ostream& out) const;
- Time m_time;
+ Cycles m_time;
int m_msg_counter;
MsgPtr m_msgptr;
physical_address_t m_addr;
// enqueue new request from directory
void
-RubyMemoryControl::enqueue(const MsgPtr& message, int latency)
+RubyMemoryControl::enqueue(const MsgPtr& message, Cycles latency)
{
- Time current_time = g_system_ptr->getTime();
- Time arrival_time = current_time + latency;
+ Cycles arrival_time = g_system_ptr->getTime() + latency;
const MemoryMsg* memMess = safe_cast<const MemoryMsg*>(message.get());
physical_address_t addr = memMess->getAddress().getAddress();
MemoryRequestType type = memMess->getType();
void
RubyMemoryControl::enqueueToDirectory(MemoryNode req, Cycles latency)
{
- Time arrival_time = curTick() + (latency * clock);
+ Tick arrival_time = clockEdge(latency);
Cycles ruby_arrival_time = g_system_ptr->ticksToCycles(arrival_time);
req.m_time = ruby_arrival_time;
m_response_queue.push_back(req);
DPRINTF(RubyMemory, "Enqueueing msg %#08x %c back to directory at %15d\n",
- req.m_addr, req.m_is_mem_read ? 'R':'W',
- arrival_time);
+ req.m_addr, req.m_is_mem_read ? 'R':'W', arrival_time);
// schedule the wake up
m_consumer_ptr->scheduleEventAbsolute(ruby_arrival_time);
std::string getDescription() { return m_description; };
// Called from the directory:
- void enqueue(const MsgPtr& message, int latency );
+ void enqueue(const MsgPtr& message, Cycles latency);
void enqueueMemRef(MemoryNode& memRef);
void dequeue();
const Message* peek();