SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
pci_express_extension.h
Go to the documentation of this file.
1/*
2 © 2015 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_PCI_EXPRESS_EXTENSION_H
15#define SIMICS_SYSTEMC_IFACE_PCI_EXPRESS_EXTENSION_H
16
17#if defined SIMICS_6_API || defined SHOW_OBSOLETE_API
18
21
22#include <vector>
23
24namespace simics {
25namespace systemc {
26namespace iface {
27
29class PciExpressExtension : public Extension<PciExpressExtension,
30 PciExpressInterface> {
31 public:
32 void call(PciExpressInterface *device) override {
33 switch (method_.value<Method>()) {
34 case SEND_MESSAGE:
35 method_return_ = device->send_message(
36 method_input_[0].value<int>(),
37 method_input_[1].value<const std::vector<uint8_t> >());
38 }
39 }
40
41 int send_message(int type, const std::vector<uint8_t> &payload) override {
42 method_ = SEND_MESSAGE;
43 method_input_.push_back(type);
44 method_input_.push_back(payload); // payload is copied
45 send();
46 return method_return_.value<int>();
47 }
48
49 private:
50 enum Method {
51 SEND_MESSAGE,
52 };
53};
54
55} // namespace iface
56} // namespace systemc
57} // namespace simics
58
59#endif
60#endif
Definition: adapter.h:79