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// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2019 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_CONCURRENCY_MODE_SIMICS_ADAPTER_H
17#define SIMICS_SYSTEMC_IFACE_CONCURRENCY_MODE_SIMICS_ADAPTER_H
18
19#include <simics/model-iface/concurrency.h>
22
23#include <string>
24#include <vector>
25
26namespace simics {
27namespace systemc {
28namespace iface {
29
31template<typename TBase, typename TInterface = ConcurrencyModeInterface>
33 : public SimicsAdapter<concurrency_mode_interface_t> {
34 public:
36 : SimicsAdapter<concurrency_mode_interface_t>(
37 CONCURRENCY_MODE_INTERFACE, init_iface()) {}
38
39 protected:
40 static concurrency_mode_t supported_modes(conf_object_t *NOTNULL obj) {
41 return adapter<TBase, TInterface>(obj)->supported_modes();
42 }
43 static concurrency_mode_t current_mode(conf_object_t *NOTNULL obj) {
44 return adapter<TBase, TInterface>(obj)->current_mode();
45 }
46 static void switch_mode(conf_object_t *NOTNULL obj,
47 concurrency_mode_t mode) {
48 adapter<TBase, TInterface>(obj)->switch_mode(mode);
49 }
50
51 private:
52 std::vector<std::string> description(conf_object_t *obj,
53 DescriptionType type) {
54 return descriptionBase<TBase, TInterface>(obj, type);
55 }
56 concurrency_mode_interface_t init_iface() {
57 concurrency_mode_interface_t iface = {};
58 iface.supported_modes = supported_modes;
59 iface.current_mode = current_mode;
60 iface.switch_mode = switch_mode;
61 return iface;
62 }
63};
64
65} // namespace iface
66} // namespace systemc
67} // namespace simics
68
69#endif
Adapter for concurrency mode interface.
Definition: concurrency_mode_simics_adapter.h:33
static concurrency_mode_t current_mode(conf_object_t *NOTNULL obj)
Definition: concurrency_mode_simics_adapter.h:43
ConcurrencyModeSimicsAdapter()
Definition: concurrency_mode_simics_adapter.h:35
static concurrency_mode_t supported_modes(conf_object_t *NOTNULL obj)
Definition: concurrency_mode_simics_adapter.h:40
static void switch_mode(conf_object_t *NOTNULL obj, concurrency_mode_t mode)
Definition: concurrency_mode_simics_adapter.h:46
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