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