SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
device_access.h
Go to the documentation of this file.
1/*
2 © 2018 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_DEVICE_ACCESS_H
15#define SIMICS_SYSTEMC_DEVICE_ACCESS_H
16
20
21namespace simics {
22namespace systemc {
23
25template <typename T>
27 public:
29 T *device_pointer)
30 : context_(simulation), kernel_state_modifier_(simulation),
31 device_pointer_(device_pointer) {
32 }
34 return *device_pointer_;
35 }
36 const T &operator* () const {
37 return *device_pointer_;
38 }
40 return device_pointer_;
41 }
42 const T *operator->() const {
43 return device_pointer_;
44 }
45 virtual ~DeviceAccess() {
46 }
47
48 protected:
52};
53
54} // namespace systemc
55} // namespace simics
56
57#endif
Utility class that handles the context switching, using RAII methodology.
Definition: context.h:31
Definition: device_access.h:26
virtual ~DeviceAccess()
Definition: device_access.h:45
DeviceAccess(iface::SimulationInterface *simulation, T *device_pointer)
Definition: device_access.h:28
T * device_pointer_
Definition: device_access.h:51
KernelStateModifier kernel_state_modifier_
Definition: device_access.h:50
const T * operator->() const
Definition: device_access.h:42
T & operator*()
Definition: device_access.h:33
T * operator->()
Definition: device_access.h:39
Context context_
Definition: device_access.h:49
Definition: kernel_state_modifier.h:31
Interface to the SystemC simulation.
Definition: simulation_interface.h:25
Definition: adapter.h:79