From c7610ed0448ec151b8a0ed2d299264d96715898e Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Fri, 20 May 2022 16:58:12 +0100 Subject: [PATCH] Fix FST tracing thread in CMake build --- Changes | 1 + src/V3EmitCMake.cpp | 5 ++++- verilator-config.cmake.in | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 10a8f44fe..390606387 100644 --- a/Changes +++ b/Changes @@ -19,6 +19,7 @@ Verilator 4.223 devel * Fix hang with large case statement optimization (#3405). [Mike Urbach] * Fix 'with' operator with type casting (#3387). [xiak95] * Fix incorrect conditional merging (#3409). [Raynard Qiao] +* Fix passing VL_TRACE_FST_WRITER_THREAD in CMake build. [Geza Lore, Shunyao CAD] Verilator 4.222 2022-05-02 diff --git a/src/V3EmitCMake.cpp b/src/V3EmitCMake.cpp index 26f42e803..67e8a741c 100644 --- a/src/V3EmitCMake.cpp +++ b/src/V3EmitCMake.cpp @@ -114,7 +114,10 @@ class CMakeEmitter final { *of << "# Threaded output mode? 0/1/N threads (from --threads)\n"; cmake_set_raw(*of, name + "_THREADS", cvtToStr(v3Global.opt.threads())); *of << "# Threaded tracing output mode? 0/1/N threads (from --trace-threads)\n"; - cmake_set_raw(*of, name + "_TRACE_THREADS", cvtToStr(v3Global.opt.traceThreads())); + cmake_set_raw(*of, name + "_TRACE_THREADS", + cvtToStr(v3Global.opt.useTraceOffloadThread())); + cmake_set_raw(*of, name + "_TRACE_FST_WRITER_THREAD", + v3Global.opt.traceThreads() && v3Global.opt.traceFormat().fst() ? "1" : "0"); *of << "# Struct output mode? 0/1 (from --trace-structs)\n"; cmake_set_raw(*of, name + "_TRACE_STRUCTS", cvtToStr(v3Global.opt.traceStructs())); *of << "# VCD Tracing output mode? 0/1 (from --trace)\n"; diff --git a/verilator-config.cmake.in b/verilator-config.cmake.in index 7573d29ae..7f9ece972 100644 --- a/verilator-config.cmake.in +++ b/verilator-config.cmake.in @@ -266,6 +266,10 @@ function(verilate TARGET) set_property(TARGET ${TARGET} PROPERTY VERILATOR_TRACE_THREADED ON) endif() + if (${VERILATE_PREFIX}_TRACE_FST_WRITER_THREAD) + set_property(TARGET ${TARGET} PROPERTY VERILATOR_TRACE_FST_WRITER_TRHEAD ON) + endif() + if (${VERILATE_PREFIX}_COVERAGE) # If any verilate() call specifies COVERAGE, define VM_COVERAGE in the final build set_property(TARGET ${TARGET} PROPERTY VERILATOR_COVERAGE ON) @@ -327,6 +331,7 @@ function(verilate TARGET) VM_SC=$> $<$>:VL_THREADED> $<$>:VL_TRACE_THREADED> + $<$>:VL_TRACE_FST_WRITER_THREAD> VM_TRACE=$> VM_TRACE_VCD=$> VM_TRACE_FST=$>