SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
pci_device_simics_adapter.h
Go to the documentation of this file.
1/*
2 © 2014 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_IFACE_PCI_DEVICE_SIMICS_ADAPTER_H
15#define SIMICS_SYSTEMC_IFACE_PCI_DEVICE_SIMICS_ADAPTER_H
16
17#include <simics/devs/pci.h>
20
21#include <string>
22#include <vector>
23
24namespace simics {
25namespace systemc {
26namespace iface {
27
28#define DEPRECATED_FUNC(f) _deprecated_ ## f
29
31template<typename TBase, typename TInterface = PciDeviceInterface>
32class PciDeviceSimicsAdapter : public SimicsAdapter<pci_device_interface_t> {
33 public:
35 : SimicsAdapter<pci_device_interface_t>(
36 PCI_DEVICE_INTERFACE, init_iface()) {
37 }
38
39 protected:
40 static void bus_reset(conf_object_t *obj) {
41 adapter<TBase, TInterface>(obj)->bus_reset();
42 }
43 static void system_error(conf_object_t *obj) {
44 adapter<TBase, TInterface>(obj)->system_error();
45 }
46 static void interrupt_raised(conf_object_t *obj, int pin) {
47 adapter<TBase, TInterface>(obj)->interrupt_raised(pin);
48 }
49 static void interrupt_lowered(conf_object_t *obj, int pin) {
50 adapter<TBase, TInterface>(obj)->interrupt_lowered(pin);
51 }
52
53 private:
54 std::vector<std::string> description(conf_object_t *obj,
55 DescriptionType type) override {
56 return descriptionBase<TBase, TInterface>(obj, type);
57 }
58 pci_device_interface_t init_iface() {
59 pci_device_interface_t iface = {};
60 iface.bus_reset = bus_reset;
61 iface.DEPRECATED_FUNC(interrupt_acknowledge) = NULL;
62 iface.DEPRECATED_FUNC(special_cycle) = NULL;
63 iface.system_error = system_error;
64 iface.interrupt_raised = interrupt_raised;
65 iface.interrupt_lowered = interrupt_lowered;
66 return iface;
67 }
68};
69
70#undef DEPRECATED_FUNC
71
72} // namespace iface
73} // namespace systemc
74} // namespace simics
75
76#endif
Adapter for Simics pci_device interface.
Definition: pci_device_simics_adapter.h:32
static void system_error(conf_object_t *obj)
Definition: pci_device_simics_adapter.h:43
static void interrupt_raised(conf_object_t *obj, int pin)
Definition: pci_device_simics_adapter.h:46
static void interrupt_lowered(conf_object_t *obj, int pin)
Definition: pci_device_simics_adapter.h:49
static void bus_reset(conf_object_t *obj)
Definition: pci_device_simics_adapter.h:40
PciDeviceSimicsAdapter()
Definition: pci_device_simics_adapter.h:34
Base class for mapping Simics interface to a C++ interface.
Definition: simics_adapter.h:45
DescriptionType
Definition: description_interface.h:23
Definition: adapter.h:79