SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
temporal_state_simics_adapter.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2016 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_TEMPORAL_STATE_SIMICS_ADAPTER_H
17#define SIMICS_SYSTEMC_IFACE_TEMPORAL_STATE_SIMICS_ADAPTER_H
18
19#include <simics/model-iface/temporal-state.h>
22
23#include <string>
24#include <vector>
25
26namespace simics {
27namespace systemc {
28namespace iface {
29
30template<typename TBase, typename TInterface = TemporalStateInterface>
32 : public SimicsAdapter<temporal_state_interface_t> {
33 public:
35 temporal_state_interface_t>(TEMPORAL_STATE_INTERFACE, init_iface()) {}
36
37 protected:
38 static lang_void *save(conf_object_t *obj) {
39 return adapter<TBase, TInterface>(obj)->save();
40 }
41 static void merge(conf_object_t *obj, lang_void *prev, lang_void *killed) {
42 return adapter<TBase, TInterface>(obj)->merge(prev, killed);
43 }
44 static void prepare_restore(conf_object_t *obj) {
45 return adapter<TBase, TInterface>(obj)->prepare_restore();
46 }
47 static void finish_restore(conf_object_t *obj, lang_void *state) {
48 return adapter<TBase, TInterface>(obj)->finish_restore(state);
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 temporal_state_interface_t init_iface() {
57 temporal_state_interface_t iface = {};
58 iface.save = save;
59 iface.merge = merge;
60 iface.prepare_restore = prepare_restore;
61 iface.finish_restore = finish_restore;
62
63 return iface;
64 }
65};
66
67} // namespace iface
68} // namespace systemc
69} // namespace simics
70
71#endif // SIMICS_SYSTEMC_IFACE_TEMPORAL_STATE_SIMICS_ADAPTER_H
Base class for mapping Simics interface to a C++ interface.
Definition: simics_adapter.h:47
Definition: temporal_state_simics_adapter.h:32
TemporalStateSimicsAdapter()
Definition: temporal_state_simics_adapter.h:34
static void merge(conf_object_t *obj, lang_void *prev, lang_void *killed)
Definition: temporal_state_simics_adapter.h:41
static void prepare_restore(conf_object_t *obj)
Definition: temporal_state_simics_adapter.h:44
static lang_void * save(conf_object_t *obj)
Definition: temporal_state_simics_adapter.h:38
static void finish_restore(conf_object_t *obj, lang_void *state)
Definition: temporal_state_simics_adapter.h:47
DescriptionType
Definition: description_interface.h:25
Definition: pci_bus_interface.h:24