59#ifndef __SYSTEMC_TLM_BRIDGE_GEM5_TO_TLM_HH__
60#define __SYSTEMC_TLM_BRIDGE_GEM5_TO_TLM_HH__
64#include <unordered_map>
68#include "params/Gem5ToTlmBridgeBase.hh"
92template <
unsigned int BITWIDTH>
104 return bridge.getAddrRanges();
109 return bridge.recvAtomic(pkt);
115 return bridge.recvAtomicBackdoor(pkt, backdoor);
120 return bridge.recvFunctional(pkt);
126 bridge.recvMemBackdoorReq(req, backdoor);
131 return bridge.recvTimingReq(pkt);
136 return bridge.tryTiming(pkt);
141 return bridge.recvTimingSnoopResp(pkt);
181 std::unordered_map<tlm::tlm_generic_payload *, gem5::PacketPtr>
packetMap;
215 typedef gem5::Gem5ToTlmBridgeBaseParams
Params;
The AddrRangeMap uses an STL map to implement an interval tree for address decoding.
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.
A ResponsePort is a specialization of a port.
ResponsePort(const std::string &name, SimObject *_owner, PortID id=InvalidPortID)
Response port.
bool recvTimingSnoopResp(gem5::PacketPtr pkt) override
Receive a timing snoop response from the peer.
gem5::Tick recvAtomic(gem5::PacketPtr pkt) override
Receive an atomic request packet from the peer.
void recvMemBackdoorReq(const gem5::MemBackdoorReq &req, gem5::MemBackdoorPtr &backdoor) override
Receive a request for a back door to a range of memory.
gem5::AddrRangeList getAddrRanges() const override
Get a list of the non-overlapping address ranges the owner is responsible for.
Gem5ToTlmBridge< BITWIDTH > & bridge
bool recvTimingReq(gem5::PacketPtr pkt) override
Receive a timing request from the peer.
bool tryTiming(gem5::PacketPtr pkt) override
Availability request from the peer.
gem5::Tick recvAtomicBackdoor(gem5::PacketPtr pkt, gem5::MemBackdoorPtr &backdoor) override
Receive an atomic request packet from the peer, and optionally provide a backdoor to the data being a...
void recvFunctional(gem5::PacketPtr pkt) override
Receive a functional request packet from the peer.
void recvRespRetry() override
Called by the peer if sendTimingResp was called on this protocol (causing recvTimingResp to be called...
BridgeResponsePort(const std::string &name_, Gem5ToTlmBridge< BITWIDTH > &bridge_)
bool needToSendRequestRetry
Did another gem5 request arrive while currently blocked? This variable is needed when a retry should ...
std::unordered_map< tlm::tlm_generic_payload *, gem5::PacketPtr > packetMap
A map to record the association between payload and packet.
void before_end_of_elaboration() override
void invalidate_direct_mem_ptr(sc_dt::uint64 start_range, sc_dt::uint64 end_range)
void pec(tlm::tlm_generic_payload &trans, const tlm::tlm_phase &phase)
tlm::tlm_generic_payload * blockingRequest
A transaction after BEGIN_REQ has been sent but before END_REQ, which is blocking the request channel...
void recvMemBackdoorReq(const gem5::MemBackdoorReq &req, gem5::MemBackdoorPtr &backdoor)
gem5::AddrRangeList addrRanges
tlm::tlm_sync_enum nb_transport_bw(tlm::tlm_generic_payload &trans, tlm::tlm_phase &phase, sc_core::sc_time &t)
tlm_utils::simple_initiator_socket< Gem5ToTlmBridge< BITWIDTH >, BITWIDTH > & getSocket()
gem5::MemBackdoorPtr getBackdoor(tlm::tlm_generic_payload &trans)
gem5::Gem5ToTlmBridgeBaseParams Params
tlm_utils::simple_initiator_socket< Gem5ToTlmBridge< BITWIDTH >, BITWIDTH > socket
Gem5ToTlmBridge(const Params &p, const sc_core::sc_module_name &mn)
gem5::AddrRangeMap< gem5::MemBackdoorPtr > backdoorMap
void recvFunctionalSnoop(gem5::PacketPtr packet)
gem5::AddrRangeList getAddrRanges() const
gem5::Tick recvAtomic(gem5::PacketPtr packet)
gem5::Tick recvAtomicBackdoor(gem5::PacketPtr pkt, gem5::MemBackdoorPtr &backdoor)
bool tryTiming(gem5::PacketPtr packet)
bool recvTimingSnoopResp(gem5::PacketPtr packet)
gem5::Port & gem5_getPort(const std::string &if_name, int idx=-1) override
bool recvTimingReq(gem5::PacketPtr packet)
sc_gem5::TlmInitiatorWrapper< BITWIDTH > wrapper
void recvFunctional(gem5::PacketPtr packet)
tlm::tlm_generic_payload * blockingResponse
A response which has been asked to retry by gem5 and so is blocking the response channel.
BridgeResponsePort bridgeResponsePort
uint64_t Tick
Tick count type.
std::function< void(gem5::PacketPtr pkt, tlm::tlm_generic_payload &trans)> PacketToPayloadConversionStep
void addPacketToPayloadConversionStep(PacketToPayloadConversionStep step)
Notify the Gem5ToTlm bridge that we need an extra step to properly convert a gem5 packet to tlm paylo...
tlm::tlm_generic_payload * packet2payload(PacketPtr packet)
Convert a gem5 packet to TLM payload by copying all the relevant information to new payload.