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// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2018 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_EXECUTE_SIMICS_ADAPTER_H
17#define SIMICS_SYSTEMC_IFACE_EXECUTE_SIMICS_ADAPTER_H
18
19#include <simics/model-iface/execute.h>
22
23#include <string>
24#include <vector>
25
26namespace simics {
27namespace systemc {
28namespace iface {
29
31template<typename TBase, typename TInterface = ExecuteInterface>
32class ExecuteSimicsAdapter : public SimicsAdapter<execute_interface_t> {
33 public:
35 : SimicsAdapter<execute_interface_t>(EXECUTE_INTERFACE, init_iface()) {
36 }
37
38 protected:
39 static void run(conf_object_t *obj) {
40 adapterWithoutLocking<TBase, TInterface>(obj)->run();
41 }
42 static void stop(conf_object_t *obj) {
43 adapterWithoutLocking<TBase, TInterface>(obj)->stop();
44 }
45 static void switch_in(conf_object_t *obj) {
46 adapterWithoutLocking<TBase, TInterface>(obj)->switch_in();
47 }
48 static void switch_out(conf_object_t *obj) {
49 adapterWithoutLocking<TBase, TInterface>(obj)->switch_out();
50 }
51
52 private:
53 std::vector<std::string> description(conf_object_t *obj,
54 DescriptionType type) {
55 return descriptionBase<TBase, TInterface>(obj, type);
56 }
57 execute_interface_t init_iface() {
58 execute_interface_t iface = {};
59 iface.run = run;
60 iface.stop = stop;
61 iface.switch_in = switch_in;
62 iface.switch_out = switch_out;
63 return iface;
64 }
65};
66
67} // namespace iface
68} // namespace systemc
69} // namespace simics
70
71#endif
Definition: execute_simics_adapter.h:32
static void switch_in(conf_object_t *obj)
Definition: execute_simics_adapter.h:45
ExecuteSimicsAdapter()
Definition: execute_simics_adapter.h:34
static void switch_out(conf_object_t *obj)
Definition: execute_simics_adapter.h:48
static void stop(conf_object_t *obj)
Definition: execute_simics_adapter.h:42
static void run(conf_object_t *obj)
Definition: execute_simics_adapter.h:39
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