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