From 9c443ee1185d127ff8f698a117714809a0f4d1c2 Mon Sep 17 00:00:00 2001 From: sgachoud Date: Tue, 18 Apr 2023 17:38:01 +0200 Subject: [PATCH 1/5] remove include from namespace --- src/common/util/logging.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/util/logging.h b/src/common/util/logging.h index c61fe7c3..56a1c3f2 100644 --- a/src/common/util/logging.h +++ b/src/common/util/logging.h @@ -264,10 +264,12 @@ class DEFAULT {}; LOGGER(CATEGORY)().get(::logging::LEVEL, #CATEGORY) #endif #if defined(WIN32) +} // namespace logging #include #include +namespace logging { inline std::string now_time() { const int MAX_LEN = 200; char buffer[MAX_LEN]; From 70f96ae3b10710c3a3bdbd9cd210d102b055394f Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Wed, 29 Nov 2023 14:06:37 +0200 Subject: [PATCH 2/5] Fix fmt 10.x+ compatibility issue in vcd_trace.hh --- src/sysc/scc/trace/vcd_trace.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sysc/scc/trace/vcd_trace.hh b/src/sysc/scc/trace/vcd_trace.hh index a5f9e5c6..00225a53 100644 --- a/src/sysc/scc/trace/vcd_trace.hh +++ b/src/sysc/scc/trace/vcd_trace.hh @@ -53,7 +53,7 @@ inline void vcdEmitValueChange64(FPTR os, std::string const& handle, unsigned bi template inline void vcdEmitValueChangeReal(FPTR os, std::string const& handle, unsigned bits, T val){ - auto buf = fmt::format("r{:.16g} {}\n", val, handle); + auto buf = fmt::format("r{:.16g} {}\n", static_cast(val), handle); FWRITE(buf.c_str(), 1, buf.size(), os); } From 1cf420089efc766bfe46ec0a91ea7b4d50e9c2dd Mon Sep 17 00:00:00 2001 From: Yu-Ming Chang Date: Wed, 7 Aug 2024 11:06:01 +0800 Subject: [PATCH 3/5] Fix tracer file type which should be used to decide the output format. --- src/sysc/scc/tracer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sysc/scc/tracer.cpp b/src/sysc/scc/tracer.cpp index a1debdd7..82fd1ec6 100644 --- a/src/sysc/scc/tracer.cpp +++ b/src/sysc/scc/tracer.cpp @@ -55,7 +55,7 @@ tracer::tracer(std::string const&& name, file_type tx_type, file_type sig_type, if(sig_type == ENABLE) sig_type = static_cast(sig_trace_type.get_value()); if(sig_type != NONE) { - switch(sig_type) { + switch(tx_type) { default: trf = sc_create_vcd_trace_file(name.c_str()); break; From 4cc65e733ec5e18365d4449ce2305706a3ba4d44 Mon Sep 17 00:00:00 2001 From: Yu-Ming Chang Date: Wed, 7 Aug 2024 14:45:02 +0800 Subject: [PATCH 4/5] Revert "Fix tracer file type which should be used to decide the output format." This reverts commit 1cf420089efc766bfe46ec0a91ea7b4d50e9c2dd. --- src/sysc/scc/tracer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sysc/scc/tracer.cpp b/src/sysc/scc/tracer.cpp index 82fd1ec6..a1debdd7 100644 --- a/src/sysc/scc/tracer.cpp +++ b/src/sysc/scc/tracer.cpp @@ -55,7 +55,7 @@ tracer::tracer(std::string const&& name, file_type tx_type, file_type sig_type, if(sig_type == ENABLE) sig_type = static_cast(sig_trace_type.get_value()); if(sig_type != NONE) { - switch(tx_type) { + switch(sig_type) { default: trf = sc_create_vcd_trace_file(name.c_str()); break; From 23395fbfa9eb4caf7f571e5ddb82e498b9e39d62 Mon Sep 17 00:00:00 2001 From: Yu-Ming Chang Date: Wed, 7 Aug 2024 14:42:30 +0800 Subject: [PATCH 5/5] configurable_tracer: Add a constructor for specific output file types. --- src/sysc/scc/configurable_tracer.cpp | 6 ++++++ src/sysc/scc/configurable_tracer.h | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/sysc/scc/configurable_tracer.cpp b/src/sysc/scc/configurable_tracer.cpp index fb61bcae..83303db6 100644 --- a/src/sysc/scc/configurable_tracer.cpp +++ b/src/sysc/scc/configurable_tracer.cpp @@ -35,6 +35,12 @@ configurable_tracer::configurable_tracer(std::string const&& name, file_type typ default_trace_enable = default_enable; } +configurable_tracer::configurable_tracer(std::string const&& name, file_type tx_type, file_type sig_type, bool default_enable, + sc_core::sc_object* top) +: tracer(std::move(name), tx_type, sig_type, top) { + default_trace_enable = default_enable; +} + configurable_tracer::configurable_tracer(std::string const&& name, file_type type, sc_core::sc_trace_file* tf, bool default_enable, sc_core::sc_object* top) : tracer(std::move(name), type, tf, top) { diff --git a/src/sysc/scc/configurable_tracer.h b/src/sysc/scc/configurable_tracer.h index 35165360..8c622acb 100644 --- a/src/sysc/scc/configurable_tracer.h +++ b/src/sysc/scc/configurable_tracer.h @@ -38,7 +38,7 @@ class configurable_tracer : public tracer { * constructs a tracer object * * @param name basename of the trace file(s) - * @param enable_tx enables transaction teacing + * @param enable_tx enables transaction tracing * @param enable_vcd enable VCD (signal based) tracing * @param default_enable value of parameter enableTracing if not defined by module or CCIs */ @@ -48,7 +48,7 @@ class configurable_tracer : public tracer { * constructs a tracer object * * @param name basename of the trace file(s) - * @param enable_tx enables transaction teacing + * @param enable_tx enables transaction tracing * @param enable_vcd enable VCD (signal based) tracing * @param default_enable value of parameter enableTracing if not defined by module or CCIs */ @@ -76,6 +76,19 @@ class configurable_tracer : public tracer { configurable_tracer(std::string const& name, file_type type, bool enable_vcd = true, bool default_enable = false, sc_core::sc_object* top = nullptr) : configurable_tracer(std::string(name), type, enable_vcd, default_enable, top) {} + /** + * constructs a tracer object + * + * @param name basename of the trace file(s) + * @param tx_type type of trace file for transactions + * @param sig_type type of trace file for signals + * @param default_enable value of parameter enableTracing if not defined by module or CCIs + */ + configurable_tracer(std::string const&& name, file_type tx_type, file_type sig_type, bool default_enable = false, + sc_core::sc_object* top = nullptr); + configurable_tracer(std::string const& name, file_type tx_type, file_type sig_type, bool default_enable = false, + sc_core::sc_object* top = nullptr) + : configurable_tracer(std::string(name), tx_type, sig_type, default_enable, top) {} /** * constructs a tracer object *