SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
pcie_device_extension.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_EXTENSION_H
15#define SIMICS_SYSTEMC_IFACE_PCIE_DEVICE_EXTENSION_H
16
19
20namespace simics {
21namespace systemc {
22namespace iface {
23
26 : public Extension<PcieDeviceExtension,
27 simics::systemc::iface::PcieDeviceInterface> {
28 public:
30 switch (method_.value<Method>()) {
31 case CONNECTED:
32 device->connected(method_input_[0].value<conf_object_t *>(),
33 method_input_[1].value<uint16_t>());
34 break;
35 case DISCONNECTED:
36 device->disconnected(method_input_[0].value<conf_object_t *>(),
37 method_input_[1].value<uint16_t>());
38 break;
39 case HOT_RESET:
40 device->hot_reset();
41 break;
42 }
43 }
44
45 void connected(conf_object_t *port_obj, uint16_t device_id) override {
46 method_input_.push_back(port_obj);
47 method_input_.push_back(device_id);
48 method_ = CONNECTED;
49 send();
50 }
51 void disconnected(conf_object_t *port_obj, uint16_t device_id) override {
52 method_input_.push_back(port_obj);
53 method_input_.push_back(device_id);
54 method_ = DISCONNECTED;
55 send();
56 }
57 void hot_reset() override {
58 method_ = HOT_RESET;
59 send();
60 }
61
62 private:
63 enum Method {
64 CONNECTED,
65 DISCONNECTED,
66 HOT_RESET
67 };
68};
69
70} // namespace iface
71} // namespace systemc
72} // namespace simics
73
74#endif
Base class for TLM2 extension, responsible for marshal/unmarshal of a Simics interface.
Definition: extension.h:38
Extension for Simics pcie_device interface.
Definition: pcie_device_extension.h:27
void call(simics::systemc::iface::PcieDeviceInterface *device) override
Definition: pcie_device_extension.h:29
void hot_reset() override
Definition: pcie_device_extension.h:57
void connected(conf_object_t *port_obj, uint16_t device_id) override
Definition: pcie_device_extension.h:45
void disconnected(conf_object_t *port_obj, uint16_t device_id) override
Definition: pcie_device_extension.h:51
Simics pcie_device interface.
Definition: pcie_device_interface.h:25
virtual void connected(conf_object_t *port_obj, uint16_t device_id)=0
virtual void disconnected(conf_object_t *port_obj, uint16_t device_id)=0
T value()
Definition: any_type.h:87
Definition: adapter.h:79