SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
packet_simics_adapter.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2018 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_PACKET_SIMICS_ADAPTER_H
17#define SIMICS_SYSTEMC_IFACE_PACKET_SIMICS_ADAPTER_H
18
19#include <simics/model-iface/packet.h>
22
23#include <simics/base/attr-value.h>
24
25#include <string>
26#include <vector>
27
28namespace simics {
29namespace systemc {
30namespace iface {
31
32template<typename TBase, typename TInterface = PacketInterface>
34 : public SimicsAdapter<packet_interface_t> {
35 public:
37 : SimicsAdapter<packet_interface_t>(
38 PACKET_INTERFACE, init_iface()) {
39 }
40
41 protected:
42 static void transfer(conf_object_t *obj, bytes_t data) {
43 adapter<TBase, TInterface>(obj)->transfer(data.data, data.len);
44 }
45
46 private:
47 std::vector<std::string> description(conf_object_t *obj,
48 DescriptionType type) {
49 return descriptionBase<TBase, TInterface>(obj, type);
50 }
51 packet_interface_t init_iface() {
52 packet_interface_t iface = {};
53 iface.transfer = transfer;
54 return iface;
55 }
56};
57
58} // namespace iface
59} // namespace systemc
60} // namespace simics
61
62#endif
Definition: packet_simics_adapter.h:34
PacketSimicsAdapter()
Definition: packet_simics_adapter.h:36
static void transfer(conf_object_t *obj, bytes_t data)
Definition: packet_simics_adapter.h:42
Base class for mapping Simics interface to a C++ interface.
Definition: simics_adapter.h:47
DescriptionType
Definition: description_interface.h:25
Definition: pci_bus_interface.h:24