SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
pcie_device_query_interface.h
Go to the documentation of this file.
1/* -*- C++ -*-
2
3 © 2024 Intel Corporation
4
5 This software and the related documents are Intel copyrighted materials, and
6 your use of them is governed by the express license under which they were
7 provided to you ("License"). Unless the License provides otherwise, you may
8 not use, modify, copy, publish, distribute, disclose or transmit this software
9 or the related documents without Intel's prior written permission.
10
11 This software and the related documents are provided as is, with no express or
12 implied warranties, other than those that are expressly stated in the License.
13*/
14
15#ifndef SIMICS_SYSTEMC_IFACE_PCIE_DEVICE_QUERY_INTERFACE_H
16#define SIMICS_SYSTEMC_IFACE_PCIE_DEVICE_QUERY_INTERFACE_H
17
18#include <systemc>
19#include <cstdint>
20#include <vector>
21
22namespace simics {
23namespace systemc {
24namespace iface {
25
29//:: pre PcieDeviceQueryInterface {{
31 public:
32 virtual ~PcieDeviceQueryInterface() = default;
33
34 // A multi-function device should pass a multi_passthrough_target_socket
35 // for the config space of all functions, and that each function is
36 // connected to this target socket in ascending id order.
37 virtual sc_core::sc_object *getConfigTargetSocket() = 0;
38 // Returns the target socket to receive PCIe message
39 virtual sc_core::sc_object *getMsgTargetSocket() = 0;
40 // Returns the initiator socket to send upstream transaction
41 virtual sc_core::sc_object *getPcieMapInitiatorSocket() = 0;
42};
43// }}
44
50//:: pre PcieBaseAddressRegisterQueryInterface/Header {{
52 public:
53// }}
55
71 //:: pre PcieBaseAddressRegisterQueryInterface/BAR {{
72 struct PCIeBar {
74 int offset;
75 bool is_memory;
76 bool is_64bit;
78 sc_core::sc_object *target_socket;
79 };
80 // }}
81
88 //:: pre PcieBaseAddressRegisterQueryInterface/Footer {{
89 virtual std::vector<PCIeBar> getBarInfo() = 0;
90};
91// }}
92
94 public:
95 virtual ~PcieResetInterface() = default;
96
97 virtual void functionLevelReset(int function_number) = 0;
98 virtual void warmReset() = 0;
99 virtual void hotReset() = 0;
100};
101
106 // Function number of the PF that exposes VFs
108 // Byte offset of SR-IOV Extended Capability in PF config space
109 uint16_t cap_offset;
110 // Hardware maximum: TotalVFs
112 // First VF Function: function number of VF0
114 // VF Stride: step between consecutive VF function numbers
116};
117
125 public:
126 virtual ~PcieSriovQueryInterface() = default;
128 virtual std::vector<PcieSriovInfo> getSriovInfo() = 0;
129};
130
131} // namespace iface
132} // namespace systemc
133} // namespace simics
134
135#endif
Interface that allows the Simics glue to perform snooping and automatic connection of the device's ta...
Definition: pcie_device_query_interface.h:51
virtual std::vector< PCIeBar > getBarInfo()=0
BAR register information.
Interface required from a SystemC PCIe device in order to connect to Simics.
Definition: pcie_device_query_interface.h:30
virtual sc_core::sc_object * getMsgTargetSocket()=0
virtual sc_core::sc_object * getConfigTargetSocket()=0
virtual sc_core::sc_object * getPcieMapInitiatorSocket()=0
Definition: pcie_device_query_interface.h:93
virtual void functionLevelReset(int function_number)=0
Interface providing static SR-IOV configuration to the PcieMappingInterconnect.
Definition: pcie_device_query_interface.h:124
virtual std::vector< PcieSriovInfo > getSriovInfo()=0
Returns one entry per PF that exposes VFs.
Definition: adapter.h:81
Base Address Register (BAR) configuration.
Definition: pcie_device_query_interface.h:72
int size_bits
Size of BAR, in number of bits.
Definition: pcie_device_query_interface.h:77
bool is_memory
If it is a Memory BAR?
Definition: pcie_device_query_interface.h:75
int function
Function number of the device.
Definition: pcie_device_query_interface.h:73
sc_core::sc_object * target_socket
Where to direct the access.
Definition: pcie_device_query_interface.h:78
bool is_64bit
For memory BAR, is it 64-bit or 32-bit?
Definition: pcie_device_query_interface.h:76
int offset
BAR offset in Configuration Space Header.
Definition: pcie_device_query_interface.h:74
Static SR-IOV configuration for one PF that exposes Virtual Functions.
Definition: pcie_device_query_interface.h:105
int total_vfs
Definition: pcie_device_query_interface.h:111
int first_vf_function
Definition: pcie_device_query_interface.h:113
int vf_stride
Definition: pcie_device_query_interface.h:115
uint16_t cap_offset
Definition: pcie_device_query_interface.h:109
int pf_function
Definition: pcie_device_query_interface.h:107