Browse Source

Changed handling of augmentation of mudules wrt. to parameters

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:
40 40
 
41 41
     ~configurable_tracer();
42 42
 
43
+    void add_control(){
44
+        for(auto* o:sc_core::sc_get_top_level_objects(sc_core::sc_curr_simcontext))
45
+            augment_object_hierarchical(o);
46
+    }
43 47
 protected:
44 48
     void descend(const sc_core::sc_object *) override;
45 49
     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
15 15
 , cci_originator("configurable_tracer")
16 16
 , cci_broker(cci::cci_get_global_broker(cci_originator))
17 17
 {
18
-    for(auto* o:sc_core::sc_get_top_level_objects(sc_core::sc_curr_simcontext))
19
-        augment_object_hierarchical(o);
18
+//    for(auto* o:sc_core::sc_get_top_level_objects(sc_core::sc_curr_simcontext))
19
+//        augment_object_hierarchical(o);
20 20
 }
21 21
 
22 22
 scc::configurable_tracer::~configurable_tracer() {
@@ -61,7 +61,7 @@ bool scc::configurable_tracer::get_trace_enabled(const sc_core::sc_object* obj,
61 61
 }
62 62
 
63 63
 void configurable_tracer::augment_object_hierarchical(const sc_core::sc_object* obj) {
64
-    if(dynamic_cast<const sc_core::sc_module*>(obj)!=nullptr){
64
+    if(dynamic_cast<const sc_core::sc_module*>(obj)!=nullptr || dynamic_cast<const scc::traceable*>(obj)!=nullptr ){
65 65
         auto* attr=obj->get_attribute("enableTracing");
66 66
         if(attr==nullptr || dynamic_cast<const sc_core::sc_attribute<bool>*>(attr)==nullptr){ //check if we have no sc_attribute
67 67
             std::string hier_name {obj->name()};