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/*
2 © 2018 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_PACKET_SIMICS_ADAPTER_H
15#define SIMICS_SYSTEMC_IFACE_PACKET_SIMICS_ADAPTER_H
16
17#include <simics/model-iface/packet.h>
20
21#include <simics/base/attr-value.h>
22
23#include <string>
24#include <vector>
25
26namespace simics {
27namespace systemc {
28namespace iface {
29
30template<typename TBase, typename TInterface = PacketInterface>
32 : public SimicsAdapter<packet_interface_t> {
33 public:
35 : SimicsAdapter<packet_interface_t>(
36 PACKET_INTERFACE, init_iface()) {
37 }
38
39 protected:
40 static void transfer(conf_object_t *obj, bytes_t data) {
41 adapter<TBase, TInterface>(obj)->transfer(data.data, data.len);
42 }
43
44 private:
45 std::vector<std::string> description(conf_object_t *obj,
46 DescriptionType type) override {
47 return descriptionBase<TBase, TInterface>(obj, type);
48 }
49 packet_interface_t init_iface() {
50 packet_interface_t iface = {};
51 iface.transfer = transfer;
52 return iface;
53 }
54};
55
56} // namespace iface
57} // namespace systemc
58} // namespace simics
59
60#endif
Definition: packet_simics_adapter.h:32
PacketSimicsAdapter()
Definition: packet_simics_adapter.h:34
static void transfer(conf_object_t *obj, bytes_t data)
Definition: packet_simics_adapter.h:40
Base class for mapping Simics interface to a C++ interface.
Definition: simics_adapter.h:45
DescriptionType
Definition: description_interface.h:23
Definition: adapter.h:79