SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
checkpoint.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_CHECKPOINT_H
17#define SIMICS_SYSTEMC_CHECKPOINT_H
18
22
23#if INTC_EXT && USE_SIMICS_CHECKPOINTING
24#include <systemc-checkpoint/time_information_interface.h>
25#endif
26
27#include <string>
28#include <vector>
29
30namespace simics {
31namespace systemc {
32
35 public:
37 virtual ~CheckpointStub() {}
38 std::vector<std::string> systemcState() const {
39 return std::vector<std::string>();
40 }
41 void setSystemcState(const std::vector<std::string> &checkpoints) {}
42};
43
44#if INTC_EXT && USE_SIMICS_CHECKPOINTING
45
46class CheckpointControl;
47
48class Checkpoint : public iface::CheckpointInterface,
49 public iface::TemporalStateInterface,
50 public sc_checkpoint::ExternalTimeInformationInterface {
51 public:
52 explicit Checkpoint(iface::SimulationInterface *simulation);
53 Checkpoint(const Checkpoint&) = delete;
54 Checkpoint &operator=(const Checkpoint&) = delete;
55 virtual ~Checkpoint();
56
57 // CheckpointInterface
58 virtual void save(const char *path);
59 virtual void finish(int success);
60 virtual int has_persistent_data();
61
62 // TemporalStateInterface
63 virtual lang_void *save();
64 virtual void merge(lang_void *prev, lang_void *killed);
65 virtual void prepare_restore();
66 virtual void finish_restore(lang_void *state);
67
68 // ExternalTimeInformationInterface
69 virtual void set_time_information(int64_t high, uint64_t low);
70 virtual void time_information(int64_t *high, uint64_t *low);
71
72 std::vector<std::string> systemcState() const;
73 void setSystemcState(const std::vector<std::string> &checkpoints);
74
75 void readCheckpointFromDisk();
76
77 protected:
78 void initializeCheckpoint(CheckpointControl *control);
79
80 private:
81 iface::SimulationInterface *simulation_;
82 CheckpointControl *control_;
83
84 std::vector<std::string> checkpoints_;
85};
86
87#endif
88
89} // namespace systemc
90} // namespace simics
91
92#endif // SIMICS_SYSTEMC_CHECKPOINT_H
Definition: checkpoint.h:34
virtual ~CheckpointStub()
Definition: checkpoint.h:37
std::vector< std::string > systemcState() const
Definition: checkpoint.h:38
void setSystemcState(const std::vector< std::string > &checkpoints)
Definition: checkpoint.h:41
CheckpointStub()
Definition: checkpoint.h:36
Definition: pci_bus_interface.h:24