From df4500ecb7d0be4fdcef557d646e5abf43818857 Mon Sep 17 00:00:00 2001 From: PFiS1737 Date: Thu, 11 Jun 2026 18:07:51 +0800 Subject: fix(verilator): make sure to define TRACE --- xmake/rules/verilator/verilator.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xmake/rules/verilator/verilator.lua b/xmake/rules/verilator/verilator.lua index e1535ecd8..1530be62c 100644 --- a/xmake/rules/verilator/verilator.lua +++ b/xmake/rules/verilator/verilator.lua @@ -201,6 +201,7 @@ endmodule]]) switches.TIMING = options_table["use_timing"] and "1" or "0" -- The thread field is a integer in float format, we need to convert it to string. switches.THREADS = string.format("%d", options_table["threads"] or 1) + switches.TRACE = options_table["trace"] and "1" or "0" switches.TRACE_VCD = options_table["trace_vcd"] and "1" or "0" switches.TRACE_FST = options_table["trace_fst"] and "1" or "0" switches.TRACE_SAIF = options_table["trace_saif"] and "1" or "0" @@ -224,11 +225,17 @@ endmodule]]) -- Threaded output mode? 1/N threads (from --threads) switches.THREADS = values:trim() elseif key == "test_TRACE_VCD" then - -- VCD Tracing output mode? 0/1 (from --trace) + -- VCD Tracing output mode? 0/1 (from --trace-vcd) + switches.TRACE = values:trim() switches.TRACE_VCD = values:trim() elseif key == "test_TRACE_FST" then -- FST Tracing output mode? 0/1 (from --trace-fst) + switches.TRACE = values:trim() switches.TRACE_FST = values:trim() + elseif key == "test_TRACE_SAIF" then + -- SAIF Tracing output mode? 0/1 (from --trace-saif) + switches.TRACE = values:trim() + switches.TRACE_SAIF = values:trim() end end) end -- cgit v1.3.1 From f79a29470d8384072a5931af05354130f997a032 Mon Sep 17 00:00:00 2001 From: PFiS1737 Date: Thu, 11 Jun 2026 18:19:31 +0800 Subject: fix --- xmake/rules/verilator/verilator.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xmake/rules/verilator/verilator.lua b/xmake/rules/verilator/verilator.lua index 1530be62c..72de7b91b 100644 --- a/xmake/rules/verilator/verilator.lua +++ b/xmake/rules/verilator/verilator.lua @@ -226,18 +226,21 @@ endmodule]]) switches.THREADS = values:trim() elseif key == "test_TRACE_VCD" then -- VCD Tracing output mode? 0/1 (from --trace-vcd) - switches.TRACE = values:trim() switches.TRACE_VCD = values:trim() elseif key == "test_TRACE_FST" then -- FST Tracing output mode? 0/1 (from --trace-fst) - switches.TRACE = values:trim() switches.TRACE_FST = values:trim() elseif key == "test_TRACE_SAIF" then -- SAIF Tracing output mode? 0/1 (from --trace-saif) - switches.TRACE = values:trim() switches.TRACE_SAIF = values:trim() end end) + + switches.TRACE = ( + switches.TRACE_VCD == "1" or + switches.TRACE_FST == "1" or + switches.TRACE_SAIF == "1" + ) and "1" or "0" end assert(verilator_root, "the verilator root directory not found!") -- cgit v1.3.1