2c2
< * Copyright (c) 2009 Mark D. Hill and David A. Wood
---
> * Copyright (c) 2009-2014 Mark D. Hill and David A. Wood
45a46
> #include "mem/qport.hh"
47c48
< #include "sim/clocked_object.hh"
---
> #include "mem/mem_object.hh"
51c52
< class AbstractController : public ClockedObject, public Consumer
---
> class AbstractController : public MemObject, public Consumer
81a83
> void functionalMemoryRead(PacketPtr);
84c86
< virtual uint32_t functionalWriteBuffers(PacketPtr&) = 0;
---
> virtual int functionalWriteBuffers(PacketPtr&) = 0;
85a88
> int functionalMemoryWrite(PacketPtr);
99a103,113
> /** A function used to return the port associated with this bus object. */
> BaseMasterPort& getMasterPort(const std::string& if_name,
> PortID idx = InvalidPortID);
>
> void queueMemoryRead(const MachineID &id, Address addr, Cycles latency);
> void queueMemoryWrite(const MachineID &id, Address addr, Cycles latency,
> const DataBlock &block);
> void queueMemoryWritePartial(const MachineID &id, Address addr, Cycles latency,
> const DataBlock &block, int size);
> void recvTimingResp(PacketPtr pkt);
>
122a137,139
> // MasterID used by some components of gem5.
> MasterID m_masterId;
>
158a176,215
>
> /**
> * Port that forwards requests and receives responses from the
> * memory controller. It has a queue of packets not yet sent.
> */
> class MemoryPort : public QueuedMasterPort
> {
> private:
> // Packet queue used to store outgoing requests and responses.
> MasterPacketQueue _queue;
>
> // Controller that operates this port.
> AbstractController *controller;
>
> public:
> MemoryPort(const std::string &_name, AbstractController *_controller,
> const std::string &_label);
>
> // 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);
> };
>
> /* Master port to the memory controller. */
> MemoryPort memoryPort;
>
> // Message Buffer for storing the response received from the
> // memory controller.
> MessageBuffer *m_responseFromMemory_ptr;
>
> // State that is stored in packets sent to the memory controller.
> struct SenderState : public Packet::SenderState
> {
> // Id of the machine from which the request originated.
> MachineID id;
>
> SenderState(MachineID _id) : id(_id)
> {}
> };