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// -*- 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_SIMICS2TLM_DIRECT_MEMORY_UPDATE_GASKET_ADAPTER_H
17#define SIMICS_SYSTEMC_SIMICS2TLM_DIRECT_MEMORY_UPDATE_GASKET_ADAPTER_H
18
21
22namespace simics {
23namespace systemc {
24namespace simics2tlm {
25
31 public GasketAdapter<iface::DirectMemoryUpdateInterface> {
32 public:
34 DirectMemoryUpdateInterface *direct_mem_update,
36 : direct_mem_update_(direct_mem_update),
37 simulation_(simulation) {
38 }
40
41 // iface::DirectMemoryUpdateInterface
42 void release(conf_object_t *target,
43 direct_memory_handle_t handle,
44 direct_memory_ack_id_t id) override {
45 if (simulation_) {
46 Context context(simulation_);
47 direct_mem_update_->release(target, handle, id);
48 } else {
49 direct_mem_update_->release(target, handle, id);
50 }
51 }
52 void update_permission(conf_object_t *target,
53 direct_memory_handle_t handle,
54 access_t lost_access,
55 access_t lost_permission,
56 access_t lost_inhibit,
57 direct_memory_ack_id_t id) override {
58 if (simulation_) {
59 Context context(simulation_);
60 direct_mem_update_->update_permission(target, handle, lost_access,
61 lost_permission, lost_inhibit,
62 id);
63 } else {
64 direct_mem_update_->update_permission(target, handle, lost_access,
65 lost_permission, lost_inhibit,
66 id);
67 }
68 }
69 void conflicting_access(conf_object_t *target,
70 direct_memory_handle_t handle,
71 access_t conflicting_permission,
72 direct_memory_ack_id_t id) override {
73 if (simulation_) {
74 Context context(simulation_);
75 direct_mem_update_->conflicting_access(target, handle,
76 conflicting_permission, id);
77 } else {
78 direct_mem_update_->conflicting_access(target, handle,
79 conflicting_permission, id);
80 }
81 }
82
83 // GasketAdapter<iface::DirectMemoryUpdateInterface>
85 return dynamic_cast<simics2tlm::GasketOwner *>(direct_mem_update_);
86 }
87
88 private:
89 DirectMemoryUpdateInterface *direct_mem_update_;
90 iface::SimulationInterface *simulation_;
91};
92
93} // namespace simics2tlm
94} // namespace systemc
95} // namespace simics
96
97#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:26
Interface to the SystemC simulation.
Definition: simulation_interface.h:27
Adapter for DirectMemoryUpdate gasket.
Definition: direct_memory_update_gasket_adapter.h:31
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:69
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:52
DirectMemoryUpdateGasketAdapter(DirectMemoryUpdateInterface *direct_mem_update, iface::SimulationInterface *simulation)
Definition: direct_memory_update_gasket_adapter.h:33
simics2tlm::GasketOwner * gasket_owner() const override
Definition: direct_memory_update_gasket_adapter.h:84
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:42
Definition: gasket_adapter.h:45
Base class, responsible for handling a gasket.
Definition: gasket_owner.h:32
Definition: pci_bus_interface.h:24