From 0a9ae154be0c66d422e97c9280fd55c07c111ffb Mon Sep 17 00:00:00 2001 From: Markus Krause Date: Sun, 11 Oct 2020 03:17:39 +0200 Subject: [PATCH] introduce define for FST tracing (#2592) This is to allow C++ verilator toplevel to support multiple modes of waveform tracing VM_TRACE_FST can be used inside a #if VM_TRACE section to switch between classic .vcd tracing and the more compact .fst format supported by GTKWAVE --- docs/CONTRIBUTORS | 1 + include/verilated.mk.in | 1 + src/V3EmitMk.cpp | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/docs/CONTRIBUTORS b/docs/CONTRIBUTORS index 18c6447e8..2442f3b2a 100644 --- a/docs/CONTRIBUTORS +++ b/docs/CONTRIBUTORS @@ -40,6 +40,7 @@ Lukasz Dalek Maarten De Braekeleer Maciej Sobkowski Marco Widmer +Markus Krause Marshal Qiao Matthew Ballance Michael Killough diff --git a/include/verilated.mk.in b/include/verilated.mk.in index f08066a49..eb6b2b72c 100644 --- a/include/verilated.mk.in +++ b/include/verilated.mk.in @@ -54,6 +54,7 @@ VK_CPPFLAGS_ALWAYS += \ -DVM_COVERAGE=$(VM_COVERAGE) \ -DVM_SC=$(VM_SC) \ -DVM_TRACE=$(VM_TRACE) \ + -DVM_TRACE_FST=$(VM_TRACE_FST) \ $(CFG_CXXFLAGS_NO_UNUSED) \ ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users diff --git a/src/V3EmitMk.cpp b/src/V3EmitMk.cpp index e0cfd151a..55312dbe3 100644 --- a/src/V3EmitMk.cpp +++ b/src/V3EmitMk.cpp @@ -65,6 +65,10 @@ public: of.puts("VM_TRACE = "); of.puts(v3Global.opt.trace() ? "1" : "0"); of.puts("\n"); + of.puts("# Tracing output mode in FST format? 0/1 (from --trace-fst)\n"); + of.puts("VM_TRACE_FST = "); + of.puts(v3Global.opt.trace() && v3Global.opt.traceFormat().fst() ? "1" : "0"); + of.puts("\n"); of.puts("# Tracing threaded output mode? 0/1/N threads (from --trace-thread)\n"); of.puts("VM_TRACE_THREADS = "); of.puts(cvtToStr(v3Global.opt.trueTraceThreads()));