'How to trace specific signals using Verilator?

I have a system which I want to trace with Verilator, but using a VCD trace file is highly resource-demanding (hundreds of gigabytes) and time consuming. I changed the trace file type to FST, and the file size is reasonable, but it is still time-consuming. Tracing the whole system is not my goal at the moment because I only want the values of 8 signals, not the 16000 signals of the system.

How can I trace specific signals using Verilator?

Any help or hint would be much appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source