SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
sc_process_simics_adapter.h
Go to the documentation of this file.
1/*
2 © 2015 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_PROCESS_SIMICS_ADAPTER_H
15#define SIMICS_SYSTEMC_IFACE_SC_PROCESS_SIMICS_ADAPTER_H
16
18
19#include <systemc-interfaces.h>
20
21#include <string>
22#include <vector>
23
24namespace simics {
25namespace systemc {
26namespace iface {
27
29template<typename TBase,
30 typename TInterface = ScProcessInterface>
31class ScProcessSimicsAdapter : public SimicsAdapter<sc_process_interface_t> {
32 public:
34 : SimicsAdapter<sc_process_interface_t>(
35 SC_PROCESS_INTERFACE, init_iface()) {
36 }
37
38 protected:
39 static attr_value_t events(conf_object_t *obj) {
40 return adapter<TBase, TInterface>(obj)->events();
41 }
42 static const char *file(conf_object_t *obj) {
43 return adapter<TBase, TInterface>(obj)->file();
44 }
45 static int line(conf_object_t *obj) {
46 return adapter<TBase, TInterface>(obj)->line();
47 }
48 static int process_id(conf_object_t *obj) {
49 return adapter<TBase, TInterface>(obj)->process_id();
50 }
51 static char *dump_state(conf_object_t *obj) {
52 return adapter<TBase, TInterface>(obj)->dump_state();
53 }
54 static bool initialize(conf_object_t *obj) {
55 return adapter<TBase, TInterface>(obj)->initialize();
56 }
57 static int state(conf_object_t *obj) {
58 return adapter<TBase, TInterface>(obj)->state();
59 }
60 static void run(conf_object_t *obj) {
61 return adapter<TBase, TInterface>(obj)->run();
62 }
63
64 private:
65 std::vector<std::string> description(conf_object_t *obj,
66 DescriptionType type) override {
67 return descriptionBase<TBase, TInterface>(obj, type);
68 }
69 sc_process_interface_t init_iface() {
70 sc_process_interface_t iface = {};
71 iface.events = events;
72 iface.file = file;
73 iface.line = line;
74 iface.process_id = process_id;
75 iface.dump_state = dump_state;
76 iface.initialize = initialize;
77 iface.state = state;
78 iface.run = run;
79 return iface;
80 }
81};
82
83} // namespace iface
84} // namespace systemc
85} // namespace simics
86
87#endif
Definition: sc_process_simics_adapter.h:31
static void run(conf_object_t *obj)
Definition: sc_process_simics_adapter.h:60
ScProcessSimicsAdapter()
Definition: sc_process_simics_adapter.h:33
static char * dump_state(conf_object_t *obj)
Definition: sc_process_simics_adapter.h:51
static int state(conf_object_t *obj)
Definition: sc_process_simics_adapter.h:57
static const char * file(conf_object_t *obj)
Definition: sc_process_simics_adapter.h:42
static int process_id(conf_object_t *obj)
Definition: sc_process_simics_adapter.h:48
static int line(conf_object_t *obj)
Definition: sc_process_simics_adapter.h:45
static bool initialize(conf_object_t *obj)
Definition: sc_process_simics_adapter.h:54
static attr_value_t events(conf_object_t *obj)
Definition: sc_process_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