gem5 v24.0.0.0
Loading...
Searching...
No Matches
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
73using namespace gem5;
74
75namespace 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
102namespace
103{
107std::vector<PacketToPayloadConversionStep> extraPacketToPayloadSteps;
108} // namespace
109
118void
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());
156
157 /* Check if this transaction was allocated by mm */
158 sc_assert(trans->has_mm());
159
160 unsigned int size = packet->getSize();
161 unsigned char *data = packet->getPtr<unsigned char>();
162
163 trans->set_data_length(size);
164 trans->set_streaming_width(size);
165 trans->set_data_ptr(data);
166
167 if ((packet->req->getFlags() & Request::NO_ACCESS) != 0) {
168 /* Do nothing */
170 } else if (packet->isRead()) {
172 } else if (packet->isWrite()) {
174 } else {
176 }
177
178 // Attach the packet pointer to the TLM transaction to keep track.
179 auto *extension = new Gem5SystemC::Gem5Extension(packet);
180 trans->set_auto_extension(extension);
181
182 if (packet->isAtomicOp()) {
183 auto *atomic_ex = new Gem5SystemC::AtomicExtension(
184 std::shared_ptr<AtomicOpFunctor>(
185 packet->req->getAtomicOpFunctor()->clone()),
186 packet->req->isAtomicReturn());
187 trans->set_auto_extension(atomic_ex);
188 }
189
190 // Apply all conversion steps necessary in this specific setup.
191 for (auto &step : extraPacketToPayloadSteps) {
192 step(packet, *trans);
193 }
194
195 return trans;
196}
197
198void
200{
201 pkt->makeResponse();
202
203 auto resp = trans.get_response_status();
204 switch (resp) {
206 break;
208 pkt->setBadCommand();
209 break;
210 default:
211 pkt->setBadAddress();
212 break;
213 }
214}
215
216template <unsigned int BITWIDTH>
217void
219 tlm::tlm_generic_payload &trans, const tlm::tlm_phase &phase)
220{
221 sc_core::sc_time delay;
222
223 if (phase == tlm::END_REQ ||
224 (&trans == blockingRequest && phase == tlm::BEGIN_RESP)) {
225 sc_assert(&trans == blockingRequest);
226 blockingRequest = nullptr;
227
228 // Did another request arrive while blocked, schedule a retry.
229 if (needToSendRequestRetry) {
230 needToSendRequestRetry = false;
231 bridgeResponsePort.sendRetryReq();
232 }
233 }
234 if (phase == tlm::BEGIN_RESP) {
235 PacketPtr packet = packetMap[&trans];
236
237 sc_assert(!blockingResponse);
238 sc_assert(packet);
239
240 bool need_retry = false;
241
242 // If there is another gem5 model under the receiver side, and already
243 // make a response packet back, we can simply send it back. Otherwise,
244 // we make a response packet before sending it back to the initiator
245 // side gem5 module.
246 if (packet->needsResponse()) {
247 setPacketResponse(packet, trans);
248 }
249 if (packet->isResponse()) {
250 need_retry = !bridgeResponsePort.sendTimingResp(packet);
251 }
252
253 if (need_retry) {
254 blockingResponse = &trans;
255 } else {
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
267template <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)
299template <unsigned int BITWIDTH>
300Tick
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
324template <unsigned int BITWIDTH>
325Tick
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
358template <unsigned int BITWIDTH>
359void
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).
368template <unsigned int BITWIDTH>
369bool
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 packetMap.emplace(trans, packet);
437 } else if (status == tlm::TLM_UPDATED) {
438 // The Timing annotation must be honored:
439 sc_assert(phase == tlm::END_REQ || phase == tlm::BEGIN_RESP);
440 // Accepted but is now blocking until END_REQ (exclusion rule).
441 blockingRequest = trans;
442 packetMap.emplace(trans, packet);
443 auto cb = [this, trans, phase]() { pec(*trans, phase); };
444 auto event = new EventFunctionWrapper(
445 cb, "pec", true, getPriorityOfTlmPhase(phase));
446 system->schedule(event, curTick() + delay.value());
447 } else if (status == tlm::TLM_COMPLETED) {
448 // Transaction is over nothing has do be done.
449 sc_assert(phase == tlm::END_RESP);
450 trans->release();
451 }
452
453 return true;
454}
455
456template <unsigned int BITWIDTH>
457bool
459{
460 // Snooping should be implemented with tlm_dbg_transport.
461 SC_REPORT_FATAL("Gem5ToTlmBridge",
462 "unimplemented func.: recvTimingSnoopResp");
463 return false;
464}
465
466template <unsigned int BITWIDTH>
467bool
469{
470 panic("tryTiming(PacketPtr) isn't implemented.");
471}
472
473template <unsigned int BITWIDTH>
474void
476{
477 /* Retry a response */
478 sc_assert(blockingResponse);
479
480 tlm::tlm_generic_payload *trans = blockingResponse;
481 blockingResponse = nullptr;
482
483 PacketPtr packet = packetMap[trans];
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.
499template <unsigned int BITWIDTH>
500void
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
516template <unsigned int BITWIDTH>
517void
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
541template <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
553template <unsigned int BITWIDTH>
554void
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
571template <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
584template <unsigned int BITWIDTH>
586Gem5ToTlmBridge<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
596template <unsigned int BITWIDTH>
597void
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
611gem5::Gem5ToTlmBridge32Params::create() const
612{
614 *this, sc_core::sc_module_name(name.c_str()));
615}
616
618gem5::Gem5ToTlmBridge64Params::create() const
619{
621 *this, sc_core::sc_module_name(name.c_str()));
622}
623
625gem5::Gem5ToTlmBridge128Params::create() const
626{
628 *this, sc_core::sc_module_name(name.c_str()));
629}
630
632gem5::Gem5ToTlmBridge256Params::create() const
633{
635 *this, sc_core::sc_module_name(name.c_str()));
636}
637
639gem5::Gem5ToTlmBridge512Params::create() const
640{
642 *this, sc_core::sc_module_name(name.c_str()));
643}
const char data[]
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
Definition addr_range.hh:82
bool writeable() const
Definition backdoor.hh:143
const AddrRange & range() const
Definition backdoor.hh:140
bool readable() const
Definition backdoor.hh:142
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition packet.hh:295
void setBadAddress()
Definition packet.hh:786
bool isRead() const
Definition packet.hh:593
Addr getAddr() const
Definition packet.hh:807
bool isAtomicOp() const
Definition packet.hh:846
bool isResponse() const
Definition packet.hh:598
bool needsResponse() const
Definition packet.hh:608
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
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
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
Definition packet.hh:431
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
T * getPtr()
get a pointer to the data ptr.
Definition packet.hh:1225
bool isWrite() const
Definition packet.hh:594
void setBadCommand()
Definition packet.hh:795
RequestPtr req
A pointer to the original request.
Definition packet.hh:377
unsigned getSize() const
Definition packet.hh:817
bool cacheResponding() const
Definition packet.hh:659
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
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)
void recvMemBackdoorReq(const gem5::MemBackdoorReq &req, gem5::MemBackdoorPtr &backdoor)
tlm::tlm_sync_enum nb_transport_bw(tlm::tlm_generic_payload &trans, tlm::tlm_phase &phase, sc_core::sc_time &t)
gem5::MemBackdoorPtr getBackdoor(tlm::tlm_generic_payload &trans)
gem5::Gem5ToTlmBridgeBaseParams Params
Gem5ToTlmBridge(const Params &p, const sc_core::sc_module_name &mn)
void recvFunctionalSnoop(gem5::PacketPtr packet)
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)
void recvFunctional(gem5::PacketPtr packet)
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
T * set_auto_extension(T *ext)
Definition gp.hh:353
void set_response_status(const tlm_response_status response_status)
Definition gp.hh:204
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
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
Addr start() const
Get the start address of the range.
Addr size() const
Get the size of the address range.
int8_t Priority
Definition eventq.hh:126
static const Priority Default_Pri
Default is zero for historical reasons.
Definition eventq.hh:182
#define panic(...)
This implements a cprintf based panic() function.
Definition logging.hh:188
#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
Bitfield< 5, 0 > status
Bitfield< 10, 5 > event
Bitfield< 15 > system
Definition misc.hh:1032
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
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
std::function< void(gem5::PacketPtr pkt, tlm::tlm_generic_payload &trans)> PacketToPayloadConversionStep
Gem5SystemC::MemoryManager mm
Instantiate a tlm memory manager that takes care about all the tlm transactions in the system.
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.
static EventBase::Priority getPriorityOfTlmPhase(const tlm::tlm_phase &phase)
Helper function to help set priority of phase change events of tlm transactions.
void setPacketResponse(PacketPtr pkt, tlm::tlm_generic_payload &trans)
Overload hash function for BasicBlockRange type.
Definition binary32.hh:81
@ 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_INCOMPLETE_RESPONSE
Definition gp.hh:92
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:48

Generated on Tue Jun 18 2024 16:24:07 for gem5 by doxygen 1.11.0