SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
pcie_device_simics_adapter.h
Go to the documentation of this file.
1/*
2 © 2024 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_PCIE_DEVICE_SIMICS_ADAPTER_H
15#define SIMICS_SYSTEMC_IFACE_PCIE_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
29template<typename TBase, typename TInterface = PcieDeviceInterface>
30class PcieDeviceSimicsAdapter : public SimicsAdapter<pcie_device_interface_t> {
31 public:
33 : SimicsAdapter<pcie_device_interface_t>(
34 PCIE_DEVICE_INTERFACE, init_iface()) {
35 }
36
37 protected:
38 static void connected(conf_object_t *obj, conf_object_t *port_obj,
39 uint16 device_id) {
40 adapter<TBase, TInterface>(obj)->connected(port_obj, device_id);
41 }
42 static void disconnected(conf_object_t *obj, conf_object_t *port_obj,
43 uint16 device_id) {
44 adapter<TBase, TInterface>(obj)->disconnected(port_obj, device_id);
45 }
46 static void hot_reset(conf_object_t *obj) {
47 adapter<TBase, TInterface>(obj)->hot_reset();
48 }
49
50 private:
51 std::vector<std::string> description(conf_object_t *obj,
52 DescriptionType type) override {
53 return descriptionBase<TBase, TInterface>(obj, type);
54 }
55 pcie_device_interface_t init_iface() {
56 pcie_device_interface_t iface = {};
57 iface.connected = connected;
58 iface.disconnected = disconnected;
59 iface.hot_reset = hot_reset;
60 return iface;
61 }
62};
63
64} // namespace iface
65} // namespace systemc
66} // namespace simics
67
68#endif
Adapter for Simics pcie_device interface.
Definition: pcie_device_simics_adapter.h:30
static void hot_reset(conf_object_t *obj)
Definition: pcie_device_simics_adapter.h:46
PcieDeviceSimicsAdapter()
Definition: pcie_device_simics_adapter.h:32
static void disconnected(conf_object_t *obj, conf_object_t *port_obj, uint16 device_id)
Definition: pcie_device_simics_adapter.h:42
static void connected(conf_object_t *obj, conf_object_t *port_obj, uint16 device_id)
Definition: pcie_device_simics_adapter.h:38
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