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
This commit is contained in:
Markus Krause 2020-10-11 03:17:39 +02:00 committed by GitHub
parent e25a6334cf
commit 0a9ae154be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View File

@ -40,6 +40,7 @@ Lukasz Dalek
Maarten De Braekeleer Maarten De Braekeleer
Maciej Sobkowski Maciej Sobkowski
Marco Widmer Marco Widmer
Markus Krause
Marshal Qiao Marshal Qiao
Matthew Ballance Matthew Ballance
Michael Killough Michael Killough

View File

@ -54,6 +54,7 @@ VK_CPPFLAGS_ALWAYS += \
-DVM_COVERAGE=$(VM_COVERAGE) \ -DVM_COVERAGE=$(VM_COVERAGE) \
-DVM_SC=$(VM_SC) \ -DVM_SC=$(VM_SC) \
-DVM_TRACE=$(VM_TRACE) \ -DVM_TRACE=$(VM_TRACE) \
-DVM_TRACE_FST=$(VM_TRACE_FST) \
$(CFG_CXXFLAGS_NO_UNUSED) \ $(CFG_CXXFLAGS_NO_UNUSED) \
ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users

View File

@ -65,6 +65,10 @@ public:
of.puts("VM_TRACE = "); of.puts("VM_TRACE = ");
of.puts(v3Global.opt.trace() ? "1" : "0"); of.puts(v3Global.opt.trace() ? "1" : "0");
of.puts("\n"); 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("# Tracing threaded output mode? 0/1/N threads (from --trace-thread)\n");
of.puts("VM_TRACE_THREADS = "); of.puts("VM_TRACE_THREADS = ");
of.puts(cvtToStr(v3Global.opt.trueTraceThreads())); of.puts(cvtToStr(v3Global.opt.trueTraceThreads()));