gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
gem5_to_tlm.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) 2015, University of Kaiserslautern
28  * Copyright (c) 2016, Dresden University of Technology (TU Dresden)
29  * All rights reserved.
30  *
31  * Redistribution and use in source and binary forms, with or without
32  * modification, are permitted provided that the following conditions are
33  * met:
34  *
35  * 1. Redistributions of source code must retain the above copyright notice,
36  * this list of conditions and the following disclaimer.
37  *
38  * 2. Redistributions in binary form must reproduce the above copyright
39  * notice, this list of conditions and the following disclaimer in the
40  * documentation and/or other materials provided with the distribution.
41  *
42  * 3. Neither the name of the copyright holder nor the names of its
43  * contributors may be used to endorse or promote products derived from
44  * this software without specific prior written permission.
45  *
46  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
47  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
48  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
49  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
50  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
51  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
52  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
53  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
54  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
55  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
56  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
57  */
58 
60 
61 #include <utility>
62 
63 #include "params/Gem5ToTlmBridge32.hh"
64 #include "params/Gem5ToTlmBridge64.hh"
65 #include "params/Gem5ToTlmBridge128.hh"
66 #include "params/Gem5ToTlmBridge256.hh"
67 #include "params/Gem5ToTlmBridge512.hh"
68 #include "sim/eventq.hh"
69 #include "sim/system.hh"
72 
73 using namespace gem5;
74 
75 namespace sc_gem5
76 {
77 
85 {
86  // In theory, for all phase change events of a specific TLM base protocol
87  // transaction, only tlm::END_REQ and tlm::BEGIN_RESP would be scheduled at
88  // the same time in the same queue. So we only need to ensure END_REQ has a
89  // higher priority (less in pri value) than BEGIN_RESP.
90  if (phase == tlm::END_REQ) {
91  return EventBase::Default_Pri - 1;
92  }
94 }
95 
101 
102 namespace
103 {
107 std::vector<PacketToPayloadConversionStep> extraPacketToPayloadSteps;
108 } // namespace
109 
118 void
120 {
121  extraPacketToPayloadSteps.push_back(std::move(step));
122 }
123 
132 {
133  tlm::tlm_generic_payload *trans = nullptr;
134  auto *tlmSenderState =
136 
137  // If there is a SenderState, we can pipe through the original transaction.
138  // Otherwise, we generate a new transaction based on the packet.
139  if (tlmSenderState != nullptr) {
140  // Sync the address which could have changed.
141  trans = &tlmSenderState->trans;
142  trans->set_address(packet->getAddr());
143  trans->acquire();
144  // Apply all conversion steps necessary in this specific setup.
145  for (auto &step : extraPacketToPayloadSteps) {
146  step(packet, *trans);
147  }
148  return trans;
149  }
150 
151  trans = mm.allocate();
152  trans->acquire();
153 
154  trans->set_address(packet->getAddr());
155 
156  /* Check if this transaction was allocated by mm */
157  sc_assert(trans->has_mm());
158 
159  unsigned int size = packet->getSize();
160  unsigned char *data = packet->getPtr<unsigned char>();
161 
162  trans->set_data_length(size);
163  trans->set_streaming_width(size);
164  trans->set_data_ptr(data);
165 
166  if ((packet->req->getFlags() & Request::NO_ACCESS) != 0) {
167  /* Do nothing */
169  } else if (packet->isRead()) {
171  } else if (packet->isWrite()) {
173  } else {
175  }
176 
177  // Attach the packet pointer to the TLM transaction to keep track.
178  auto *extension = new Gem5SystemC::Gem5Extension(packet);
179  trans->set_auto_extension(extension);
180 
181  if (packet->isAtomicOp()) {
182  auto *atomic_ex = new Gem5SystemC::AtomicExtension(
183  std::shared_ptr<AtomicOpFunctor>(
184  packet->req->getAtomicOpFunctor()->clone()),
185  packet->req->isAtomicReturn());
186  trans->set_auto_extension(atomic_ex);
187  }
188 
189  // Apply all conversion steps necessary in this specific setup.
190  for (auto &step : extraPacketToPayloadSteps) {
191  step(packet, *trans);
192  }
193 
194  return trans;
195 }
196 
197 void
199 {
200  pkt->makeResponse();
201 
202  auto resp = trans.get_response_status();
203  switch (resp) {
205  break;
207  pkt->setBadCommand();
208  break;
209  default:
210  pkt->setBadAddress();
211  break;
212  }
213 }
214 
215 template <unsigned int BITWIDTH>
216 void
218  tlm::tlm_generic_payload &trans, const tlm::tlm_phase &phase)
219 {
220  sc_core::sc_time delay;
221 
222  if (phase == tlm::END_REQ ||
223  (&trans == blockingRequest && phase == tlm::BEGIN_RESP)) {
224  sc_assert(&trans == blockingRequest);
225  blockingRequest = nullptr;
226 
227  // Did another request arrive while blocked, schedule a retry.
228  if (needToSendRequestRetry) {
229  needToSendRequestRetry = false;
230  bridgeResponsePort.sendRetryReq();
231  }
232  }
233  if (phase == tlm::BEGIN_RESP) {
234  PacketPtr packet = packetMap[&trans];
235 
236  sc_assert(!blockingResponse);
237  sc_assert(packet);
238 
239  bool need_retry = false;
240 
241  // If there is another gem5 model under the receiver side, and already
242  // make a response packet back, we can simply send it back. Otherwise,
243  // we make a response packet before sending it back to the initiator
244  // side gem5 module.
245  if (packet->needsResponse()) {
246  setPacketResponse(packet, trans);
247  }
248  if (packet->isResponse()) {
249  need_retry = !bridgeResponsePort.sendTimingResp(packet);
250  }
251 
252  if (need_retry) {
253  blockingResponse = &trans;
254  } else {
255  if (phase == tlm::BEGIN_RESP) {
256  // Send END_RESP and we're finished:
257  tlm::tlm_phase fw_phase = tlm::END_RESP;
259  socket->nb_transport_fw(trans, fw_phase, delay);
260  // Release the transaction with all the extensions.
261  packetMap.erase(&trans);
262  trans.release();
263  }
264  }
265  }
266 }
267 
268 template <unsigned int BITWIDTH>
271 {
272  sc_dt::uint64 start = trans.get_address();
273  sc_dt::uint64 end = start + trans.get_data_length();
274 
275  // Check for a back door we already know about.
276  AddrRange r(start, end);
277  auto it = backdoorMap.contains(r);
278  if (it != backdoorMap.end())
279  return it->second;
280 
281  // If not, ask the target for one.
282  tlm::tlm_dmi dmi_data;
283  if (!socket->get_direct_mem_ptr(trans, dmi_data))
284  return nullptr;
285 
286  // If the target gave us one, translate it to a gem5 MemBackdoor and
287  // store it in our cache.
288  AddrRange dmi_r(dmi_data.get_start_address(), dmi_data.get_end_address());
289  auto backdoor = new MemBackdoor(
290  dmi_r, dmi_data.get_dmi_ptr(), MemBackdoor::NoAccess);
291  backdoor->readable(dmi_data.is_read_allowed());
292  backdoor->writeable(dmi_data.is_write_allowed());
293 
294  backdoorMap.insert(dmi_r, backdoor);
295 
296  return backdoor;
297 }
298 
299 // Similar to TLM's blocking transport (LT)
300 template <unsigned int BITWIDTH>
301 Tick
303 {
304  panic_if(packet->cacheResponding(),
305  "Should not see packets where cache is responding");
306 
307  // Prepare the transaction.
308  auto *trans = packet2payload(packet);
309 
311 
312  if (trans->get_command() != tlm::TLM_IGNORE_COMMAND) {
313  // Execute b_transport:
314  socket->b_transport(*trans, delay);
315  }
316 
317  if (packet->needsResponse())
318  setPacketResponse(packet, *trans);
319 
320  trans->release();
321 
322  return delay.value();
323 }
324 
325 template <unsigned int BITWIDTH>
326 Tick
328  PacketPtr packet, MemBackdoorPtr &backdoor)
329 {
330  panic_if(packet->cacheResponding(),
331  "Should not see packets where cache is responding");
332 
334 
335  // Prepare the transaction.
336  auto *trans = packet2payload(packet);
337 
338  if (trans->get_command() != tlm::TLM_IGNORE_COMMAND) {
339  // Execute b_transport:
340  socket->b_transport(*trans, delay);
341  // If the hint said we could use DMI, set that up.
342  if (trans->is_dmi_allowed())
343  backdoor = getBackdoor(*trans);
344  } else {
345  // There's no transaction to piggy back on, so just request the
346  // backdoor normally.
347  backdoor = getBackdoor(*trans);
348  }
349 
350  // Always set success response in Backdoor case.
351  if (packet->needsResponse())
352  packet->makeResponse();
353 
354  trans->release();
355 
356  return delay.value();
357 }
358 
359 template <unsigned int BITWIDTH>
360 void
362 {
363  // Snooping should be implemented with tlm_dbg_transport.
364  SC_REPORT_FATAL("Gem5ToTlmBridge",
365  "unimplemented func.: recvFunctionalSnoop");
366 }
367 
368 // Similar to TLM's non-blocking transport (AT).
369 template <unsigned int BITWIDTH>
370 bool
372 {
373  panic_if(packet->cacheResponding(),
374  "Should not see packets where cache is responding");
375 
376  // We should never get a second request after noting that a retry is
377  // required.
378  sc_assert(!needToSendRequestRetry);
379 
380  // Remember if a request comes in while we're blocked so that a retry
381  // can be sent to gem5.
382  if (blockingRequest) {
383  needToSendRequestRetry = true;
384  return false;
385  }
386 
387  /*
388  * NOTE: normal tlm is blocking here. But in our case we return false
389  * and tell gem5 when a retry can be done. This is the main difference
390  * in the protocol:
391  * if (requestInProgress)
392  * {
393  * wait(endRequestEvent);
394  * }
395  * requestInProgress = trans;
396  */
397 
398  // Prepare the transaction.
399  auto *trans = packet2payload(packet);
400 
401  /*
402  * Pay for annotated transport delays.
403  *
404  * The header delay marks the point in time, when the packet first is seen
405  * by the transactor. This is the point in time when the transactor needs
406  * to send the BEGIN_REQ to the SystemC world.
407  *
408  * NOTE: We drop the payload delay here. Normally, the receiver would be
409  * responsible for handling the payload delay. In this case, however,
410  * the receiver is a SystemC module and has no notion of the gem5
411  * transport protocol and we cannot simply forward the
412  * payload delay to the receiving module. Instead, we expect the
413  * receiving SystemC module to model the payload delay by deferring
414  * the END_REQ. This could lead to incorrect delays, if the XBar
415  * payload delay is longer than the time the receiver needs to accept
416  * the request (time between BEGIN_REQ and END_REQ).
417  *
418  * TODO: We could detect the case described above by remembering the
419  * payload delay and comparing it to the time between BEGIN_REQ and
420  * END_REQ. Then, a warning should be printed.
421  */
422  auto delay = sc_core::sc_time::from_value(packet->payloadDelay);
423  // Reset the delays
424  packet->payloadDelay = 0;
425  packet->headerDelay = 0;
426 
427  // Starting TLM non-blocking sequence (AT) Refer to IEEE1666-2011 SystemC
428  // Standard Page 507 for a visualisation of the procedure.
431  status = socket->nb_transport_fw(*trans, phase, delay);
432  // Check returned value:
433  if (status == tlm::TLM_ACCEPTED) {
434  sc_assert(phase == tlm::BEGIN_REQ);
435  // Accepted but is now blocking until END_REQ (exclusion rule).
436  blockingRequest = trans;
437  packetMap.emplace(trans, packet);
438  } else if (status == tlm::TLM_UPDATED) {
439  // The Timing annotation must be honored:
440  sc_assert(phase == tlm::END_REQ || phase == tlm::BEGIN_RESP);
441  // Accepted but is now blocking until END_REQ (exclusion rule).
442  blockingRequest = trans;
443  packetMap.emplace(trans, packet);
444  auto cb = [this, trans, phase]() { pec(*trans, phase); };
445  auto event = new EventFunctionWrapper(
446  cb, "pec", true, getPriorityOfTlmPhase(phase));
447  system->schedule(event, curTick() + delay.value());
448  } else if (status == tlm::TLM_COMPLETED) {
449  // Transaction is over nothing has do be done.
450  sc_assert(phase == tlm::END_RESP);
451  trans->release();
452  }
453 
454  return true;
455 }
456 
457 template <unsigned int BITWIDTH>
458 bool
460 {
461  // Snooping should be implemented with tlm_dbg_transport.
462  SC_REPORT_FATAL("Gem5ToTlmBridge",
463  "unimplemented func.: recvTimingSnoopResp");
464  return false;
465 }
466 
467 template <unsigned int BITWIDTH>
468 bool
470 {
471  panic("tryTiming(PacketPtr) isn't implemented.");
472 }
473 
474 template <unsigned int BITWIDTH>
475 void
477 {
478  /* Retry a response */
479  sc_assert(blockingResponse);
480 
481  tlm::tlm_generic_payload *trans = blockingResponse;
482  blockingResponse = nullptr;
483  PacketPtr packet = packetMap[blockingResponse];
484  sc_assert(packet);
485 
486  bool need_retry = !bridgeResponsePort.sendTimingResp(packet);
487 
488  sc_assert(!need_retry);
489 
492  socket->nb_transport_fw(*trans, phase, delay);
493  // Release transaction with all the extensions
494  packetMap.erase(trans);
495  trans->release();
496 }
497 
498 // Similar to TLM's debug transport.
499 template <unsigned int BITWIDTH>
500 void
502 {
503  // Prepare the transaction.
504  auto *trans = packet2payload(packet);
505 
506  /* Execute Debug Transport: */
507  unsigned int bytes = socket->transport_dbg(*trans);
508  if (bytes != trans->get_data_length()) {
509  SC_REPORT_FATAL("Gem5ToTlmBridge",
510  "debug transport was not completed");
511  }
512 
513  trans->release();
514 }
515 
516 template <unsigned int BITWIDTH>
517 void
519  MemBackdoorPtr &backdoor)
520 {
521  // Create a transaction to send along to TLM's get_direct_mem_ptr.
523  trans->acquire();
524  trans->set_address(req.range().start());
525  trans->set_data_length(req.range().size());
526  trans->set_streaming_width(req.range().size());
527  trans->set_data_ptr(nullptr);
528 
529  if (req.writeable())
531  else if (req.readable())
533  else
535 
536  backdoor = getBackdoor(*trans);
537 
538  trans->release();
539 }
540 
541 template <unsigned int BITWIDTH>
544  tlm::tlm_phase &phase, sc_core::sc_time &delay)
545 {
546  auto cb = [this, &trans, phase]() { pec(trans, phase); };
547  auto event = new EventFunctionWrapper(
548  cb, "pec", true, getPriorityOfTlmPhase(phase));
549  system->schedule(event, curTick() + delay.value());
550  return tlm::TLM_ACCEPTED;
551 }
552 
553 template <unsigned int BITWIDTH>
554 void
556  sc_dt::uint64 start_range, sc_dt::uint64 end_range)
557 {
558  AddrRange r(start_range, end_range);
559 
560  for (;;) {
561  auto it = backdoorMap.intersects(r);
562  if (it == backdoorMap.end())
563  break;
564 
565  it->second->invalidate();
566  delete it->second;
567  backdoorMap.erase(it);
568  };
569 }
570 
571 template <unsigned int BITWIDTH>
573  const Params &params, const sc_core::sc_module_name &mn) :
575  bridgeResponsePort(std::string(name()) + ".gem5", *this),
576  socket("tlm_socket"),
577  wrapper(socket, std::string(name()) + ".tlm", InvalidPortID),
578  system(params.system), blockingRequest(nullptr),
579  needToSendRequestRetry(false), blockingResponse(nullptr),
580  addrRanges(params.addr_ranges.begin(), params.addr_ranges.end())
581 {
582 }
583 
584 template <unsigned int BITWIDTH>
585 gem5::Port &
586 Gem5ToTlmBridge<BITWIDTH>::gem5_getPort(const std::string &if_name, int idx)
587 {
588  if (if_name == "gem5")
589  return bridgeResponsePort;
590  else if (if_name == "tlm")
591  return wrapper;
592 
593  return sc_core::sc_module::gem5_getPort(if_name, idx);
594 }
595 
596 template <unsigned int BITWIDTH>
597 void
599 {
600  bridgeResponsePort.sendRangeChange();
601 
602  socket.register_nb_transport_bw(this, &Gem5ToTlmBridge::nb_transport_bw);
603  socket.register_invalidate_direct_mem_ptr(
606 }
607 
608 } // namespace sc_gem5
609 
611 gem5::Gem5ToTlmBridge32Params::create() const
612 {
613  return new sc_gem5::Gem5ToTlmBridge<32>(
614  *this, sc_core::sc_module_name(name.c_str()));
615 }
616 
618 gem5::Gem5ToTlmBridge64Params::create() const
619 {
620  return new sc_gem5::Gem5ToTlmBridge<64>(
621  *this, sc_core::sc_module_name(name.c_str()));
622 }
623 
625 gem5::Gem5ToTlmBridge128Params::create() const
626 {
628  *this, sc_core::sc_module_name(name.c_str()));
629 }
630 
632 gem5::Gem5ToTlmBridge256Params::create() const
633 {
635  *this, sc_core::sc_module_name(name.c_str()));
636 }
637 
639 gem5::Gem5ToTlmBridge512Params::create() const
640 {
642  *this, sc_core::sc_module_name(name.c_str()));
643 }
gem5::curTick
Tick curTick()
The universal simulation clock.
Definition: cur_tick.hh:46
gem5::Packet::isAtomicOp
bool isAtomicOp() const
Definition: packet.hh:846
sc_core::sc_time::from_value
static sc_time from_value(sc_dt::uint64)
Definition: sc_time.cc:210
sc_gem5::Gem5ToTlmBridge::gem5_getPort
gem5::Port & gem5_getPort(const std::string &if_name, int idx=-1) override
Definition: gem5_to_tlm.cc:586
gem5::AddrRange::start
Addr start() const
Get the start address of the range.
Definition: addr_range.hh:343
tlm::tlm_generic_payload::set_data_length
void set_data_length(const unsigned int length)
Definition: gp.hh:210
system.hh
data
const char data[]
Definition: circlebuf.test.cc:48
Gem5SystemC::MemoryManager
Definition: sc_mm.hh:45
tlm::tlm_phase
Definition: phase.hh:47
sc_gem5::Gem5ToTlmBridge::before_end_of_elaboration
void before_end_of_elaboration() override
Definition: gem5_to_tlm.cc:598
gem5::Packet::findNextSenderState
T * findNextSenderState() const
Go through the sender state stack and return the first instance that is of type T (as determined by a...
Definition: packet.hh:575
sc_gem5::addPacketToPayloadConversionStep
void addPacketToPayloadConversionStep(PacketToPayloadConversionStep step)
Notify the Gem5ToTlm bridge that we need an extra step to properly convert a gem5 packet to tlm paylo...
Definition: gem5_to_tlm.cc:119
tlm::TLM_COMPLETED
@ TLM_COMPLETED
Definition: fw_bw_ifs.hh:65
gem5::Packet::req
RequestPtr req
A pointer to the original request.
Definition: packet.hh:377
gem5::Packet::setBadAddress
void setBadAddress()
Definition: packet.hh:786
gem5_to_tlm.hh
tlm::tlm_dmi
Definition: dmi.hh:46
tlm::TLM_WRITE_COMMAND
@ TLM_WRITE_COMMAND
Definition: gp.hh:102
gem5::MipsISA::event
Bitfield< 10, 5 > event
Definition: pra_constants.hh:300
tlm::TLM_UPDATED
@ TLM_UPDATED
Definition: fw_bw_ifs.hh:65
sc_gem5::packet2payload
tlm::tlm_generic_payload * packet2payload(PacketPtr packet)
Convert a gem5 packet to TLM payload by copying all the relevant information to new payload.
Definition: gem5_to_tlm.cc:131
sc_ext.hh
tlm::TLM_OK_RESPONSE
@ TLM_OK_RESPONSE
Definition: gp.hh:108
tlm::END_REQ
@ END_REQ
Definition: phase.hh:42
gem5::Packet::setBadCommand
void setBadCommand()
Definition: packet.hh:795
gem5::Packet::cacheResponding
bool cacheResponding() const
Definition: packet.hh:659
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
gem5::X86ISA::system
Bitfield< 15 > system
Definition: misc.hh:1004
std::vector
STL vector class.
Definition: stl.hh:37
sc_gem5::setPacketResponse
void setPacketResponse(PacketPtr pkt, tlm::tlm_generic_payload &trans)
Definition: gem5_to_tlm.cc:198
gem5::VegaISA::r
Bitfield< 5 > r
Definition: pagetable.hh:60
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::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
gem5::Packet::isRead
bool isRead() const
Definition: packet.hh:593
tlm::tlm_generic_payload::set_command
void set_command(const tlm_command command)
Definition: gp.hh:198
tlm::tlm_generic_payload::get_response_status
tlm_response_status get_response_status() const
Definition: gp.hh:216
tlm::tlm_dmi::is_read_allowed
bool is_read_allowed() const
Definition: dmi.hh:100
tlm::tlm_generic_payload::get_data_length
unsigned int get_data_length() const
Definition: gp.hh:209
sc_dt::uint64
uint64_t uint64
Definition: sc_nbdefs.hh:206
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:294
gem5::Tick
uint64_t Tick
Tick count type.
Definition: types.hh:58
Gem5SystemC::TlmSenderState
Definition: sc_ext.hh:48
sc_core::sc_time
Definition: sc_time.hh:49
sc_core::sc_time::value
sc_dt::uint64 value() const
Definition: sc_time.cc:115
tlm::tlm_dmi::get_end_address
sc_dt::uint64 get_end_address() const
Definition: dmi.hh:94
tlm::TLM_READ_COMMAND
@ TLM_READ_COMMAND
Definition: gp.hh:101
tlm::tlm_dmi::is_write_allowed
bool is_write_allowed() const
Definition: dmi.hh:105
sc_gem5::PacketToPayloadConversionStep
std::function< void(gem5::PacketPtr pkt, tlm::tlm_generic_payload &trans)> PacketToPayloadConversionStep
Definition: gem5_to_tlm.hh:80
gem5::AddrRange::size
Addr size() const
Get the size of the address range.
Definition: addr_range.hh:326
tlm::tlm_dmi::get_start_address
sc_dt::uint64 get_start_address() const
Definition: dmi.hh:93
sc_core::sc_module_name
Definition: sc_module_name.hh:41
mm
Definition: mm.h:8
tlm::tlm_generic_payload::acquire
void acquire()
Definition: gp.hh:140
tlm::tlm_generic_payload::set_streaming_width
void set_streaming_width(const unsigned int streaming_width)
Definition: gp.hh:230
sc_gem5::Gem5ToTlmBridge
Definition: gem5_to_tlm.hh:93
sc_gem5::Gem5ToTlmBridge::nb_transport_bw
tlm::tlm_sync_enum nb_transport_bw(tlm::tlm_generic_payload &trans, tlm::tlm_phase &phase, sc_core::sc_time &t)
Definition: gem5_to_tlm.cc:543
sc_gem5::getPriorityOfTlmPhase
static EventBase::Priority getPriorityOfTlmPhase(const tlm::tlm_phase &phase)
Helper function to help set priority of phase change events of tlm transactions.
Definition: gem5_to_tlm.cc:84
gem5::Packet::needsResponse
bool needsResponse() const
Definition: packet.hh:608
tlm::END_RESP
@ END_RESP
Definition: phase.hh:44
gem5::MemBackdoorReq::range
const AddrRange & range() const
Definition: backdoor.hh:140
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
tlm::tlm_dmi::get_dmi_ptr
unsigned char * get_dmi_ptr() const
Definition: dmi.hh:92
mm::allocate
gp_t * allocate()
Definition: mm.h:55
gem5::EventFunctionWrapper
Definition: eventq.hh:1136
tlm::BEGIN_REQ
@ BEGIN_REQ
Definition: phase.hh:41
gem5::MemBackdoorReq::writeable
bool writeable() const
Definition: backdoor.hh:143
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
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
gem5::MemBackdoor::NoAccess
@ NoAccess
Definition: backdoor.hh:52
Gem5SystemC::AtomicExtension
Definition: sc_ext.hh:72
gem5::EventBase::Priority
int8_t Priority
Definition: eventq.hh:126
sc_core::sc_module::gem5_getPort
virtual gem5::Port & gem5_getPort(const std::string &if_name, int idx=-1)
Definition: sc_module.cc:117
gem5::Packet::makeResponse
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
Definition: packet.hh:1062
sc_mm.hh
sc_core::sc_module::before_end_of_elaboration
virtual void before_end_of_elaboration()
Definition: sc_module.hh:252
tlm::tlm_generic_payload::set_address
void set_address(const sc_dt::uint64 address)
Definition: gp.hh:202
tlm::tlm_generic_payload::has_mm
bool has_mm() const
Definition: gp.hh:157
tlm::tlm_sync_enum
tlm_sync_enum
Definition: fw_bw_ifs.hh:48
tlm::tlm_generic_payload::set_auto_extension
T * set_auto_extension(T *ext)
Definition: gp.hh:370
sc_gem5::Gem5ToTlmBridge::invalidate_direct_mem_ptr
void invalidate_direct_mem_ptr(sc_dt::uint64 start_range, sc_dt::uint64 end_range)
Definition: gem5_to_tlm.cc:555
sc_gem5
Definition: sc_clock.cc:41
Gem5SystemC::Gem5Extension
Definition: sc_ext.hh:54
gem5::AddrRange
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
Definition: addr_range.hh:81
gem5::Packet::getAddr
Addr getAddr() const
Definition: packet.hh:807
gem5::EventBase::Default_Pri
static const Priority Default_Pri
Default is zero for historical reasons.
Definition: eventq.hh:182
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
sc_gem5::Gem5ToTlmBridge::Params
gem5::Gem5ToTlmBridgeBaseParams Params
Definition: gem5_to_tlm.hh:215
sc_gem5::mm
Gem5SystemC::MemoryManager mm
Instantiate a tlm memory manager that takes care about all the tlm transactions in the system.
Definition: gem5_to_tlm.cc:100
gem5::MemBackdoorReq
Definition: backdoor.hh:129
tlm::tlm_generic_payload::get_address
sc_dt::uint64 get_address() const
Definition: gp.hh:201
gem5::Request::NO_ACCESS
@ NO_ACCESS
The request should not cause a memory access.
Definition: request.hh:146
sc_gem5::Gem5ToTlmBridgeBase
Definition: gem5_to_tlm.hh:86
gem5::Packet::isResponse
bool isResponse() const
Definition: packet.hh:598
tlm::BEGIN_RESP
@ BEGIN_RESP
Definition: phase.hh:43
gem5::Packet::getSize
unsigned getSize() const
Definition: packet.hh:817
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_data_ptr
void set_data_ptr(unsigned char *data)
Definition: gp.hh:206
gem5::Packet::getPtr
T * getPtr()
get a pointer to the data ptr.
Definition: packet.hh:1225
gem5::MemBackdoorReq::readable
bool readable() const
Definition: backdoor.hh:142
eventq.hh
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