16#ifndef SIMICS_SYSTEMC_IFACE_PCI_EXPRESS_SIMICS_ADAPTER_H
17#define SIMICS_SYSTEMC_IFACE_PCI_EXPRESS_SIMICS_ADAPTER_H
19#if defined SIMICS_5_API || defined SIMICS_6_API
21#include <simics/devs/pci.h>
33template<
typename TBase,
typename TInterface = PciExpressInterface>
34class PciExpressSimicsAdapter :
public SimicsAdapter<pci_express_interface_t> {
36 PciExpressSimicsAdapter()
37 : SimicsAdapter<pci_express_interface_t>(
38 PCI_EXPRESS_INTERFACE, init_iface()) {
42 static int send_message(conf_object_t *obj, conf_object_t *src,
43 pcie_message_type_t type, byte_string_t payload) {
45 std::vector<uint8_t> p(payload.str, payload.str+payload.len);
46 return adapter<TBase, TInterface>(obj)->send_message(type, p);
50 std::vector<std::string> description(conf_object_t *obj,
51 DescriptionType type) {
52 return descriptionBase<TBase, TInterface>(obj, type);
54 pci_express_interface_t init_iface() {
55 pci_express_interface_t iface = {};
56 iface.send_message = send_message;
Definition: pci_bus_interface.h:24