gem5  v22.1.0.0
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  auto &extension = Gem5SystemC::Gem5Extension::getExtension(trans);
235  auto packet = extension.getPacket();
236 
237  sc_assert(!blockingResponse);
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  trans.release();
262  }
263  }
264  }
265 }
266 
267 template <unsigned int BITWIDTH>
270 {
271  sc_dt::uint64 start = trans.get_address();
272  sc_dt::uint64 end = start + trans.get_data_length();
273 
274  // Check for a back door we already know about.
275  AddrRange r(start, end);
276  auto it = backdoorMap.contains(r);
277  if (it != backdoorMap.end())
278  return it->second;
279 
280  // If not, ask the target for one.
281  tlm::tlm_dmi dmi_data;
282  if (!socket->get_direct_mem_ptr(trans, dmi_data))
283  return nullptr;
284 
285  // If the target gave us one, translate it to a gem5 MemBackdoor and
286  // store it in our cache.
287  AddrRange dmi_r(dmi_data.get_start_address(), dmi_data.get_end_address());
288  auto backdoor = new MemBackdoor(
289  dmi_r, dmi_data.get_dmi_ptr(), MemBackdoor::NoAccess);
290  backdoor->readable(dmi_data.is_read_allowed());
291  backdoor->writeable(dmi_data.is_write_allowed());
292 
293  backdoorMap.insert(dmi_r, backdoor);
294 
295  return backdoor;
296 }
297 
298 // Similar to TLM's blocking transport (LT)
299 template <unsigned int BITWIDTH>
300 Tick
302 {
303  panic_if(packet->cacheResponding(),
304  "Should not see packets where cache is responding");
305 
306  // Prepare the transaction.
307  auto *trans = packet2payload(packet);
308 
310 
311  if (trans->get_command() != tlm::TLM_IGNORE_COMMAND) {
312  // Execute b_transport:
313  socket->b_transport(*trans, delay);
314  }
315 
316  if (packet->needsResponse())
317  setPacketResponse(packet, *trans);
318 
319  trans->release();
320 
321  return delay.value();
322 }
323 
324 template <unsigned int BITWIDTH>
325 Tick
327  PacketPtr packet, MemBackdoorPtr &backdoor)
328 {
329  panic_if(packet->cacheResponding(),
330  "Should not see packets where cache is responding");
331 
333 
334  // Prepare the transaction.
335  auto *trans = packet2payload(packet);
336 
337  if (trans->get_command() != tlm::TLM_IGNORE_COMMAND) {
338  // Execute b_transport:
339  socket->b_transport(*trans, delay);
340  // If the hint said we could use DMI, set that up.
341  if (trans->is_dmi_allowed())
342  backdoor = getBackdoor(*trans);
343  } else {
344  // There's no transaction to piggy back on, so just request the
345  // backdoor normally.
346  backdoor = getBackdoor(*trans);
347  }
348 
349  // Always set success response in Backdoor case.
350  if (packet->needsResponse())
351  packet->makeResponse();
352 
353  trans->release();
354 
355  return delay.value();
356 }
357 
358 template <unsigned int BITWIDTH>
359 void
361 {
362  // Snooping should be implemented with tlm_dbg_transport.
363  SC_REPORT_FATAL("Gem5ToTlmBridge",
364  "unimplemented func.: recvFunctionalSnoop");
365 }
366 
367 // Similar to TLM's non-blocking transport (AT).
368 template <unsigned int BITWIDTH>
369 bool
371 {
372  panic_if(packet->cacheResponding(),
373  "Should not see packets where cache is responding");
374 
375  // We should never get a second request after noting that a retry is
376  // required.
377  sc_assert(!needToSendRequestRetry);
378 
379  // Remember if a request comes in while we're blocked so that a retry
380  // can be sent to gem5.
381  if (blockingRequest) {
382  needToSendRequestRetry = true;
383  return false;
384  }
385 
386  /*
387  * NOTE: normal tlm is blocking here. But in our case we return false
388  * and tell gem5 when a retry can be done. This is the main difference
389  * in the protocol:
390  * if (requestInProgress)
391  * {
392  * wait(endRequestEvent);
393  * }
394  * requestInProgress = trans;
395  */
396 
397  // Prepare the transaction.
398  auto *trans = packet2payload(packet);
399 
400  /*
401  * Pay for annotated transport delays.
402  *
403  * The header delay marks the point in time, when the packet first is seen
404  * by the transactor. This is the point in time when the transactor needs
405  * to send the BEGIN_REQ to the SystemC world.
406  *
407  * NOTE: We drop the payload delay here. Normally, the receiver would be
408  * responsible for handling the payload delay. In this case, however,
409  * the receiver is a SystemC module and has no notion of the gem5
410  * transport protocol and we cannot simply forward the
411  * payload delay to the receiving module. Instead, we expect the
412  * receiving SystemC module to model the payload delay by deferring
413  * the END_REQ. This could lead to incorrect delays, if the XBar
414  * payload delay is longer than the time the receiver needs to accept
415  * the request (time between BEGIN_REQ and END_REQ).
416  *
417  * TODO: We could detect the case described above by remembering the
418  * payload delay and comparing it to the time between BEGIN_REQ and
419  * END_REQ. Then, a warning should be printed.
420  */
421  auto delay = sc_core::sc_time::from_value(packet->payloadDelay);
422  // Reset the delays
423  packet->payloadDelay = 0;
424  packet->headerDelay = 0;
425 
426  // Starting TLM non-blocking sequence (AT) Refer to IEEE1666-2011 SystemC
427  // Standard Page 507 for a visualisation of the procedure.
430  status = socket->nb_transport_fw(*trans, phase, delay);
431  // Check returned value:
432  if (status == tlm::TLM_ACCEPTED) {
433  sc_assert(phase == tlm::BEGIN_REQ);
434  // Accepted but is now blocking until END_REQ (exclusion rule).
435  blockingRequest = trans;
436  } else if (status == tlm::TLM_UPDATED) {
437  // The Timing annotation must be honored:
438  sc_assert(phase == tlm::END_REQ || phase == tlm::BEGIN_RESP);
439  // Accepted but is now blocking until END_REQ (exclusion rule).
440  blockingRequest = trans;
441  auto cb = [this, trans, phase]() { pec(*trans, phase); };
442  auto event = new EventFunctionWrapper(
443  cb, "pec", true, getPriorityOfTlmPhase(phase));
444  system->schedule(event, curTick() + delay.value());
445  } else if (status == tlm::TLM_COMPLETED) {
446  // Transaction is over nothing has do be done.
447  sc_assert(phase == tlm::END_RESP);
448  trans->release();
449  }
450 
451  return true;
452 }
453 
454 template <unsigned int BITWIDTH>
455 bool
457 {
458  // Snooping should be implemented with tlm_dbg_transport.
459  SC_REPORT_FATAL("Gem5ToTlmBridge",
460  "unimplemented func.: recvTimingSnoopResp");
461  return false;
462 }
463 
464 template <unsigned int BITWIDTH>
465 bool
467 {
468  panic("tryTiming(PacketPtr) isn't implemented.");
469 }
470 
471 template <unsigned int BITWIDTH>
472 void
474 {
475  /* Retry a response */
476  sc_assert(blockingResponse);
477 
478  tlm::tlm_generic_payload *trans = blockingResponse;
479  blockingResponse = nullptr;
480  PacketPtr packet =
482 
483  bool need_retry = !bridgeResponsePort.sendTimingResp(packet);
484 
485  sc_assert(!need_retry);
486 
489  socket->nb_transport_fw(*trans, phase, delay);
490  // Release transaction with all the extensions
491  trans->release();
492 }
493 
494 // Similar to TLM's debug transport.
495 template <unsigned int BITWIDTH>
496 void
498 {
499  // Prepare the transaction.
500  auto *trans = packet2payload(packet);
501 
502  /* Execute Debug Transport: */
503  unsigned int bytes = socket->transport_dbg(*trans);
504  if (bytes != trans->get_data_length()) {
505  SC_REPORT_FATAL("Gem5ToTlmBridge",
506  "debug transport was not completed");
507  }
508 
509  trans->release();
510 }
511 
512 template <unsigned int BITWIDTH>
515  tlm::tlm_phase &phase, sc_core::sc_time &delay)
516 {
517  auto cb = [this, &trans, phase]() { pec(trans, phase); };
518  auto event = new EventFunctionWrapper(
519  cb, "pec", true, getPriorityOfTlmPhase(phase));
520  system->schedule(event, curTick() + delay.value());
521  return tlm::TLM_ACCEPTED;
522 }
523 
524 template <unsigned int BITWIDTH>
525 void
527  sc_dt::uint64 start_range, sc_dt::uint64 end_range)
528 {
529  AddrRange r(start_range, end_range);
530 
531  for (;;) {
532  auto it = backdoorMap.intersects(r);
533  if (it == backdoorMap.end())
534  break;
535 
536  it->second->invalidate();
537  delete it->second;
538  backdoorMap.erase(it);
539  };
540 }
541 
542 template <unsigned int BITWIDTH>
544  const Params &params, const sc_core::sc_module_name &mn) :
546  bridgeResponsePort(std::string(name()) + ".gem5", *this),
547  socket("tlm_socket"),
548  wrapper(socket, std::string(name()) + ".tlm", InvalidPortID),
549  system(params.system), blockingRequest(nullptr),
550  needToSendRequestRetry(false), blockingResponse(nullptr),
551  addrRanges(params.addr_ranges.begin(), params.addr_ranges.end())
552 {
553 }
554 
555 template <unsigned int BITWIDTH>
556 gem5::Port &
557 Gem5ToTlmBridge<BITWIDTH>::gem5_getPort(const std::string &if_name, int idx)
558 {
559  if (if_name == "gem5")
560  return bridgeResponsePort;
561  else if (if_name == "tlm")
562  return wrapper;
563 
564  return sc_core::sc_module::gem5_getPort(if_name, idx);
565 }
566 
567 template <unsigned int BITWIDTH>
568 void
570 {
571  bridgeResponsePort.sendRangeChange();
572 
573  socket.register_nb_transport_bw(this, &Gem5ToTlmBridge::nb_transport_bw);
574  socket.register_invalidate_direct_mem_ptr(
577 }
578 
579 } // namespace sc_gem5
580 
582 gem5::Gem5ToTlmBridge32Params::create() const
583 {
584  return new sc_gem5::Gem5ToTlmBridge<32>(
585  *this, sc_core::sc_module_name(name.c_str()));
586 }
587 
589 gem5::Gem5ToTlmBridge64Params::create() const
590 {
591  return new sc_gem5::Gem5ToTlmBridge<64>(
592  *this, sc_core::sc_module_name(name.c_str()));
593 }
594 
596 gem5::Gem5ToTlmBridge128Params::create() const
597 {
599  *this, sc_core::sc_module_name(name.c_str()));
600 }
601 
603 gem5::Gem5ToTlmBridge256Params::create() const
604 {
606  *this, sc_core::sc_module_name(name.c_str()));
607 }
608 
610 gem5::Gem5ToTlmBridge512Params::create() const
611 {
613  *this, sc_core::sc_module_name(name.c_str()));
614 }
const char data[]
static Gem5Extension & getExtension(const tlm::tlm_generic_payload *payload)
Definition: sc_ext.cc:104
gem5::PacketPtr getPacket()
Definition: sc_ext.cc:119
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
Definition: addr_range.hh:82
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:294
void setBadAddress()
Definition: packet.hh:784
bool isRead() const
Definition: packet.hh:592
T * getPtr()
get a pointer to the data ptr.
Definition: packet.hh:1212
Addr getAddr() const
Definition: packet.hh:805
bool isAtomicOp() const
Definition: packet.hh:844
bool needsResponse() const
Definition: packet.hh:607
uint32_t payloadDelay
The extra pipelining delay from seeing the packet until the end of payload is transmitted by the comp...
Definition: packet.hh:448
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:1059
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
Definition: packet.hh:430
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:574
bool isWrite() const
Definition: packet.hh:593
void setBadCommand()
Definition: packet.hh:793
RequestPtr req
A pointer to the original request.
Definition: packet.hh:376
unsigned getSize() const
Definition: packet.hh:815
bool cacheResponding() const
Definition: packet.hh:657
Ports are used to interface objects to each other.
Definition: port.hh:62
@ NO_ACCESS
The request should not cause a memory access.
Definition: request.hh:146
Definition: mm.h:9
gp_t * allocate()
Definition: mm.h:55
virtual void before_end_of_elaboration()
Definition: sc_module.hh:252
virtual gem5::Port & gem5_getPort(const std::string &if_name, int idx=-1)
Definition: sc_module.cc:117
static sc_time from_value(sc_dt::uint64)
Definition: sc_time.cc:210
sc_dt::uint64 value() const
Definition: sc_time.cc:115
void before_end_of_elaboration() override
Definition: gem5_to_tlm.cc:569
void invalidate_direct_mem_ptr(sc_dt::uint64 start_range, sc_dt::uint64 end_range)
Definition: gem5_to_tlm.cc:526
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:514
gem5::Gem5ToTlmBridgeBaseParams Params
Definition: gem5_to_tlm.hh:199
gem5::Port & gem5_getPort(const std::string &if_name, int idx=-1) override
Definition: gem5_to_tlm.cc:557
STL vector class.
Definition: stl.hh:37
unsigned char * get_dmi_ptr() const
Definition: dmi.hh:58
sc_dt::uint64 get_start_address() const
Definition: dmi.hh:59
sc_dt::uint64 get_end_address() const
Definition: dmi.hh:60
bool is_read_allowed() const
Definition: dmi.hh:66
bool is_write_allowed() const
Definition: dmi.hh:71
void set_data_ptr(unsigned char *data)
Definition: gp.hh:189
void set_address(const sc_dt::uint64 address)
Definition: gp.hh:185
void set_command(const tlm_command command)
Definition: gp.hh:181
sc_dt::uint64 get_address() const
Definition: gp.hh:184
T * set_auto_extension(T *ext)
Definition: gp.hh:353
tlm_response_status get_response_status() const
Definition: gp.hh:199
void set_data_length(const unsigned int length)
Definition: gp.hh:193
bool has_mm() const
Definition: gp.hh:140
unsigned int get_data_length() const
Definition: gp.hh:192
void set_streaming_width(const unsigned int streaming_width)
Definition: gp.hh:213
int8_t Priority
Definition: eventq.hh:123
static const Priority Default_Pri
Default is zero for historical reasons.
Definition: eventq.hh:179
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:178
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Definition: logging.hh:204
Bitfield< 5, 0 > status
Definition: misc_types.hh:429
Bitfield< 10, 5 > event
Bitfield< 5 > r
Definition: pagetable.hh:60
Bitfield< 15 > system
Definition: misc.hh:1004
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
const PortID InvalidPortID
Definition: types.hh:246
Tick curTick()
The universal simulation clock.
Definition: cur_tick.hh:46
uint64_t Tick
Tick count type.
Definition: types.hh:58
const sc_time SC_ZERO_TIME
Definition: sc_time.cc:290
uint64_t uint64
Definition: sc_nbdefs.hh:172
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
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_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
std::function< void(gem5::PacketPtr pkt, tlm::tlm_generic_payload &trans)> PacketToPayloadConversionStep
Definition: gem5_to_tlm.hh:78
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
void setPacketResponse(PacketPtr pkt, tlm::tlm_generic_payload &trans)
Definition: gem5_to_tlm.cc:198
Overload hash function for BasicBlockRange type.
Definition: misc.hh:2826
@ BEGIN_RESP
Definition: phase.hh:43
@ END_RESP
Definition: phase.hh:44
@ BEGIN_REQ
Definition: phase.hh:41
@ END_REQ
Definition: phase.hh:42
@ TLM_READ_COMMAND
Definition: gp.hh:84
@ TLM_IGNORE_COMMAND
Definition: gp.hh:86
@ TLM_WRITE_COMMAND
Definition: gp.hh:85
@ TLM_OK_RESPONSE
Definition: gp.hh:91
@ TLM_COMMAND_ERROR_RESPONSE
Definition: gp.hh:95
tlm_sync_enum
Definition: fw_bw_ifs.hh:31
@ TLM_COMPLETED
Definition: fw_bw_ifs.hh:31
@ TLM_ACCEPTED
Definition: fw_bw_ifs.hh:31
@ TLM_UPDATED
Definition: fw_bw_ifs.hh:31
#define SC_REPORT_FATAL(msg_type, msg)
#define sc_assert(expr)
const std::string & name()
Definition: trace.cc:49

Generated on Wed Dec 21 2022 10:22:50 for gem5 by doxygen 1.9.1