SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
extension_sender.h
Go to the documentation of this file.
1/*
2 © 2015 Intel Corporation
3
4 This software and the related documents are Intel copyrighted materials, and
5 your use of them is governed by the express license under which they were
6 provided to you ("License"). Unless the License provides otherwise, you may
7 not use, modify, copy, publish, distribute, disclose or transmit this software
8 or the related documents without Intel's prior written permission.
9
10 This software and the related documents are provided as is, with no express or
11 implied warranties, other than those that are expressly stated in the License.
12*/
13
14#ifndef SIMICS_SYSTEMC_IFACE_EXTENSION_SENDER_H
15#define SIMICS_SYSTEMC_IFACE_EXTENSION_SENDER_H
16
20
21#include <tlm>
22
23namespace simics {
24namespace systemc {
25namespace iface {
26
32template<typename TSocket>
34 public:
36 : socket_(NULL), delay_(sc_core::SC_ZERO_TIME), payload_(NULL) {
37 }
38 void init(TSocket *socket) {
39 socket_ = socket;
40 }
41 void set_delay(sc_core::sc_time delay) {
42 delay_ = delay;
43 }
44 void set_payload(tlm::tlm_generic_payload *payload) {
45 payload_ = payload;
46 }
48 if (payload_)
49 return Transaction(payload_);
50
51 return pool_.acquire();
52 }
54 (*socket_)->b_transport(*transaction, delay_);
55 }
57 SC_REPORT_ERROR("/intel/ExtensionSender",
58 "Extension not processed correctly.");
59 }
60 virtual ~ExtensionSender() {}
61
62 private:
63 TSocket *socket_;
64 sc_core::sc_time delay_;
65 tlm::tlm_generic_payload *payload_;
66 TransactionPool pool_;
67};
68
69} // namespace iface
70} // namespace systemc
71} // namespace simics
72
73#endif
Interface used by Extension class to send the extension.
Definition: extension_sender_interface.h:24
Generic extension sender initialized with a TLM2 initiator socket of TSocket type.
Definition: extension_sender.h:33
void send_extension(Transaction *transaction) override
Called by extension after the extension is set on the payload.
Definition: extension_sender.h:53
void init(TSocket *socket)
Definition: extension_sender.h:38
ExtensionSender()
Definition: extension_sender.h:35
virtual ~ExtensionSender()
Definition: extension_sender.h:60
Transaction transaction() override
Called by extension to get a new Transaction.
Definition: extension_sender.h:47
void set_delay(sc_core::sc_time delay)
Definition: extension_sender.h:41
void send_failed(Transaction *transaction) override
Called by extension if method_call invocation was missing.
Definition: extension_sender.h:56
void set_payload(tlm::tlm_generic_payload *payload)
Definition: extension_sender.h:44
A memory manager that implements the tlm::tlm_mm_interface providing a pool of transaction objects.
Definition: transaction_pool.h:32
Transaction acquire()
Definition: transaction_pool.h:78
Class that encapsulates a generic_payload and returns it to the TransactionPool when the Transaction ...
Definition: transaction.h:29
Definition: argument_registry.h:24
Definition: adapter.h:79