SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
direct_memory_update_gasket_adapter.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_SIMICS2TLM_DIRECT_MEMORY_UPDATE_GASKET_ADAPTER_H
15#define SIMICS_SYSTEMC_SIMICS2TLM_DIRECT_MEMORY_UPDATE_GASKET_ADAPTER_H
16
19
20namespace simics {
21namespace systemc {
22namespace simics2tlm {
23
29 public GasketAdapter<iface::DirectMemoryUpdateInterface> {
30 public:
32 DirectMemoryUpdateInterface *direct_mem_update,
34 : direct_mem_update_(direct_mem_update),
35 simulation_(simulation) {
36 }
38
39 // iface::DirectMemoryUpdateInterface
40 void release(conf_object_t *target,
41 direct_memory_handle_t handle,
42 direct_memory_ack_id_t id) override {
43 if (simulation_) {
44 Context context(simulation_);
45 direct_mem_update_->release(target, handle, id);
46 } else {
47 direct_mem_update_->release(target, handle, id);
48 }
49 }
50 void update_permission(conf_object_t *target,
51 direct_memory_handle_t handle,
52 access_t lost_access,
53 access_t lost_permission,
54 access_t lost_inhibit,
55 direct_memory_ack_id_t id) override {
56 if (simulation_) {
57 Context context(simulation_);
58 direct_mem_update_->update_permission(target, handle, lost_access,
59 lost_permission, lost_inhibit,
60 id);
61 } else {
62 direct_mem_update_->update_permission(target, handle, lost_access,
63 lost_permission, lost_inhibit,
64 id);
65 }
66 }
67 void conflicting_access(conf_object_t *target,
68 direct_memory_handle_t handle,
69 access_t conflicting_permission,
70 direct_memory_ack_id_t id) override {
71 if (simulation_) {
72 Context context(simulation_);
73 direct_mem_update_->conflicting_access(target, handle,
74 conflicting_permission, id);
75 } else {
76 direct_mem_update_->conflicting_access(target, handle,
77 conflicting_permission, id);
78 }
79 }
80
81 // GasketAdapter<iface::DirectMemoryUpdateInterface>
83 return dynamic_cast<simics2tlm::GasketOwner *>(direct_mem_update_);
84 }
85
86 private:
87 DirectMemoryUpdateInterface *direct_mem_update_;
88 iface::SimulationInterface *simulation_;
89};
90
91} // namespace simics2tlm
92} // namespace systemc
93} // namespace simics
94
95#endif
Utility class that handles the context switching, using RAII methodology.
Definition: context.h:31
Simics direct_memory_update interface.
Definition: direct_memory_update_interface.h:24
Interface to the SystemC simulation.
Definition: simulation_interface.h:25
Adapter for DirectMemoryUpdate gasket.
Definition: direct_memory_update_gasket_adapter.h:29
void conflicting_access(conf_object_t *target, direct_memory_handle_t handle, access_t conflicting_permission, direct_memory_ack_id_t id) override
Definition: direct_memory_update_gasket_adapter.h:67
void update_permission(conf_object_t *target, direct_memory_handle_t handle, access_t lost_access, access_t lost_permission, access_t lost_inhibit, direct_memory_ack_id_t id) override
Definition: direct_memory_update_gasket_adapter.h:50
DirectMemoryUpdateGasketAdapter(DirectMemoryUpdateInterface *direct_mem_update, iface::SimulationInterface *simulation)
Definition: direct_memory_update_gasket_adapter.h:31
simics2tlm::GasketOwner * gasket_owner() const override
Definition: direct_memory_update_gasket_adapter.h:82
void release(conf_object_t *target, direct_memory_handle_t handle, direct_memory_ack_id_t id) override
Definition: direct_memory_update_gasket_adapter.h:40
Definition: gasket_adapter.h:43
Base class, responsible for handling a gasket.
Definition: gasket_owner.h:30
Definition: adapter.h:79