scc  2022.4.0
SystemC components library
configurable_tracer.h
1 /*******************************************************************************
2  * Copyright 2017, 2018 MINRES Technologies GmbH
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *******************************************************************************/
16 
17 #ifndef _SCC_CONFIGURABLE_TRACER_H_
18 #define _SCC_CONFIGURABLE_TRACER_H_
19 
20 #include "tracer.h"
26 namespace scc {
35 class configurable_tracer : public tracer {
36 public:
45  configurable_tracer(std::string const&& name, bool enable_tx = true, bool enable_vcd = true, bool default_enable = false,
46  sc_core::sc_object* top = nullptr);
55  configurable_tracer(std::string const& name, bool enable_tx = true, bool enable_vcd = true, bool default_enable = false,
56  sc_core::sc_object* top = nullptr)
57  : configurable_tracer(std::string(name), enable_tx, enable_vcd, default_enable, top) {}
66  configurable_tracer(std::string const&& name, file_type type, bool enable_vcd = true, bool default_enable = false,
67  sc_core::sc_object* top = nullptr);
76  configurable_tracer(std::string const& name, file_type type, bool enable_vcd = true, bool default_enable = false,
77  sc_core::sc_object* top = nullptr)
78  : configurable_tracer(std::string(name), type, enable_vcd, default_enable, top) {}
87  configurable_tracer(std::string const&& name, file_type type, sc_core::sc_trace_file* tf = nullptr, bool default_enable = false,
88  sc_core::sc_object* top = nullptr);
97  configurable_tracer(std::string const& name, file_type type, sc_core::sc_trace_file* tf = nullptr, bool default_enable = false,
98  sc_core::sc_object* top = nullptr)
99  : configurable_tracer(std::string(name), type, tf, default_enable, top) {}
107  void add_control() {
108  if(control_added)
109  return;
110  for(auto* o : sc_core::sc_get_top_level_objects())
112  control_added = true;
113  }
114 
115 protected:
117  void descend(const sc_core::sc_object*, bool trace_all = false) override;
119  bool get_trace_enabled(const sc_core::sc_object*, bool = false);
121  void augment_object_hierarchical(sc_core::sc_object*);
122 
123  void end_of_elaboration() override;
125  std::vector<cci::cci_param_untyped*> params;
126  bool control_added{false};
127 };
128 
129 } /* namespace scc */ // end of scc-sysc
131 #endif /* _SCC_CONFIGURABLE_TRACER_H_ */
configurable tracer for automatic port and signal tracing
configurable_tracer(std::string const &&name, bool enable_tx=true, bool enable_vcd=true, bool default_enable=false, sc_core::sc_object *top=nullptr)
configurable_tracer(std::string const &name, bool enable_tx=true, bool enable_vcd=true, bool default_enable=false, sc_core::sc_object *top=nullptr)
configurable_tracer(std::string const &name, file_type type, sc_core::sc_trace_file *tf=nullptr, bool default_enable=false, sc_core::sc_object *top=nullptr)
void augment_object_hierarchical(sc_core::sc_object *)
add the 'enableTracing' attribute to sc_module
bool get_trace_enabled(const sc_core::sc_object *, bool=false)
check for existence of 'enableTracing' attribute and return value of default otherwise
void descend(const sc_core::sc_object *, bool trace_all=false) override
depth-first walk thru the design hierarchy and trace signals resp. call trace() function
std::vector< cci::cci_param_untyped * > params
array of created cci parameter
configurable_tracer(std::string const &name, file_type type, bool enable_vcd=true, bool default_enable=false, sc_core::sc_object *top=nullptr)
a component traversing the SystemC object hierarchy and tracing the objects
Definition: tracer.h:51
file_type
defines the transaction trace output type
Definition: tracer.h:59
SCC SystemC utilities.