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// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2015 Intel Corporation
5
6 This software and the related documents are Intel copyrighted materials, and
7 your use of them is governed by the express license under which they were
8 provided to you ("License"). Unless the License provides otherwise, you may
9 not use, modify, copy, publish, distribute, disclose or transmit this software
10 or the related documents without Intel's prior written permission.
11
12 This software and the related documents are provided as is, with no express or
13 implied warranties, other than those that are expressly stated in the License.
14*/
15
16#ifndef SIMICS_SYSTEMC_IFACE_EXTENSION_SENDER_H
17#define SIMICS_SYSTEMC_IFACE_EXTENSION_SENDER_H
18
22
23#include <tlm>
24
25namespace simics {
26namespace systemc {
27namespace iface {
28
34template<typename TSocket>
36 public:
38 : socket_(NULL), delay_(sc_core::SC_ZERO_TIME), payload_(NULL) {
39 }
40 void init(TSocket *socket) {
41 socket_ = socket;
42 }
43 void set_delay(sc_core::sc_time delay) {
44 delay_ = delay;
45 }
46 void set_payload(tlm::tlm_generic_payload *payload) {
47 payload_ = payload;
48 }
50 if (payload_)
51 return Transaction(payload_);
52
53 return pool_.acquire();
54 }
56 (*socket_)->b_transport(*transaction, delay_);
57 }
59 // TODO(ah): SC_REPORT_ERROR might end up as a critical in Simics,
60 // which stops the simulation. Is this what we wanted? A critical
61 // sounds a bit harsh, while an error is more correct. How do we
62 // achieve that?
63 SC_REPORT_ERROR("/intel/ExtensionSender",
64 "Extension not processed correctly.");
65 }
66 virtual ~ExtensionSender() {}
67
68 private:
69 TSocket *socket_;
70 sc_core::sc_time delay_;
71 tlm::tlm_generic_payload *payload_;
72 TransactionPool pool_;
73};
74
75} // namespace iface
76} // namespace systemc
77} // namespace simics
78
79#endif
Interface used by Extension class to send the extension.
Definition: extension_sender_interface.h:26
Generic extension sender initialized with a TLM2 initiator socket of TSocket type.
Definition: extension_sender.h:35
virtual void send_failed(Transaction *transaction)
Called by extension if method_call invocation was missing.
Definition: extension_sender.h:58
void init(TSocket *socket)
Definition: extension_sender.h:40
virtual Transaction transaction()
Called by extension to get a new Transaction.
Definition: extension_sender.h:49
ExtensionSender()
Definition: extension_sender.h:37
virtual ~ExtensionSender()
Definition: extension_sender.h:66
void set_delay(sc_core::sc_time delay)
Definition: extension_sender.h:43
virtual void send_extension(Transaction *transaction)
Called by extension after the extension is set on the payload.
Definition: extension_sender.h:55
void set_payload(tlm::tlm_generic_payload *payload)
Definition: extension_sender.h:46
A memory manager that implements the tlm::tlm_mm_interface providing a pool of transaction objects.
Definition: transaction_pool.h:34
Transaction acquire()
Definition: transaction_pool.h:63
Class that encapsulates a generic_payload and returns it to the TransactionPool when the Transaction ...
Definition: transaction.h:31
Definition: argument_registry.h:26
Definition: pci_bus_interface.h:24