14#ifndef SIMICS_SYSTEMC_IFACE_PCI_EXPRESS_SIMICS_ADAPTER_H
15#define SIMICS_SYSTEMC_IFACE_PCI_EXPRESS_SIMICS_ADAPTER_H
17#if defined SIMICS_6_API || defined SHOW_OBSOLETE_API
19#include <simics/devs/pci.h>
31template<
typename TBase,
typename TInterface = PciExpressInterface>
32class PciExpressSimicsAdapter :
public SimicsAdapter<pci_express_interface_t> {
34 PciExpressSimicsAdapter()
35 : SimicsAdapter<pci_express_interface_t>(
36 PCI_EXPRESS_INTERFACE, init_iface()) {
40 static int send_message(conf_object_t *obj, conf_object_t *src,
41 pcie_message_type_t type, byte_string_t payload) {
43 std::vector<uint8_t> p(payload.str, payload.str+payload.len);
44 return adapter<TBase, TInterface>(obj)->send_message(type, p);
48 std::vector<std::string> description(conf_object_t *obj,
49 DescriptionType type)
override {
50 return descriptionBase<TBase, TInterface>(obj, type);
52 pci_express_interface_t init_iface() {
53 pci_express_interface_t iface = {};
54 iface.send_message = send_message;