Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/sysc/scc/configurable_tracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

#include "configurable_tracer.h"
#include "traceable.h"

#include <cstdio>
#include <fmt/format.h>
using namespace sc_core;
using namespace scc;

Expand Down Expand Up @@ -54,6 +55,7 @@ void configurable_tracer::descend(const sc_core::sc_object* obj, bool trace) {
descend(o, trace);
return;
} else if(kind == "sc_module") {
auto module_name = obj->name();
auto trace_enable = get_trace_enabled(obj, default_trace_enable_handle.get_cci_value().get<bool>());
if(trace_enable)
obj->trace(trf);
Expand Down
15 changes: 10 additions & 5 deletions src/sysc/scc/configurer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,13 +643,18 @@ void mirror_sc_attributes(configurer::broker_t& broker, configurer::cci_param_cl
}

bool cci_name_ignore(std::pair<std::string, cci::cci_value> const& preset_value) {
std::string ending(SCC_LOG_LEVEL_PARAM_NAME);
auto& name = preset_value.first;
if(name.length() >= ending.length()) {
return (0 == name.compare(name.length() - ending.length(), ending.length(), ending));
} else {
if(name.length() < SCC_LOG_LEVEL_PARAM_NAME_LEN) // name is to short to hold the log level
return false;
}
size_t dot = name.find_last_of(".");
if(dot == std::string::npos)
return name == SCC_LOG_LEVEL_PARAM_NAME;
if(name.substr(dot, name.size() - dot).compare(SCC_LOG_LEVEL_PARAM_NAME) != 0)
// the parameter name is not SCC_LOG_LEVEL_PARAM_NAME
return false;
std::string module_name = name.substr(0, dot);
// ignore the SCC_LOG_LEVEL_PARAM_NAME preset if module exists
return sc_core::sc_find_object(name.c_str()) != nullptr;
}
} // namespace
#ifdef HAS_YAMPCPP
Expand Down
4 changes: 2 additions & 2 deletions src/sysc/scc/report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ struct char_hash {
};
static class {
std::unordered_map<char const*, sc_core::sc_verbosity, char_hash, char_equal_to> table;
std::vector<std::string> cache;
std::deque<std::string> cache;
std::mutex mtx;

public:
Expand All @@ -89,7 +89,7 @@ static class {
}
void insert(char const* key, sc_core::sc_verbosity verb) {
std::lock_guard<std::mutex> lock(mtx);
cache.push_back(key);
cache.emplace_back(key);
table.insert({cache.back().c_str(), verb});
}
void clear() {
Expand Down
2 changes: 2 additions & 0 deletions src/sysc/scc/report.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ writing. By default spdlog logs asyncronously to keep the performance impact low
*/
//! the name of the CCI property to attach to modules to control logging of this module
#define SCC_LOG_LEVEL_PARAM_NAME "log_level"
#define SCC_LOG_LEVEL_PARAM_NAME_LEN 9

/** \ingroup scc-sysc
* @{
*/
Expand Down
Loading