Way to write "stdout" into file using file based system task or functions

HI,

I wants to capture the simulation data that send to “stdout” into txt or binary file using System-Verilog file based system task/functions.
Please let me know the possibilities.

Thanks in advance.

Regards
Suresh

There are many possibilities.

  1. Add -l log.txt to your simulation command line and everything that goes to stdout will also go to log.txt
  2. redirect all output to a file if you are using a C-shell vim … >>file
  3. Use one of the file I/O system tasks listed in section 21.3 File input/output system tasks and system functions
  4. Ideally you should use the UVM reporting facility to control all output that would go to stdout and be able to re-direct it to a log file.