SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
execute_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_EXECUTE_SIMICS_ADAPTER_H
15#define SIMICS_SYSTEMC_IFACE_EXECUTE_SIMICS_ADAPTER_H
16
17#include <simics/model-iface/execute.h>
20
21#include <string>
22#include <vector>
23
24namespace simics {
25namespace systemc {
26namespace iface {
27
29template<typename TBase, typename TInterface = ExecuteInterface>
30class ExecuteSimicsAdapter : public SimicsAdapter<execute_interface_t> {
31 public:
33 : SimicsAdapter<execute_interface_t>(EXECUTE_INTERFACE, init_iface()) {
34 }
35
36 protected:
37 static void run(conf_object_t *obj) {
38 adapterWithoutLocking<TBase, TInterface>(obj)->run();
39 }
40 static void stop(conf_object_t *obj) {
41 adapterWithoutLocking<TBase, TInterface>(obj)->stop();
42 }
43 static void switch_in(conf_object_t *obj) {
44 adapterWithoutLocking<TBase, TInterface>(obj)->switch_in();
45 }
46 static void switch_out(conf_object_t *obj) {
47 adapterWithoutLocking<TBase, TInterface>(obj)->switch_out();
48 }
49
50 private:
51 std::vector<std::string> description(conf_object_t *obj,
52 DescriptionType type) override {
53 return descriptionBase<TBase, TInterface>(obj, type);
54 }
55 execute_interface_t init_iface() {
56 execute_interface_t iface = {};
57 iface.run = run;
58 iface.stop = stop;
59 iface.switch_in = switch_in;
60 iface.switch_out = switch_out;
61 return iface;
62 }
63};
64
65} // namespace iface
66} // namespace systemc
67} // namespace simics
68
69#endif
Definition: execute_simics_adapter.h:30
static void switch_in(conf_object_t *obj)
Definition: execute_simics_adapter.h:43
ExecuteSimicsAdapter()
Definition: execute_simics_adapter.h:32
static void switch_out(conf_object_t *obj)
Definition: execute_simics_adapter.h:46
static void stop(conf_object_t *obj)
Definition: execute_simics_adapter.h:40
static void run(conf_object_t *obj)
Definition: execute_simics_adapter.h:37
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