Browse Source

Changed handling of augmentation of mudules wrt. to parameters

pull/3/head
Eyck Jentzsch 1 year ago
parent
commit
3e7906cd16
2 changed files with 7 additions and 3 deletions
  1. 4
    0
      incl/scc/configurable_tracer.h
  2. 3
    3
      src/configurable_tracer.cpp

+ 4
- 0
incl/scc/configurable_tracer.h View File

@@ -40,6 +40,10 @@ public:

~configurable_tracer();

void add_control(){
for(auto* o:sc_core::sc_get_top_level_objects(sc_core::sc_curr_simcontext))
augment_object_hierarchical(o);
}
protected:
void descend(const sc_core::sc_object *) override;
bool get_trace_enabled(const sc_core::sc_object*, bool =false );

+ 3
- 3
src/configurable_tracer.cpp View File

@@ -15,8 +15,8 @@ configurable_tracer::configurable_tracer(std::string&& name, file_type type, boo
, cci_originator("configurable_tracer")
, cci_broker(cci::cci_get_global_broker(cci_originator))
{
for(auto* o:sc_core::sc_get_top_level_objects(sc_core::sc_curr_simcontext))
augment_object_hierarchical(o);
// for(auto* o:sc_core::sc_get_top_level_objects(sc_core::sc_curr_simcontext))
// augment_object_hierarchical(o);
}

scc::configurable_tracer::~configurable_tracer() {
@@ -61,7 +61,7 @@ bool scc::configurable_tracer::get_trace_enabled(const sc_core::sc_object* obj,
}

void configurable_tracer::augment_object_hierarchical(const sc_core::sc_object* obj) {
if(dynamic_cast<const sc_core::sc_module*>(obj)!=nullptr){
if(dynamic_cast<const sc_core::sc_module*>(obj)!=nullptr || dynamic_cast<const scc::traceable*>(obj)!=nullptr ){
auto* attr=obj->get_attribute("enableTracing");
if(attr==nullptr || dynamic_cast<const sc_core::sc_attribute<bool>*>(attr)==nullptr){ //check if we have no sc_attribute
std::string hier_name {obj->name()};

Loading…
Cancel
Save