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