Go to the documentation of this file.
41 #ifndef __MEM_RUBY_SLICC_INTERFACE_ABSTRACTCONTROLLER_HH__
42 #define __MEM_RUBY_SLICC_INTERFACE_ABSTRACTCONTROLLER_HH__
47 #include <unordered_map>
60 #include "mem/ruby/protocol/AccessPermission.hh"
62 #include "params/RubyController.hh"
79 virtual const char*
what()
const throw()
80 {
return "Port rejected message based on type"; }
114 virtual void print(std::ostream & out)
const = 0;
115 virtual void wakeup() = 0;
135 {
panic(
"functionalRead(Addr,PacketPtr) not implemented"); }
142 {
panic(
"functionalRead(Addr,PacketPtr,WriteMask) not implemented"); }
153 {
fatal(
"Prefetches not implemented!");}
158 const RubyRequestType&
type,
161 const bool& was_miss)
168 {
fatal(
"collateStats() should be overridden!");}
193 if (range.contains(
addr))
return true;
224 MachineType mtype = MachineType_NUM)
const;
260 template<
typename EventType,
typename StateType>
262 EventType
type, StateType initialState,
bool retried,
263 bool isAddressed=
true)
267 assert(m_inTrans.find(
addr) == m_inTrans.end());
283 template<
typename StateType>
285 bool isAddressed=
true)
289 auto iter = m_inTrans.find(
addr);
290 assert(iter != m_inTrans.end());
293 [(unsigned)finalState]->sample(
296 m_inTrans.erase(iter);
310 template<
typename EventType>
312 bool isAddressed=
true)
316 assert(m_outTrans.find(
addr) == m_outTrans.end());
331 bool isAddressed=
true)
335 auto iter = m_outTrans.find(
addr);
336 assert(iter != m_outTrans.end());
341 m_outTrans.erase(iter);
418 std::unordered_map<MachineType, AddrRangeMap<MachineID, 3>>
459 #endif // __MEM_RUBY_SLICC_INTERFACE_ABSTRACTCONTROLLER_HH__
This is a simple scalar statistic, like a counter.
Tick curTick()
The universal simulation clock.
#define fatal(...)
This implements a cprintf based fatal() function.
MachineType getType() const
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
std::set< MessageBuffer * > MsgBufType
NodeID getVersion() const
void outgoingTransactionEnd(Addr addr, bool retried, bool isAddressed=true)
Profiles the end of an outgoing transaction.
statistics::Scalar fullyBusyCycles
Counter for the number of cycles when the transitions carried out were equal to the maximum allowed.
std::vector< statistics::Histogram * > outTransLatHist
const int m_number_of_TBEs
virtual MessageBuffer * getMemReqQueue() const =0
virtual void recordCacheTrace(int cntrl, CacheRecorder *tr)=0
void profileMsgDelay(uint32_t virtualNetwork, Cycles delay)
Profiles the delay associated with messages.
MachineType getType() const
MachineID getMachineID() const
void profileRequest(const std::string &request)
Profiles original cache requests including PUTs.
SenderState(MachineID _id)
std::vector< std::vector< std::vector< statistics::Histogram * > > > inTransLatHist
virtual GPUCoalescer * getGPUCoalescer() const =0
bool serviceMemoryQueue()
std::map< Addr, MsgVecType * > WaitingBufType
statistics::Histogram & getDelayHist()
void wakeUpBuffers(Addr addr)
virtual void resetStats()=0
Callback to reset stats.
Port that forwards requests and receives responses from the memory controller.
MachineID mapAddressToDownstreamMachine(Addr addr, MachineType mtype=MachineType_NUM) const
Maps an address to the correct dowstream MachineID (i.e.
void dequeueMemRespQueue()
std::map< Addr, MessageBuffer * > m_block_map
std::unordered_map< Addr, TransMapPair > m_inTransUnaddressed
bool isBlocked(Addr) const
std::unordered_map< Addr, TransMapPair > m_outTransAddressed
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
A function used to return the port associated with this bus object.
const PortID InvalidPortID
std::vector< MessageBuffer * > MsgVecType
const NetDest & allUpstreamDest() const
List of upstream destinations (towards the CPU)
void memRespQueueDequeued()
virtual void enqueuePrefetch(const Addr &, const RubyRequestType &)
Function for enqueuing a prefetch request.
virtual void initNetQueues()=0
Initialize the message buffers.
virtual void functionalRead(const Addr &addr, PacketPtr pkt, WriteMask &mask)
constexpr uint64_t mask(unsigned nbits)
Generate a 64-bit mask of 'nbits' 1s, right justified.
statistics::Histogram delayHistogram
Histogram for profiling delay for the messages this controller cares for.
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
Cycles is a wrapper class for representing cycle counts, i.e.
const int m_transitions_per_cycle
statistics::Histogram & getDelayVCHist(uint32_t index)
const AddrRangeList addrRanges
The address range to which the controller responds on the CPU side.
std::vector< statistics::Histogram * > delayVCHistogram
void recvReqRetry()
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
const AddrRangeList & getAddrRanges() const
virtual void collateStats()
Function for collating statistics from all the controllers of this particular type.
void outgoingTransactionStart(Addr addr, EventType type, bool isAddressed=true)
Profiles an event that initiates a transaction in a peer controller (e.g.
int functionalMemoryWrite(PacketPtr)
void incomingTransactionStart(Addr addr, EventType type, StateType initialState, bool retried, bool isAddressed=true)
Profiles an event that initiates a protocol transactions for a specific line (e.g.
void initNetworkPtr(Network *net_ptr)
std::vector< statistics::Scalar * > inTransLatTotal
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
MachineID mapAddressToMachine(Addr addr, MachineType mtype) const
Map an address to the correct MachineID.
std::vector< statistics::Scalar * > outTransLatHistRetries
uint64_t Tick
Tick count type.
std::shared_ptr< Request > RequestPtr
Tick recvAtomic(PacketPtr pkt)
const unsigned int m_buffer_size
virtual const char * what() const
ControllerStats(statistics::Group *parent)
unsigned int m_cur_in_port
NetDest downstreamDestinations
MemoryPort(const std::string &_name, AbstractController *_controller, PortID id=InvalidPortID)
AbstractController(const Params &p)
MemberEventWrapper<&AbstractController::sendRetryRespToMem > mRetryRespEvent
A virtual base opaque structure used to hold state associated with the packet (e.g....
virtual void notifyCoalesced(const Addr &addr, const RubyRequestType &type, const RequestPtr &req, const DataBlock &data_blk, const bool &was_miss)
Notifies controller of a request coalesced at the sequencer.
std::unordered_map< MachineType, AddrRangeMap< MachineID, 3 > > downstreamAddrMap
bool m_mem_ctrl_waiting_retry
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void incomingTransactionEnd(Addr addr, StateType finalState, bool isAddressed=true)
Profiles an event that ends a transaction.
WaitingBufType m_waiting_buffers
bool recvTimingResp(PacketPtr pkt)
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
gem5::ruby::AbstractController::ControllerStats stats
virtual Cycles mandatoryQueueLatency(const RubyRequestType ¶m_type)
std::unordered_map< Addr, TransMapPair > m_outTransUnaddressed
RequestorID getRequestorId() const
virtual bool functionalReadBuffers(PacketPtr &)=0
These functions are used by ruby system to read/write the data blocks that exist with in the controll...
virtual int functionalWriteBuffers(PacketPtr &)=0
The return value indicates the number of messages written with the data from the packet.
Ports are used to interface objects to each other.
bool recvTimingResp(PacketPtr pkt)
Receive a timing response from the peer.
void functionalMemoryRead(PacketPtr)
virtual DMASequencer * getDMASequencer() const =0
std::vector< statistics::Scalar * > inTransLatRetries
NetDest upstreamDestinations
const Cycles m_mandatory_queue_latency
void sendRetryRespToMem()
virtual void print(std::ostream &out) const =0
virtual void regStats()
Callback to set stat parameters.
AbstractController * controller
ClockedObjectParams Params
Parameters of ClockedObject.
virtual int functionalWrite(const Addr &addr, PacketPtr)=0
Cycles ticksToCycles(Tick t) const
virtual AccessPermission getAccessPermission(const Addr &addr)=0
virtual MessageBuffer * getMandatoryQueue() const =0
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
virtual MessageBuffer * getMemRespQueue() const =0
std::unordered_map< Addr, TransMapPair > m_inTransAddressed
void blockOnQueue(Addr, MessageBuffer *)
virtual void functionalRead(const Addr &addr, PacketPtr)
bool respondsTo(Addr addr)
void wakeUpBuffer(MessageBuffer *buf, Addr addr)
const NetDest & allDownstreamDest() const
List of downstream destinations (towards memory)
#define panic(...)
This implements a cprintf based panic() function.
void stallBuffer(MessageBuffer *buf, Addr addr)
virtual Sequencer * getCPUSequencer() const =0
Generated on Sun Jul 30 2023 01:56:59 for gem5 by doxygen 1.8.17