mirror of
https://github.com/verilator/verilator.git
synced 2025-04-05 12:12:39 +00:00
Add support of --trace-structs parameter for CMake (#2986)
This commit is contained in:
parent
1f19e8e206
commit
b0c1ac7ea2
@ -55,6 +55,7 @@ Marco Widmer
|
|||||||
Markus Krause
|
Markus Krause
|
||||||
Marlon James
|
Marlon James
|
||||||
Marshal Qiao
|
Marshal Qiao
|
||||||
|
Martin Schmidt
|
||||||
Matthew Ballance
|
Matthew Ballance
|
||||||
Michael Killough
|
Michael Killough
|
||||||
Mike Popoloski
|
Mike Popoloski
|
||||||
|
@ -115,6 +115,8 @@ class CMakeEmitter final {
|
|||||||
cmake_set_raw(*of, name + "_THREADS", cvtToStr(v3Global.opt.threads()));
|
cmake_set_raw(*of, name + "_THREADS", cvtToStr(v3Global.opt.threads()));
|
||||||
*of << "# Threaded tracing output mode? 0/1/N threads (from --trace-threads)\n";
|
*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.traceThreads()));
|
||||||
|
*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";
|
*of << "# VCD Tracing output mode? 0/1 (from --trace)\n";
|
||||||
cmake_set_raw(*of, name + "_TRACE_VCD",
|
cmake_set_raw(*of, name + "_TRACE_VCD",
|
||||||
(v3Global.opt.trace() && (v3Global.opt.traceFormat() == TraceFormat::VCD))
|
(v3Global.opt.trace() && (v3Global.opt.traceFormat() == TraceFormat::VCD))
|
||||||
|
@ -119,8 +119,15 @@ define_property(TARGET
|
|||||||
FULL_DOCS "Verilator SystemC enabled"
|
FULL_DOCS "Verilator SystemC enabled"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
define_property(TARGET
|
||||||
|
PROPERTY VERILATOR_TRACE_STRUCTS
|
||||||
|
BRIEF_DOCS "Verilator trace structs enabled"
|
||||||
|
FULL_DOCS "Verilator trace structs enabled"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
function(verilate TARGET)
|
function(verilate TARGET)
|
||||||
cmake_parse_arguments(VERILATE "COVERAGE;TRACE;TRACE_FST;SYSTEMC"
|
cmake_parse_arguments(VERILATE "COVERAGE;TRACE;TRACE_FST;SYSTEMC;TRACE_STRUCTS"
|
||||||
"PREFIX;TOP_MODULE;THREADS;TRACE_THREADS;DIRECTORY"
|
"PREFIX;TOP_MODULE;THREADS;TRACE_THREADS;DIRECTORY"
|
||||||
"SOURCES;VERILATOR_ARGS;INCLUDE_DIRS;OPT_SLOW;OPT_FAST;OPT_GLOBAL"
|
"SOURCES;VERILATOR_ARGS;INCLUDE_DIRS;OPT_SLOW;OPT_FAST;OPT_GLOBAL"
|
||||||
${ARGN})
|
${ARGN})
|
||||||
@ -168,6 +175,10 @@ function(verilate TARGET)
|
|||||||
list(APPEND VERILATOR_ARGS --cc)
|
list(APPEND VERILATOR_ARGS --cc)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (VERILATE_TRACE_STRUCTS)
|
||||||
|
list(APPEND VERILATOR_ARGS --trace-structs)
|
||||||
|
endif()
|
||||||
|
|
||||||
foreach(INC ${VERILATE_INCLUDE_DIRS})
|
foreach(INC ${VERILATE_INCLUDE_DIRS})
|
||||||
list(APPEND VERILATOR_ARGS -y "${INC}")
|
list(APPEND VERILATOR_ARGS -y "${INC}")
|
||||||
endforeach()
|
endforeach()
|
||||||
@ -277,6 +288,10 @@ function(verilate TARGET)
|
|||||||
set_property(TARGET ${TARGET} PROPERTY VERILATOR_SYSTEMC ON)
|
set_property(TARGET ${TARGET} PROPERTY VERILATOR_SYSTEMC ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (${VERILATE_PREFIX}_TRACE_STRUCTS)
|
||||||
|
set_property(TARGET ${TARGET} PROPERTY VERILATOR_TRACE_STRUCTS ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Add the compile flags only on Verilated sources
|
# Add the compile flags only on Verilated sources
|
||||||
target_include_directories(${TARGET} PUBLIC ${VDIR})
|
target_include_directories(${TARGET} PUBLIC ${VDIR})
|
||||||
target_sources(${TARGET} PRIVATE ${GENERATED_SOURCES} "${VCMAKE_COPY}"
|
target_sources(${TARGET} PRIVATE ${GENERATED_SOURCES} "${VCMAKE_COPY}"
|
||||||
|
Loading…
Reference in New Issue
Block a user