Skip to content

Commit 73b1c19

Browse files
committed
improves reporting of unused cci preset values
1 parent 54d46d1 commit 73b1c19

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

src/sysc/scc/configurer.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -643,13 +643,18 @@ void mirror_sc_attributes(configurer::broker_t& broker, configurer::cci_param_cl
643643
}
644644

645645
bool cci_name_ignore(std::pair<std::string, cci::cci_value> const& preset_value) {
646-
std::string ending(SCC_LOG_LEVEL_PARAM_NAME);
647646
auto& name = preset_value.first;
648-
if(name.length() >= ending.length()) {
649-
return (0 == name.compare(name.length() - ending.length(), ending.length(), ending));
650-
} else {
647+
if(name.length() < SCC_LOG_LEVEL_PARAM_NAME_LEN) // name is to short to hold the log level
651648
return false;
652-
}
649+
size_t dot = name.find_last_of(".");
650+
if (dot == std::string::npos)
651+
return name == SCC_LOG_LEVEL_PARAM_NAME;
652+
if(name.substr(dot, name.size() - dot).compare(SCC_LOG_LEVEL_PARAM_NAME)!=0)
653+
// the parameter name is not SCC_LOG_LEVEL_PARAM_NAME
654+
return false;
655+
std::string module_name = name.substr(0, dot);
656+
// ignore the SCC_LOG_LEVEL_PARAM_NAME preset if module exists
657+
return sc_core::sc_find_object(name.c_str())!=nullptr;
653658
}
654659
} // namespace
655660
#ifdef HAS_YAMPCPP

0 commit comments

Comments
 (0)