SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
concurrency_mode_simics_adapter.h
Go to the documentation of this file.
1/*
2 © 2019 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_CONCURRENCY_MODE_SIMICS_ADAPTER_H
15#define SIMICS_SYSTEMC_IFACE_CONCURRENCY_MODE_SIMICS_ADAPTER_H
16
17#include <simics/model-iface/concurrency.h>
20
21#include <string>
22#include <vector>
23
24namespace simics {
25namespace systemc {
26namespace iface {
27
29template<typename TBase, typename TInterface = ConcurrencyModeInterface>
31 : public SimicsAdapter<concurrency_mode_interface_t> {
32 public:
34 : SimicsAdapter<concurrency_mode_interface_t>(
35 CONCURRENCY_MODE_INTERFACE, init_iface()) {}
36
37 protected:
38 static concurrency_mode_t supported_modes(conf_object_t *NOTNULL obj) {
39 return adapter<TBase, TInterface>(obj)->supported_modes();
40 }
41 static concurrency_mode_t current_mode(conf_object_t *NOTNULL obj) {
42 return adapter<TBase, TInterface>(obj)->current_mode();
43 }
44 static void switch_mode(conf_object_t *NOTNULL obj,
45 concurrency_mode_t mode) {
46 adapter<TBase, TInterface>(obj)->switch_mode(mode);
47 }
48
49 private:
50 std::vector<std::string> description(conf_object_t *obj,
51 DescriptionType type) override {
52 return descriptionBase<TBase, TInterface>(obj, type);
53 }
54 concurrency_mode_interface_t init_iface() {
55 concurrency_mode_interface_t iface = {};
56 iface.supported_modes = supported_modes;
57 iface.current_mode = current_mode;
58 iface.switch_mode = switch_mode;
59 return iface;
60 }
61};
62
63} // namespace iface
64} // namespace systemc
65} // namespace simics
66
67#endif
Adapter for concurrency mode interface.
Definition: concurrency_mode_simics_adapter.h:31
static concurrency_mode_t current_mode(conf_object_t *NOTNULL obj)
Definition: concurrency_mode_simics_adapter.h:41
ConcurrencyModeSimicsAdapter()
Definition: concurrency_mode_simics_adapter.h:33
static concurrency_mode_t supported_modes(conf_object_t *NOTNULL obj)
Definition: concurrency_mode_simics_adapter.h:38
static void switch_mode(conf_object_t *NOTNULL obj, concurrency_mode_t mode)
Definition: concurrency_mode_simics_adapter.h:44
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