Go to the documentation of this file.
62 #include "params/TlmToGem5Bridge32.hh"
63 #include "params/TlmToGem5Bridge64.hh"
64 #include "params/TlmToGem5Bridge128.hh"
65 #include "params/TlmToGem5Bridge256.hh"
66 #include "params/TlmToGem5Bridge512.hh"
95 extraPayloadToPacketSteps.push_back(std::move(step));
114 req = std::make_shared<Request>(
116 0, 0, std::move(amo_op));
130 "received transaction with unsupported "
134 req = std::make_shared<Request>(
143 auto pkt =
new Packet(req, cmd);
147 for (
auto &step : extraPayloadToPacketSteps) {
154 template <
unsigned int BITWIDTH>
161 auto status = socket->nb_transport_bw(trans, phase, delay);
163 "Unexpected status after sending END_REQ");
166 template <
unsigned int BITWIDTH>
175 auto status = socket->nb_transport_bw(trans, phase, delay);
180 responseInProgress =
false;
183 responseInProgress =
true;
185 panic(
"Unexpected status after sending BEGIN_RESP");
189 template <
unsigned int BITWIDTH>
207 if (extension !=
nullptr) {
219 if (bmp.sendTimingReq(pkt)) {
221 if (!needsResponse) {
223 sendBeginResp(trans, delay);
228 pendingRequest = &trans;
233 template <
unsigned int BITWIDTH>
239 responseInProgress =
false;
241 checkTransaction(trans);
243 if (needToSendRetry) {
245 needToSendRetry =
false;
249 template <
unsigned int BITWIDTH>
256 template <
unsigned int BITWIDTH>
261 std::stringstream
ss;
262 ss <<
"Transaction returned with error, response status = "
268 template <
unsigned int BITWIDTH>
272 socket->invalidate_direct_mem_ptr(
276 template <
unsigned int BITWIDTH>
283 handleBeginReq(trans);
286 handleEndResp(trans);
289 panic(
"unimplemented phase in callback");
293 template <
unsigned int BITWIDTH>
304 if (byteEnable != 0) {
315 peq.notify(trans, phase, delay);
319 template <
unsigned int BITWIDTH>
331 if (extension !=
nullptr) {
338 Tick ticks = bmp.sendAtomicBackdoor(pkt, backdoor);
344 "Packet sending failed!\n");
353 if (extension ==
nullptr)
359 template <
unsigned int BITWIDTH>
368 if (extension !=
nullptr) {
369 bmp.sendFunctional(extension->
getPacket());
373 bmp.sendFunctional(pkt);
381 template <
unsigned int BITWIDTH>
393 if (extension !=
nullptr) {
401 bmp.sendAtomicBackdoor(pkt, backdoor);
419 invalidateDmi(backdoor);
424 if (extension ==
nullptr)
429 return backdoor !=
nullptr;
432 template <
unsigned int BITWIDTH>
438 if (responseInProgress) {
440 needToSendRetry =
true;
459 auto &trans = tlmSenderState->trans;
462 trans.get_extension(extension);
465 delete tlmSenderState;
469 if (extension ==
nullptr)
472 sendBeginResp(trans, delay);
478 template <
unsigned int BITWIDTH>
488 bool needsResponse = pendingPacket->needsResponse();
489 if (bmp.sendTimingReq(pendingPacket)) {
490 waitForRetry =
false;
491 pendingPacket =
nullptr;
493 auto &trans = *pendingRequest;
495 if (!needsResponse) {
497 sendBeginResp(trans, delay);
501 pendingRequest =
nullptr;
505 template <
unsigned int BITWIDTH>
510 "received address range change but ignored it");
513 template <
unsigned int BITWIDTH>
517 if (if_name ==
"gem5")
519 else if (if_name ==
"tlm")
525 template <
unsigned int BITWIDTH>
529 waitForRetry(false), pendingRequest(nullptr), pendingPacket(nullptr),
530 needToSendRetry(false), responseInProgress(false),
531 bmp(
std::string(
name()) +
"master", *this), socket(
"tlm_socket"),
534 _id(params.
system->getGlobalRequestorId(
535 std::string(
"[systemc].") +
name()))
539 template <
unsigned int BITWIDTH>
551 if (
system->isTimingMode()) {
552 SC_REPORT_INFO(
"TlmToGem5Bridge",
"register non-blocking interface");
553 socket.register_nb_transport_fw(
555 }
else if (
system->isAtomicMode()) {
557 socket.register_b_transport(
559 socket.register_get_direct_mem_ptr(
562 panic(
"gem5 operates neither in Timing nor in Atomic mode");
565 socket.register_transport_dbg(
574 gem5::TlmToGem5Bridge32Params::create()
const
581 gem5::TlmToGem5Bridge64Params::create()
const
588 gem5::TlmToGem5Bridge128Params::create()
const
595 gem5::TlmToGem5Bridge256Params::create()
const
602 gem5::TlmToGem5Bridge512Params::create()
const
static sc_time from_value(sc_dt::uint64)
PacketPtr payload2packet(RequestorID _id, tlm::tlm_generic_payload &trans)
Addr start() const
Get the start address of the range.
virtual AtomicOpFunctor * clone()=0
void pushSenderState(SenderState *sender_state)
Push a new sender state to the packet and make the current sender state the predecessor of the new on...
RequestPtr req
A pointer to the original request.
unsigned int get_streaming_width() const
@ TLM_BYTE_ENABLE_ERROR_RESPONSE
const sc_time SC_ZERO_TIME
#define SC_REPORT_FATAL(msg_type, msg)
gem5::PacketPtr getPacket()
void addInvalidationCallback(CbFunction func)
const PortID InvalidPortID
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
void set_dmi_allowed(bool dmi_allowed)
std::string get_response_string() const
uint32_t payloadDelay
The extra pipelining delay from seeing the packet until the end of payload is transmitted by the comp...
@ TLM_BURST_ERROR_RESPONSE
void set_end_address(sc_dt::uint64 addr)
tlm_command get_command() const
unsigned char * get_byte_enable_ptr() const
#define SC_REPORT_ERROR(msg_type, msg)
unsigned int get_data_length() const
void before_end_of_elaboration() override
@ ATOMIC_NO_RETURN_OP
The request is an atomic that does not return data.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
ProbePointArg< PacketInfo > Packet
Packet probe point.
uint64_t Tick
Tick count type.
std::shared_ptr< Request > RequestPtr
@ NO_ACCESS
The request should not cause a memory access.
@ ATOMIC_RETURN_OP
The request is an atomic that returns data.
Addr end() const
Get the end address of the range.
void get_extension(T *&ext) const
bool needsResponse() const
const std::string & name()
#define SC_REPORT_INFO(msg_type, msg)
void addPayloadToPacketConversionStep(PayloadToPacketConversionStep step)
Notify the Tlm2Gem5 bridge that we need an extra step to properly convert a tlm payload to gem5 packe...
gem5::TlmToGem5BridgeBaseParams Params
SenderState * popSenderState()
Pop the top of the state stack and return a pointer to it.
#define SC_REPORT_WARNING(msg_type, msg)
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
std::function< void(gem5::PacketPtr pkt, tlm::tlm_generic_payload &trans)> PayloadToPacketConversionStep
Ports are used to interface objects to each other.
Overload hash function for BasicBlockRange type.
const AddrRange & range() const
virtual gem5::Port & gem5_getPort(const std::string &if_name, int idx=-1)
virtual void before_end_of_elaboration()
bool is_response_error() const
void set_dmi_ptr(unsigned char *p)
void set_start_address(sc_dt::uint64 addr)
gem5::AtomicOpFunctor * getAtomicOpFunctor() const
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
sc_dt::uint64 get_address() const
unsigned char * get_data_ptr() const
void set_granted_access(dmi_access_e a)
#define panic(...)
This implements a cprintf based panic() function.
void set_response_status(const tlm_response_status response_status)
Generated on Wed May 4 2022 12:14:12 for gem5 by doxygen 1.8.17