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// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2015 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_SC_PROCESS_SIMICS_ADAPTER_H
17#define SIMICS_SYSTEMC_IFACE_SC_PROCESS_SIMICS_ADAPTER_H
18
20
21#include <systemc-interfaces.h>
22
23#include <string>
24#include <vector>
25
26namespace simics {
27namespace systemc {
28namespace iface {
29
31template<typename TBase,
32 typename TInterface = ScProcessInterface>
33class ScProcessSimicsAdapter : public SimicsAdapter<sc_process_interface_t> {
34 public:
36 : SimicsAdapter<sc_process_interface_t>(
37 SC_PROCESS_INTERFACE, init_iface()) {
38 }
39
40 protected:
41 static attr_value_t events(conf_object_t *obj) {
42 return adapter<TBase, TInterface>(obj)->events();
43 }
44 static const char *file(conf_object_t *obj) {
45 return adapter<TBase, TInterface>(obj)->file();
46 }
47 static int line(conf_object_t *obj) {
48 return adapter<TBase, TInterface>(obj)->line();
49 }
50 static int process_id(conf_object_t *obj) {
51 return adapter<TBase, TInterface>(obj)->process_id();
52 }
53 static char *dump_state(conf_object_t *obj) {
54 return adapter<TBase, TInterface>(obj)->dump_state();
55 }
56 static bool initialize(conf_object_t *obj) {
57 return adapter<TBase, TInterface>(obj)->initialize();
58 }
59 static int state(conf_object_t *obj) {
60 return adapter<TBase, TInterface>(obj)->state();
61 }
62 static void run(conf_object_t *obj) {
63 return adapter<TBase, TInterface>(obj)->run();
64 }
65
66 private:
67 std::vector<std::string> description(conf_object_t *obj,
68 DescriptionType type) {
69 return descriptionBase<TBase, TInterface>(obj, type);
70 }
71 sc_process_interface_t init_iface() {
72 sc_process_interface_t iface = {};
73 iface.events = events;
74 iface.file = file;
75 iface.line = line;
76 iface.process_id = process_id;
77 iface.dump_state = dump_state;
78 iface.initialize = initialize;
79 iface.state = state;
80 iface.run = run;
81 return iface;
82 }
83};
84
85} // namespace iface
86} // namespace systemc
87} // namespace simics
88
89#endif
Definition: sc_process_simics_adapter.h:33
static void run(conf_object_t *obj)
Definition: sc_process_simics_adapter.h:62
ScProcessSimicsAdapter()
Definition: sc_process_simics_adapter.h:35
static char * dump_state(conf_object_t *obj)
Definition: sc_process_simics_adapter.h:53
static int state(conf_object_t *obj)
Definition: sc_process_simics_adapter.h:59
static const char * file(conf_object_t *obj)
Definition: sc_process_simics_adapter.h:44
static int process_id(conf_object_t *obj)
Definition: sc_process_simics_adapter.h:50
static int line(conf_object_t *obj)
Definition: sc_process_simics_adapter.h:47
static bool initialize(conf_object_t *obj)
Definition: sc_process_simics_adapter.h:56
static attr_value_t events(conf_object_t *obj)
Definition: sc_process_simics_adapter.h:41
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