SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
kernel.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2014 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_KERNEL_H
17#define SIMICS_SYSTEMC_KERNEL_H
18
19#include <systemc>
20
21namespace simics {
22namespace systemc {
23
29class Kernel {
30 public:
31 explicit Kernel(sc_core::sc_simcontext *context)
32 : former_context_(sc_core::sc_curr_simcontext), context_(context) {
33 sc_core::sc_default_global_context = context;
34 sc_core::sc_curr_simcontext = context;
35 }
37 sc_core::sc_default_global_context = former_context_;
38 sc_core::sc_curr_simcontext = former_context_;
39 }
40 private:
41 sc_core::sc_simcontext *former_context_;
42 sc_core::sc_simcontext *context_;
43};
44
45} // namespace systemc
46} // namespace simics
47
48#endif
Utility class that reset the current context to the previous one upon leaving current scope.
Definition: kernel.h:29
Kernel(sc_core::sc_simcontext *context)
Definition: kernel.h:31
~Kernel()
Definition: kernel.h:36
Definition: argument_registry.h:26
Definition: pci_bus_interface.h:24