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// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2024 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_IFACE_PCIE_DEVICE_SIMICS_ADAPTER_H
17#define SIMICS_SYSTEMC_IFACE_PCIE_DEVICE_SIMICS_ADAPTER_H
18
19#include <simics/devs/pci.h>
22
23#include <string>
24#include <vector>
25
26namespace simics {
27namespace systemc {
28namespace iface {
29
31template<typename TBase, typename TInterface = PcieDeviceInterface>
32class PcieDeviceSimicsAdapter : public SimicsAdapter<pcie_device_interface_t> {
33 public:
35 : SimicsAdapter<pcie_device_interface_t>(
36 PCIE_DEVICE_INTERFACE, init_iface()) {
37 }
38
39 protected:
40 static void connected(conf_object_t *obj, conf_object_t *port_obj,
41 uint16 device_id) {
42 adapter<TBase, TInterface>(obj)->connected(port_obj, device_id);
43 }
44 static void disconnected(conf_object_t *obj, conf_object_t *port_obj,
45 uint16 device_id) {
46 adapter<TBase, TInterface>(obj)->disconnected(port_obj, device_id);
47 }
48 static void hot_reset(conf_object_t *obj) {
49 adapter<TBase, TInterface>(obj)->hot_reset();
50 }
51
52 private:
53 std::vector<std::string> description(conf_object_t *obj,
54 DescriptionType type) {
55 return descriptionBase<TBase, TInterface>(obj, type);
56 }
57 pcie_device_interface_t init_iface() {
58 pcie_device_interface_t iface = {};
59 iface.connected = connected;
60 iface.disconnected = disconnected;
61 iface.hot_reset = hot_reset;
62 return iface;
63 }
64};
65
66} // namespace iface
67} // namespace systemc
68} // namespace simics
69
70#endif
Adapter for Simics pcie_device interface.
Definition: pcie_device_simics_adapter.h:32
static void hot_reset(conf_object_t *obj)
Definition: pcie_device_simics_adapter.h:48
PcieDeviceSimicsAdapter()
Definition: pcie_device_simics_adapter.h:34
static void disconnected(conf_object_t *obj, conf_object_t *port_obj, uint16 device_id)
Definition: pcie_device_simics_adapter.h:44
static void connected(conf_object_t *obj, conf_object_t *port_obj, uint16 device_id)
Definition: pcie_device_simics_adapter.h:40
Base class for mapping Simics interface to a C++ interface.
Definition: simics_adapter.h:47
DescriptionType
Definition: description_interface.h:25
Definition: adapter.h:80