SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
sc_vector_simics_adapter.h
Go to the documentation of this file.
1/*
2 © 2017 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_SC_VECTOR_SIMICS_ADAPTER_H
15#define SIMICS_SYSTEMC_IFACE_SC_VECTOR_SIMICS_ADAPTER_H
16
19#include <simics/attribute-traits.h>
20
21#include <systemc-interfaces.h>
22
23#include <string>
24#include <vector>
25
26namespace simics {
27namespace systemc {
28namespace iface {
29
31template<typename TBase, typename TInterface = ScVectorInterface>
32class ScVectorSimicsAdapter : public SimicsAdapter<sc_vector_interface_t> {
33 public:
34 ScVectorSimicsAdapter() : SimicsAdapter<sc_vector_interface_t>(
35 SC_VECTOR_INTERFACE, init_iface()) {
36 }
37
38 protected:
39 static attr_value_t get_elements(conf_object_t *obj) {
40 auto elements = adapter<TBase, TInterface>(obj)->get_elements();
41 return simics::std_to_attr(
42 std::vector<simics::ConfObjectRef>(elements.begin(),
43 elements.end()));
44 }
45
46 private:
47 std::vector<std::string> description(conf_object_t *obj,
48 DescriptionType type) override {
49 return descriptionBase<TBase, TInterface>(obj, type);
50 }
51 sc_vector_interface_t init_iface() {
52 sc_vector_interface_t iface = {};
53 iface.get_elements = get_elements;
54 return iface;
55 }
56};
57
58} // namespace iface
59} // namespace systemc
60} // namespace simics
61
62#endif
Definition: sc_vector_simics_adapter.h:32
ScVectorSimicsAdapter()
Definition: sc_vector_simics_adapter.h:34
static attr_value_t get_elements(conf_object_t *obj)
Definition: sc_vector_simics_adapter.h:39
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