29#ifndef __LEARNING_GEM5_PART2_SIMPLE_MEMOBJ_HH__
30#define __LEARNING_GEM5_PART2_SIMPLE_MEMOBJ_HH__
33#include "params/SimpleMemobj.hh"
104 {
panic(
"recvAtomic unimpl."); }
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Ports are used to interface objects to each other.
const std::string name() const
Return port name (for DPRINTF).
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
A ResponsePort is a specialization of a port.
Abstract superclass for simulation objects.
Port on the CPU-side that receives requests.
PacketPtr blockedPacket
If we tried to send a packet and it was blocked, store it here.
SimpleMemobj * owner
The object that owns this object (SimpleMemobj)
bool recvTimingReq(PacketPtr pkt) override
Receive a timing request from the request port.
void recvFunctional(PacketPtr pkt) override
Receive a functional request packet from the request port.
CPUSidePort(const std::string &name, SimpleMemobj *owner)
Constructor.
AddrRangeList getAddrRanges() const override
Get a list of the non-overlapping address ranges the owner is responsible for.
void recvRespRetry() override
Called by the request port if sendTimingResp was called on this response port (causing recvTimingResp...
void trySendRetry()
Send a retry to the peer port only if it is needed.
void sendPacket(PacketPtr pkt)
Send a packet across this port.
Tick recvAtomic(PacketPtr pkt) override
Receive an atomic request packet from the request port.
bool needRetry
True if the port needs to send a retry req.
Port on the memory-side that receives responses.
void recvRangeChange() override
Called to receive an address range change from the peer responder port.
PacketPtr blockedPacket
If we tried to send a packet and it was blocked, store it here.
MemSidePort(const std::string &name, SimpleMemobj *owner)
Constructor.
SimpleMemobj * owner
The object that owns this object (SimpleMemobj)
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the response port.
void recvReqRetry() override
Called by the response port if sendTimingReq was called on this request port (causing recvTimingReq t...
void sendPacket(PacketPtr pkt)
Send a packet across this port.
A very simple memory object.
bool handleResponse(PacketPtr pkt)
Handle the respone from the memory side.
MemSidePort memPort
Instantiation of the memory-side port.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
bool handleRequest(PacketPtr pkt)
Handle the request from the CPU side.
CPUSidePort instPort
Instantiation of the CPU-side ports.
AddrRangeList getAddrRanges() const
Return the address ranges this memobj is responsible for.
bool blocked
True if this is currently blocked waiting for a response.
SimpleMemobj(const SimpleMemobjParams ¶ms)
constructor
void handleFunctional(PacketPtr pkt)
Handle a packet functionally.
void sendRangeChange()
Tell the CPU side to ask for our memory ranges.
#define panic(...)
This implements a cprintf based panic() function.
const Params & params() const
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
const PortID InvalidPortID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
uint64_t Tick
Tick count type.