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// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2018 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_DEVICE_ACCESS_H
17#define SIMICS_SYSTEMC_DEVICE_ACCESS_H
18
22
23namespace simics {
24namespace systemc {
25
27template <typename T>
29 public:
31 T *device_pointer)
32 : context_(simulation), kernel_state_modifier_(simulation),
33 device_pointer_(device_pointer) {
34 }
36 return *device_pointer_;
37 }
38 const T &operator* () const {
39 return *device_pointer_;
40 }
42 return device_pointer_;
43 }
44 const T *operator->() const {
45 return device_pointer_;
46 }
47 virtual ~DeviceAccess() {
48 }
49
50 protected:
54};
55
56} // namespace systemc
57} // namespace simics
58
59#endif
Utility class that handles the context switching, using RAII methodology.
Definition: context.h:31
Definition: device_access.h:28
virtual ~DeviceAccess()
Definition: device_access.h:47
DeviceAccess(iface::SimulationInterface *simulation, T *device_pointer)
Definition: device_access.h:30
T * device_pointer_
Definition: device_access.h:53
KernelStateModifier kernel_state_modifier_
Definition: device_access.h:52
const T * operator->() const
Definition: device_access.h:44
T & operator*()
Definition: device_access.h:35
T * operator->()
Definition: device_access.h:41
Context context_
Definition: device_access.h:51
Definition: kernel_state_modifier.h:30
Interface to the SystemC simulation.
Definition: simulation_interface.h:27
Definition: pci_bus_interface.h:24