SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
transaction.h
Go to the documentation of this file.
1/*
2 © 2019 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 TLM2SIMICS_TRANSACTION_H
15#define TLM2SIMICS_TRANSACTION_H
16
19#include <vector>
20
21namespace simics {
22namespace systemc {
23namespace tlm2simics {
24
25//:: pre tlm2simics_Transaction {{
30 public:
32 virtual ~Transaction();
33
34 // DmiTransactionHandler
35 void set_gasket(GasketInterface::Ptr gasketInterface) override;
36 private:
37 tlm::tlm_response_status simics_transaction(
38 ConfObjectRef &simics_obj,
39 tlm::tlm_generic_payload *trans) override;
40 unsigned int debug_transaction(ConfObjectRef &simics_obj,
41 tlm::tlm_generic_payload *trans) override;
42
43 unsigned int transaction(ConfObjectRef &simics_obj, // NOLINT
44 tlm::tlm_generic_payload *trans, bool inquiry);
45
46 /*
47 * Update the Simics transaction atoms before sending it to the Simics side
48 * By default, it is empty since the basic required atoms are already filled.
49 * It can be used to update the existing atoms or add new customized atoms.
50 *
51 * @param tlm_transaction the TLM transaction received from SystemC side
52 * @param atoms the atoms used in the Simics transaction sent to the Simics
53 * side. No need to add ATOM_LIST_END here.
54 */
55 virtual void add_custom_atoms(
56 const tlm::tlm_generic_payload *tlm_transaction,
57 std::vector<atom_t> *atoms) {}
58
59 class UpdateTarget : public InterfaceProvider::TargetUpdateListener {
60 public:
61 UpdateTarget() : map_target_(NULL) {}
62 virtual ~UpdateTarget() {
63 if (map_target_)
64 SIM_free_map_target(map_target_);
65 }
66
67 // InterfaceProvider::TargetUpdateListener
68 void update_target(ConfObjectRef old_target,
69 ConfObjectRef new_target) override {
70 if (map_target_) {
71 SIM_free_map_target(map_target_);
72 map_target_ = nullptr;
73 }
74
75 if (new_target) {
76 map_target_ = SIM_new_map_target(new_target.object(),
77 NULL, NULL);
78 }
79 }
80
81 map_target_t *map_target() {
82 return map_target_;
83 }
84
85 private:
86 map_target_t *map_target_;
87 };
88
89 UpdateTarget update_target_;
90 // The proxy object for the target_socket used in this gasket
91 conf_object_t *target_socket_proxy_obj_ {nullptr};
92};
93// }}
94
95} // namespace tlm2simics
96} // namespace systemc
97} // namespace simics
98
99#endif
Returns the interface provided by the associated Simics object.
Definition: interface_provider.h:30
Base class for transaction handlers that support DMI.
Definition: dmi_transaction_handler.h:30
std::shared_ptr< GasketInterface > Ptr
Definition: gasket_interface.h:30
Protocol specific transaction handler for Simics transaction interface.
Definition: transaction.h:29
void set_gasket(GasketInterface::Ptr gasketInterface) override
Definition: adapter.h:79