gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
tlm_to_gem5.cc
Go to the documentation of this file.
1 /*
2  * Copyright 2019 Google, Inc.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met: redistributions of source code must retain the above copyright
7  * notice, this list of conditions and the following disclaimer;
8  * redistributions in binary form must reproduce the above copyright
9  * notice, this list of conditions and the following disclaimer in the
10  * documentation and/or other materials provided with the distribution;
11  * neither the name of the copyright holders nor the names of its
12  * contributors may be used to endorse or promote products derived from
13  * this software without specific prior written permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27  * Copyright (c) 2016, Dresden University of Technology (TU Dresden)
28  * All rights reserved.
29  *
30  * Redistribution and use in source and binary forms, with or without
31  * modification, are permitted provided that the following conditions are
32  * met:
33  *
34  * 1. Redistributions of source code must retain the above copyright notice,
35  * this list of conditions and the following disclaimer.
36  *
37  * 2. Redistributions in binary form must reproduce the above copyright
38  * notice, this list of conditions and the following disclaimer in the
39  * documentation and/or other materials provided with the distribution.
40  *
41  * 3. Neither the name of the copyright holder nor the names of its
42  * contributors may be used to endorse or promote products derived from
43  * this software without specific prior written permission.
44  *
45  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
46  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
47  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
48  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
49  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
50  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
51  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
52  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
53  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
54  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
55  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56  */
57 
59 
60 #include <utility>
61 
62 #include "base/trace.hh"
63 #include "debug/TlmBridge.hh"
64 #include "params/TlmToGem5Bridge128.hh"
65 #include "params/TlmToGem5Bridge256.hh"
66 #include "params/TlmToGem5Bridge32.hh"
67 #include "params/TlmToGem5Bridge512.hh"
68 #include "params/TlmToGem5Bridge64.hh"
69 #include "sim/core.hh"
70 #include "sim/system.hh"
73 
74 using namespace gem5;
75 
76 namespace sc_gem5
77 {
78 
79 namespace
80 {
84 std::vector<PayloadToPacketConversionStep> extraPayloadToPacketSteps;
85 } // namespace
86 
95 void
97 {
98  extraPayloadToPacketSteps.push_back(std::move(step));
99 }
100 
110 {
111  Gem5SystemC::Gem5Extension *extension = nullptr;
112  trans.get_extension(extension);
113 
114  // If there is an extension, this transaction was initiated by the gem5
115  // world and we can pipe through the original packet. Otherwise, we
116  // generate a new packet based on the transaction.
117  if (extension != nullptr) {
118  auto pkt = extension->getPacket();
119  // Sync the address which could have changed.
120  pkt->setAddr(trans.get_address());
121  // Apply all conversion steps necessary in this specific setup.
122  for (auto &step : extraPayloadToPacketSteps) {
123  step(pkt, trans);
124  }
125  return std::make_pair(pkt, false);
126  }
127 
128  MemCmd cmd;
129  RequestPtr req;
130 
131  Gem5SystemC::AtomicExtension *atomic_ex = nullptr;
132  trans.get_extension(atomic_ex);
133  if (atomic_ex) {
134  cmd = MemCmd::SwapReq;
135  Request::Flags flags = (atomic_ex->isReturnRequired() ?
139  atomic_ex->getAtomicOpFunctor()->clone());
140  // FIXME: correct the context_id and pc state.
141  req = std::make_shared<Request>(
142  trans.get_address(), trans.get_data_length(), flags, _id,
143  0, 0, std::move(amo_op));
144  req->setPaddr(trans.get_address());
145  } else {
146  switch (trans.get_command()) {
148  cmd = MemCmd::ReadReq;
149  break;
151  cmd = MemCmd::WriteReq;
152  break;
154  return std::make_pair(nullptr, false);
155  default:
156  SC_REPORT_FATAL("TlmToGem5Bridge",
157  "received transaction with unsupported "
158  "command");
159  }
161  req = std::make_shared<Request>(
162  trans.get_address(), trans.get_data_length(), flags, _id);
163  }
164 
165 
166  /*
167  * Allocate a new Packet. The packet will be deleted when it returns from
168  * the gem5 world as a response.
169  */
170  auto pkt = new Packet(req, cmd);
171  pkt->dataStatic(trans.get_data_ptr());
172 
173  // Apply all conversion steps necessary in this specific setup.
174  for (auto &step : extraPayloadToPacketSteps) {
175  step(pkt, trans);
176  }
177 
178  return std::make_pair(pkt, true);
179 }
180 
181 void
183 {
184  if (!pkt->isError()) {
186  } else if (pkt->isRead() || pkt->isWrite()) {
188  } else {
190  }
191 }
192 
193 template <unsigned int BITWIDTH>
194 void
196 {
198  auto delay = sc_core::SC_ZERO_TIME;
199 
200  auto status = socket->nb_transport_bw(trans, phase, delay);
202  "Unexpected status after sending END_REQ");
203 }
204 
205 template <unsigned int BITWIDTH>
206 void
208  sc_core::sc_time &delay)
209 {
211  switch (trans.get_command()) {
214  break;
217  break;
218  default:
219  panic("TlmToGem5Bridge: "
220  "received transaction with unsupported command");
221  }
222  Addr start_addr = trans.get_address();
223  Addr length = trans.get_data_length();
224 
225  MemBackdoorReq req({start_addr, start_addr + length}, flags);
226  MemBackdoorPtr backdoor = nullptr;
227 
228  bmp.sendMemBackdoorReq(req, backdoor);
229 
230  if (backdoor)
231  trans.set_dmi_allowed(true);
232 
234 
235  auto status = socket->nb_transport_bw(trans, phase, delay);
236 
237  if (status == tlm::TLM_COMPLETED ||
238  (status == tlm::TLM_UPDATED && phase == tlm::END_RESP)) {
239  // transaction completed -> no need to wait for tlm::END_RESP
240  responseInProgress = false;
241  } else if (status == tlm::TLM_ACCEPTED) {
242  // we need to wait for tlm::END_RESP
243  responseInProgress = true;
244  } else {
245  panic("Unexpected status after sending BEGIN_RESP");
246  }
247 }
248 
249 template <unsigned int BITWIDTH>
250 void
252 {
253  sc_assert(!waitForRetry);
254  sc_assert(pendingRequest == nullptr);
255  sc_assert(pendingPacket == nullptr);
256 
257  trans.acquire();
258 
259  auto res = payload2packet(_id, trans);
260  auto pkt = res.first;
261  pkt->pushSenderState(new Gem5SystemC::TlmSenderState(trans));
262 
263  // If the packet doesn't need a response, we should send BEGIN_RESP by
264  // ourselves.
265  bool needsResponse = pkt->needsResponse();
266  if (bmp.sendTimingReq(pkt)) { // port is free -> send END_REQ immediately
267  sendEndReq(trans);
268  if (!needsResponse) {
269  auto delay = sc_core::SC_ZERO_TIME;
270  setPayloadResponse(trans, pkt);
271  sendBeginResp(trans, delay);
272  }
273  trans.release();
274  } else { // port is blocked -> wait for retry before sending END_REQ
275  waitForRetry = true;
276  pendingRequest = &trans;
277  pendingPacket = pkt;
278  }
279 }
280 
281 template <unsigned int BITWIDTH>
282 void
284 {
285  sc_assert(responseInProgress);
286 
287  responseInProgress = false;
288 
289  if (needToSendRetry) {
290  bmp.sendRetryResp();
291  needToSendRetry = false;
292  }
293 }
294 
295 template <unsigned int BITWIDTH>
296 void
298 {
299  delete pkt;
300 }
301 
302 template <unsigned int BITWIDTH>
303 void
305 {
306  socket->invalidate_direct_mem_ptr(
307  backdoor.range().start(), backdoor.range().end());
308  requestedBackdoors.erase(const_cast<gem5::MemBackdoorPtr>(&backdoor));
309 }
310 
311 template <unsigned int BITWIDTH>
312 void
314  const tlm::tlm_phase &phase)
315 {
316  switch (phase) {
317  case tlm::BEGIN_REQ:
318  handleBeginReq(trans);
319  break;
320  case tlm::END_RESP:
321  handleEndResp(trans);
322  break;
323  default:
324  panic("unimplemented phase in callback");
325  }
326 }
327 
328 template <unsigned int BITWIDTH>
332  sc_core::sc_time &delay)
333 {
334  unsigned len = trans.get_data_length();
335  unsigned char *byteEnable = trans.get_byte_enable_ptr();
336  unsigned width = trans.get_streaming_width();
337 
338  // check the transaction attributes for unsupported features ...
339  if (byteEnable != 0) {
341  return tlm::TLM_COMPLETED;
342  }
343  if (width < len) { // is this a burst request?
345  return tlm::TLM_COMPLETED;
346  }
347 
348  // ... and queue the valid transaction
349  trans.acquire();
350  peq.notify(trans, phase, delay);
351  return tlm::TLM_ACCEPTED;
352 }
353 
354 template <unsigned int BITWIDTH>
355 void
358 {
359  auto [pkt, pkt_created] = payload2packet(_id, trans);
360  pkt->pushSenderState(new Gem5SystemC::TlmSenderState(trans));
361 
362  MemBackdoorPtr backdoor = nullptr;
363  Tick ticks = bmp.sendAtomicBackdoor(pkt, backdoor);
364  if (backdoor)
365  trans.set_dmi_allowed(true);
366 
367  // send an atomic request to gem5
368  panic_if(pkt->needsResponse() && !pkt->isResponse(),
369  "Packet sending failed!\n");
370 
371  auto delay =
372  sc_core::sc_time((double)(ticks / sim_clock::as_int::ps),
374 
375  // update time
376  t += delay;
377 
378  gem5::Packet::SenderState *senderState = pkt->popSenderState();
379  sc_assert(
380  nullptr != dynamic_cast<Gem5SystemC::TlmSenderState*>(senderState));
381 
382  // clean up
383  delete senderState;
384 
385  setPayloadResponse(trans, pkt);
386 
387  if (pkt_created)
388  destroyPacket(pkt);
389 }
390 
391 template <unsigned int BITWIDTH>
392 unsigned int
394 {
395  auto [pkt, pkt_created] = payload2packet(_id, trans);
396  if (pkt != nullptr) {
397  pkt->pushSenderState(new Gem5SystemC::TlmSenderState(trans));
398 
399  bmp.sendFunctional(pkt);
400 
401  gem5::Packet::SenderState *senderState = pkt->popSenderState();
402  sc_assert(
403  nullptr != dynamic_cast<Gem5SystemC::TlmSenderState*>(senderState));
404 
405  // clean up
406  delete senderState;
407 
408  if (pkt_created)
409  destroyPacket(pkt);
410  }
411 
412  return trans.get_data_length();
413 }
414 
415 template <unsigned int BITWIDTH>
416 bool
418  tlm::tlm_dmi &dmi_data)
419 {
421  switch (trans.get_command()) {
424  break;
427  break;
428  default:
429  panic("TlmToGem5Bridge: "
430  "received transaction with unsupported command");
431  }
432  Addr start_addr = trans.get_address();
433  Addr length = trans.get_data_length();
434 
435  MemBackdoorReq req({start_addr, start_addr + length}, flags);
436  MemBackdoorPtr backdoor = nullptr;
437 
438  bmp.sendMemBackdoorReq(req, backdoor);
439 
440  if (backdoor) {
441  trans.set_dmi_allowed(true);
442  dmi_data.set_dmi_ptr(backdoor->ptr());
443  dmi_data.set_start_address(backdoor->range().start());
444  dmi_data.set_end_address(backdoor->range().end());
445 
446  typedef tlm::tlm_dmi::dmi_access_e access_t;
447  access_t access = tlm::tlm_dmi::DMI_ACCESS_NONE;
448  if (backdoor->readable())
449  access = (access_t)(access | tlm::tlm_dmi::DMI_ACCESS_READ);
450  if (backdoor->writeable())
451  access = (access_t)(access | tlm::tlm_dmi::DMI_ACCESS_WRITE);
452  dmi_data.set_granted_access(access);
453 
454  // We only need to register the callback at the first time.
455  if (requestedBackdoors.find(backdoor) == requestedBackdoors.end()) {
456  backdoor->addInvalidationCallback(
457  [this](const MemBackdoor &backdoor)
458  {
459  invalidateDmi(backdoor);
460  }
461  );
462  requestedBackdoors.emplace(backdoor);
463  }
464  }
465 
467 
468  return backdoor != nullptr;
469 }
470 
471 template <unsigned int BITWIDTH>
472 bool
474 {
475  // exclusion rule
476  // We need to Wait for END_RESP before sending next BEGIN_RESP
477  if (responseInProgress) {
478  sc_assert(!needToSendRetry);
479  needToSendRetry = true;
480  return false;
481  }
482 
483  sc_assert(pkt->isResponse());
484 
485  /*
486  * Pay for annotated transport delays.
487  *
488  * See recvTimingReq in sc_slave_port.cc for a detailed description.
489  */
490  auto delay = sc_core::sc_time::from_value(pkt->payloadDelay);
491  // reset the delays
492  pkt->payloadDelay = 0;
493  pkt->headerDelay = 0;
494 
495  auto *tlmSenderState =
496  dynamic_cast<Gem5SystemC::TlmSenderState*>(pkt->popSenderState());
497  sc_assert(tlmSenderState != nullptr);
498 
499  auto &trans = tlmSenderState->trans;
500  setPayloadResponse(trans, pkt);
501  sendBeginResp(trans, delay);
502 
503  Gem5SystemC::Gem5Extension *extension = nullptr;
504  trans.get_extension(extension);
505 
506  // clean up
507  delete tlmSenderState;
508 
509  // If there is an extension the packet was piped through and we must not
510  // delete it. The packet travels back with the transaction.
511  if (extension == nullptr)
512  destroyPacket(pkt);
513 
514  trans.release();
515 
516  return true;
517 }
518 
519 template <unsigned int BITWIDTH>
520 void
522 {
523  sc_assert(waitForRetry);
524  sc_assert(pendingRequest != nullptr);
525  sc_assert(pendingPacket != nullptr);
526 
527  // If the packet doesn't need a response, we should send BEGIN_RESP by
528  // ourselves.
529  bool needsResponse = pendingPacket->needsResponse();
530  if (bmp.sendTimingReq(pendingPacket)) {
531  waitForRetry = false;
532 
533  auto &trans = *pendingRequest;
534  sendEndReq(trans);
535  if (!needsResponse) {
536  auto delay = sc_core::SC_ZERO_TIME;
537  setPayloadResponse(trans, pendingPacket);
538  sendBeginResp(trans, delay);
539  }
540  trans.release();
541 
542  pendingRequest = nullptr;
543  }
544 }
545 
546 template <unsigned int BITWIDTH>
547 void
549 {
550  DPRINTF(TlmBridge,
551  "received address range change but ignored it");
552 }
553 
554 template <unsigned int BITWIDTH>
555 gem5::Port &
556 TlmToGem5Bridge<BITWIDTH>::gem5_getPort(const std::string &if_name, int idx)
557 {
558  if (if_name == "gem5")
559  return bmp;
560  else if (if_name == "tlm")
561  return wrapper;
562 
563  return sc_core::sc_module::gem5_getPort(if_name, idx);
564 }
565 
566 template <unsigned int BITWIDTH>
568  const Params &params, const sc_core::sc_module_name &mn) :
569  TlmToGem5BridgeBase(mn), peq(this, &TlmToGem5Bridge<BITWIDTH>::peq_cb),
570  waitForRetry(false), pendingRequest(nullptr), pendingPacket(nullptr),
571  needToSendRetry(false), responseInProgress(false),
572  bmp(std::string(name()) + "master", *this), socket("tlm_socket"),
573  wrapper(socket, std::string(name()) + ".tlm", InvalidPortID),
574  system(params.system),
575  _id(params.system->getGlobalRequestorId(
576  std::string("[systemc].") + name()))
577 {
578 }
579 
580 template <unsigned int BITWIDTH>
581 void
583 {
584  /*
585  * Register the TLM non-blocking interface when using gem5 Timing mode and
586  * the TLM blocking interface when using the gem5 Atomic mode.
587  * Then the magic (TM) in simple_target_socket automatically transforms
588  * non-blocking in blocking transactions and vice versa.
589  *
590  * NOTE: The mode may change during execution.
591  */
592  if (system->isTimingMode()) {
593  DPRINTF(TlmBridge, "register non-blocking interface");
594  socket.register_nb_transport_fw(
596  } else if (system->isAtomicMode()) {
597  DPRINTF(TlmBridge, "register blocking interface");
598  socket.register_b_transport(
600  } else {
601  panic("gem5 operates neither in Timing nor in Atomic mode");
602  }
603 
604  socket.register_get_direct_mem_ptr(
606  socket.register_transport_dbg(
608 
610 }
611 
612 } // namespace sc_gem5
613 
615 gem5::TlmToGem5Bridge32Params::create() const
616 {
617  return new sc_gem5::TlmToGem5Bridge<32>(
618  *this, sc_core::sc_module_name(name.c_str()));
619 }
620 
622 gem5::TlmToGem5Bridge64Params::create() const
623 {
624  return new sc_gem5::TlmToGem5Bridge<64>(
625  *this, sc_core::sc_module_name(name.c_str()));
626 }
627 
629 gem5::TlmToGem5Bridge128Params::create() const
630 {
632  *this, sc_core::sc_module_name(name.c_str()));
633 }
634 
636 gem5::TlmToGem5Bridge256Params::create() const
637 {
639  *this, sc_core::sc_module_name(name.c_str()));
640 }
641 
643 gem5::TlmToGem5Bridge512Params::create() const
644 {
646  *this, sc_core::sc_module_name(name.c_str()));
647 }
gem5::Request::ATOMIC_NO_RETURN_OP
@ ATOMIC_NO_RETURN_OP
The request is an atomic that does not return data.
Definition: request.hh:177
sc_core::sc_time::from_value
static sc_time from_value(sc_dt::uint64)
Definition: sc_time.cc:210
gem5::AddrRange::start
Addr start() const
Get the start address of the range.
Definition: addr_range.hh:343
system.hh
tlm_to_gem5.hh
gem5::MemCmd::SwapReq
@ SwapReq
Definition: packet.hh:120
gem5::AtomicOpFunctor::clone
virtual AtomicOpFunctor * clone()=0
gem5::MemBackdoor::Writeable
@ Writeable
Definition: backdoor.hh:54
tlm::tlm_phase
Definition: phase.hh:47
tlm::TLM_COMPLETED
@ TLM_COMPLETED
Definition: fw_bw_ifs.hh:65
tlm::tlm_generic_payload::get_streaming_width
unsigned int get_streaming_width() const
Definition: gp.hh:228
sc_module_name.hh
tlm::tlm_dmi
Definition: dmi.hh:46
tlm::TLM_WRITE_COMMAND
@ TLM_WRITE_COMMAND
Definition: gp.hh:102
tlm::TLM_UPDATED
@ TLM_UPDATED
Definition: fw_bw_ifs.hh:65
gem5::Request::ATOMIC_RETURN_OP
@ ATOMIC_RETURN_OP
The request is an atomic that returns data.
Definition: request.hh:175
tlm::TLM_OK_RESPONSE
@ TLM_OK_RESPONSE
Definition: gp.hh:108
tlm::END_REQ
@ END_REQ
Definition: phase.hh:42
tlm::TLM_BYTE_ENABLE_ERROR_RESPONSE
@ TLM_BYTE_ENABLE_ERROR_RESPONSE
Definition: gp.hh:114
sc_core::SC_ZERO_TIME
const sc_time SC_ZERO_TIME
Definition: sc_time.cc:290
SC_REPORT_FATAL
#define SC_REPORT_FATAL(msg_type, msg)
Definition: sc_report_handler.hh:131
gem5::Packet::isWrite
bool isWrite() const
Definition: packet.hh:594
tlm::tlm_dmi::DMI_ACCESS_READ
@ DMI_ACCESS_READ
Definition: dmi.hh:90
gem5::X86ISA::system
Bitfield< 15 > system
Definition: misc.hh:1004
std::vector
STL vector class.
Definition: stl.hh:37
Gem5SystemC::Gem5Extension::getPacket
gem5::PacketPtr getPacket()
Definition: sc_ext.cc:135
tlm::tlm_generic_payload::release
void release()
Definition: gp.hh:147
gem5::InvalidPortID
const PortID InvalidPortID
Definition: types.hh:246
gem5::Packet::headerDelay
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
Definition: packet.hh:431
sc_assert
#define sc_assert(expr)
Definition: sc_report_handler.hh:135
gem5::MemBackdoor::Flags
Flags
Definition: backdoor.hh:49
tlm::tlm_generic_payload::set_dmi_allowed
void set_dmi_allowed(bool dmi_allowed)
Definition: gp.hh:256
gem5::MemCmd
Definition: packet.hh:76
gem5::Packet::payloadDelay
uint32_t payloadDelay
The extra pipelining delay from seeing the packet until the end of payload is transmitted by the comp...
Definition: packet.hh:449
tlm::TLM_BURST_ERROR_RESPONSE
@ TLM_BURST_ERROR_RESPONSE
Definition: gp.hh:113
tlm::tlm_dmi::set_end_address
void set_end_address(sc_dt::uint64 addr)
Definition: dmi.hh:117
gem5::Flags< FlagsType >
tlm::tlm_generic_payload::get_command
tlm_command get_command() const
Definition: gp.hh:197
tlm::tlm_generic_payload::get_byte_enable_ptr
unsigned char * get_byte_enable_ptr() const
Definition: gp.hh:236
gem5::Packet::isRead
bool isRead() const
Definition: packet.hh:593
gem5::VegaISA::t
Bitfield< 51 > t
Definition: pagetable.hh:56
tlm::tlm_generic_payload::get_data_length
unsigned int get_data_length() const
Definition: gp.hh:209
sc_gem5::TlmToGem5BridgeBase
Definition: tlm_to_gem5.hh:86
gem5::ArmISA::width
Bitfield< 4 > width
Definition: misc_types.hh:72
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:210
sc_gem5::TlmToGem5Bridge::before_end_of_elaboration
void before_end_of_elaboration() override
Definition: tlm_to_gem5.cc:582
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:294
gem5::sim_clock::as_int::ps
Tick ps
picosecond
Definition: core.cc:69
gem5::Packet::setAddr
void setAddr(Addr _addr)
Update the address of this packet mid-transaction.
Definition: packet.hh:815
gem5::probing::Packet
ProbePointArg< PacketInfo > Packet
Packet probe point.
Definition: mem.hh:108
gem5::Tick
uint64_t Tick
Tick count type.
Definition: types.hh:58
Gem5SystemC::TlmSenderState
Definition: sc_ext.hh:48
gem5::RequestPtr
std::shared_ptr< Request > RequestPtr
Definition: request.hh:92
sc_gem5::payload2packet
std::pair< PacketPtr, bool > payload2packet(RequestorID _id, tlm::tlm_generic_payload &trans)
Convert a TLM payload to gem5 packet by copying all the relevant information to new packet.
Definition: tlm_to_gem5.cc:109
sc_core::sc_time
Definition: sc_time.hh:49
gem5::MemCmd::ReadReq
@ ReadReq
Definition: packet.hh:87
len
uint16_t len
Definition: helpers.cc:62
tlm::TLM_READ_COMMAND
@ TLM_READ_COMMAND
Definition: gp.hh:101
gem5::AddrRange::end
Addr end() const
Get the end address of the range.
Definition: addr_range.hh:350
sc_core::sc_module_name
Definition: sc_module_name.hh:41
flags
uint8_t flags
Definition: helpers.cc:66
tlm::tlm_generic_payload::acquire
void acquire()
Definition: gp.hh:140
gem5::Packet::SenderState
A virtual base opaque structure used to hold state associated with the packet (e.g....
Definition: packet.hh:468
tlm::tlm_generic_payload::get_extension
void get_extension(T *&ext) const
Definition: gp.hh:381
std::pair
STL pair class.
Definition: stl.hh:58
tlm::END_RESP
@ END_RESP
Definition: phase.hh:44
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::Packet::isError
bool isError() const
Definition: packet.hh:622
tlm::TLM_IGNORE_COMMAND
@ TLM_IGNORE_COMMAND
Definition: gp.hh:103
name
const std::string & name()
Definition: trace.cc:48
gem5::MemBackdoor
Definition: backdoor.hh:41
sc_gem5::addPayloadToPacketConversionStep
void addPayloadToPacketConversionStep(PayloadToPacketConversionStep step)
Notify the Tlm2Gem5 bridge that we need an extra step to properly convert a tlm payload to gem5 packe...
Definition: tlm_to_gem5.cc:96
sc_gem5::TlmToGem5Bridge::Params
gem5::TlmToGem5BridgeBaseParams Params
Definition: tlm_to_gem5.hh:167
Gem5SystemC::AtomicExtension::isReturnRequired
bool isReturnRequired() const
Definition: sc_ext.cc:188
gem5::Packet::popSenderState
SenderState * popSenderState()
Pop the top of the state stack and return a pointer to it.
Definition: packet.cc:342
tlm::BEGIN_REQ
@ BEGIN_REQ
Definition: phase.hh:41
sc_gem5::setPayloadResponse
void setPayloadResponse(tlm::tlm_generic_payload &trans, PacketPtr pkt)
Definition: tlm_to_gem5.cc:182
tlm::TLM_COMMAND_ERROR_RESPONSE
@ TLM_COMMAND_ERROR_RESPONSE
Definition: gp.hh:112
panic_if
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Definition: logging.hh:214
sc_gem5::PayloadToPacketConversionStep
std::function< void(gem5::PacketPtr pkt, tlm::tlm_generic_payload &trans)> PayloadToPacketConversionStep
Definition: tlm_to_gem5.hh:79
sc_core::SC_PS
@ SC_PS
Definition: sc_time.hh:42
tlm::tlm_generic_payload
Definition: gp.hh:133
gem5::Port
Ports are used to interface objects to each other.
Definition: port.hh:61
std
Overload hash function for BasicBlockRange type.
Definition: misc.hh:2909
sc_gem5::TlmToGem5Bridge
Definition: tlm_to_gem5.hh:93
Gem5SystemC::AtomicExtension
Definition: sc_ext.hh:72
gem5::MemBackdoor::range
const AddrRange & range() const
Definition: backdoor.hh:58
sc_core::sc_module::gem5_getPort
virtual gem5::Port & gem5_getPort(const std::string &if_name, int idx=-1)
Definition: sc_module.cc:117
core.hh
sc_core::sc_module::before_end_of_elaboration
virtual void before_end_of_elaboration()
Definition: sc_module.hh:252
gem5::MemCmd::WriteReq
@ WriteReq
Definition: packet.hh:90
tlm::tlm_sync_enum
tlm_sync_enum
Definition: fw_bw_ifs.hh:48
tlm::tlm_dmi::set_dmi_ptr
void set_dmi_ptr(unsigned char *p)
Definition: dmi.hh:115
tlm::tlm_dmi::DMI_ACCESS_NONE
@ DMI_ACCESS_NONE
Definition: dmi.hh:89
sc_gem5
Definition: sc_clock.cc:41
gem5::RequestorID
uint16_t RequestorID
Definition: request.hh:95
Gem5SystemC::Gem5Extension
Definition: sc_ext.hh:54
trace.hh
tlm::tlm_dmi::set_start_address
void set_start_address(sc_dt::uint64 addr)
Definition: dmi.hh:116
tlm::tlm_dmi::dmi_access_e
dmi_access_e
Definition: dmi.hh:71
Gem5SystemC::AtomicExtension::getAtomicOpFunctor
gem5::AtomicOpFunctor * getAtomicOpFunctor() const
Definition: sc_ext.cc:194
gem5::AtomicOpFunctorPtr
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
Definition: amo.hh:269
tlm::TLM_ADDRESS_ERROR_RESPONSE
@ TLM_ADDRESS_ERROR_RESPONSE
Definition: gp.hh:111
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::MemBackdoor::Readable
@ Readable
Definition: backdoor.hh:53
gem5::MemBackdoorReq
Definition: backdoor.hh:129
sc_time.hh
tlm::tlm_dmi::DMI_ACCESS_WRITE
@ DMI_ACCESS_WRITE
Definition: dmi.hh:91
tlm::tlm_generic_payload::get_address
sc_dt::uint64 get_address() const
Definition: gp.hh:201
tlm::tlm_generic_payload::get_data_ptr
unsigned char * get_data_ptr() const
Definition: gp.hh:205
gem5::Packet::isResponse
bool isResponse() const
Definition: packet.hh:598
tlm::BEGIN_RESP
@ BEGIN_RESP
Definition: phase.hh:43
tlm::tlm_dmi::set_granted_access
void set_granted_access(dmi_access_e a)
Definition: dmi.hh:120
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:188
gem5::ArmISA::status
Bitfield< 5, 0 > status
Definition: misc_types.hh:480
tlm::tlm_generic_payload::set_response_status
void set_response_status(const tlm_response_status response_status)
Definition: gp.hh:221
tlm::TLM_ACCEPTED
@ TLM_ACCEPTED
Definition: fw_bw_ifs.hh:65

Generated on Sun Jul 30 2023 01:57:03 for gem5 by doxygen 1.8.17