m_transitions_per_cycle(p->transitions_per_cycle),
m_buffer_size(p->buffer_size), m_recycle_latency(p->recycle_latency),
m_mandatory_queue_latency(p->mandatory_queue_latency),
- memoryPort(csprintf("%s.memory", name()), this, ""),
+ memoryPort(csprintf("%s.memory", name()), this),
addrRanges(p->addr_ranges.begin(), p->addr_ranges.end())
{
if (m_version == 0) {
// to make more progress. Make sure it wakes up
scheduleEvent(Cycles(1));
recvTimingResp(pkt);
- } else {
+ } else if (memoryPort.sendTimingReq(pkt)) {
mem_queue->dequeue(clockEdge());
- memoryPort.schedTimingReq(pkt, clockEdge());
// Since the queue was popped the controller may be able
// to make more progress. Make sure it wakes up
scheduleEvent(Cycles(1));
+ } else {
+ scheduleEvent(Cycles(1));
+ delete pkt;
+ delete s;
}
return true;
{
int num_functional_writes = 0;
- // Check the buffer from the controller to the memory.
- if (memoryPort.trySatisfyFunctional(pkt)) {
- num_functional_writes++;
- }
-
// Update memory itself.
memoryPort.sendFunctional(pkt);
return num_functional_writes + 1;
return true;
}
+void
+AbstractController::MemoryPort::recvReqRetry()
+{
+ controller->serviceMemoryQueue();
+}
+
AbstractController::MemoryPort::MemoryPort(const std::string &_name,
AbstractController *_controller,
- const std::string &_label)
- : QueuedMasterPort(_name, _controller, reqQueue, snoopRespQueue),
- reqQueue(*_controller, *this, _label),
- snoopRespQueue(*_controller, *this, false, _label),
- controller(_controller)
+ PortID id)
+ : MasterPort(_name, _controller, id), controller(_controller)
{
}
/**
* Port that forwards requests and receives responses from the
- * memory controller. It has a queue of packets not yet sent.
+ * memory controller.
*/
- class MemoryPort : public QueuedMasterPort
+ class MemoryPort : public MasterPort
{
private:
- // Packet queues used to store outgoing requests and snoop responses.
- ReqPacketQueue reqQueue;
- SnoopRespPacketQueue snoopRespQueue;
-
// Controller that operates this port.
AbstractController *controller;
public:
MemoryPort(const std::string &_name, AbstractController *_controller,
- const std::string &_label);
+ PortID id = InvalidPortID);
+ protected:
// Function for receiving a timing response from the peer port.
// Currently the pkt is handed to the coherence controller
// associated with this port.
bool recvTimingResp(PacketPtr pkt);
+
+ void recvReqRetry();
};
/* Master port to the memory controller. */