SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
trace_process_all_dynamic.h
Go to the documentation of this file.
1/*
2 © 2016 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_TRACE_PROCESS_ALL_DYNAMIC_H
15#define SIMICS_SYSTEMC_TRACE_PROCESS_ALL_DYNAMIC_H
16
17#include <simics/cc-api.h>
18#include <simics/simulator/sim-get-class.h>
25
26namespace simics {
27namespace systemc {
28
31 : public simics::ConfObject,
35 public:
36 explicit TraceProcessAllDynamic(simics::ConfObjectRef o)
37 : ConfObject(o) {
38 }
39 void init(SimulationInterface *simulation) {
40 setSimulation(simulation);
41 }
43 void event_callback(const char *event_type,
44 const char *class_type,
45 void *object,
46 const sc_core::sc_time &ts) override {
47 sc_core::sc_process_b *process
48 = static_cast<sc_core::sc_process_b*>(object);
49 sc_core::sc_process_handle handle(process);
50 bool internal = false;
51 if (InternalProcesses.find(handle) != InternalProcesses.end())
52 internal = true;
53
55 process_state_change,
56 NULL,
57 event_type, class_type, object,
58 const_cast<sc_core::sc_time *>(&ts),
59 internal);
60 }
61 static conf_class_t *initClass() {
62 conf_class_t *cls = SIM_get_class("sc_method_process_all_dynamic");
63 if (SIM_clear_exception() == SimExc_No_Exception) {
64 return cls;
65 }
66
67 auto new_cls = make_class<TraceProcessAllDynamic>(
68 "sc_method_process_all_dynamic",
69 "All dynamic SystemC processes",
70 "Helper class to attach SystemC Tools on dynamically created "
71 "SystemC processes.",
72 Sim_Class_Kind_Pseudo);
73
75 TraceProcessAllDynamic> sc_provider_controller_adapter;
76 SIM_register_interface(*new_cls.get(), SC_PROVIDER_CONTROLLER_INTERFACE,
77 sc_provider_controller_adapter.cstruct());
78 return *new_cls.get();
79 }
80};
81
82} // namespace systemc
83} // namespace simics
84
85#endif
Definition: trace_monitor_interface.h:28
Interface to the SystemC simulation.
Definition: simulation_interface_proxy.h:25
void setSimulation(iface::SimulationInterface *simulation)
Definition: simulation_interface_proxy.h:30
Definition: trace_process_all_dynamic.h:34
static conf_class_t * initClass()
Definition: trace_process_all_dynamic.h:61
void event_callback(const char *event_type, const char *class_type, void *object, const sc_core::sc_time &ts) override
Definition: trace_process_all_dynamic.h:43
void init(SimulationInterface *simulation)
Definition: trace_process_all_dynamic.h:39
void connection_list_updated(ConnectionListState state) override
TraceProcessAllDynamic(simics::ConfObjectRef o)
Definition: trace_process_all_dynamic.h:36
Definition: provider_controller_simics_adapter.h:34
Definition: tool_controller_process_action.h:25
ConnectionListState
Definition: tool_controller.h:74
conf_class_t * SIM_get_class(const char *NOTNULL name)
std::set< sc_core::sc_process_handle > InternalProcesses
Definition: adapter.h:79
#define DISPATCH_TOOL_CHAIN_THIS(iface_type, func,...)
Definition: tool_controller.h:62