SystemVerliog: simultaneous write to transcript & file

In reply to JohnE:

BTW, this was a Verilog-2001 addition, nothing to do with SystemVerilog.

What matters is if you use $fopen with one argument (“the file name”), or use a second argument (“a type descriptor”)

With one argument, $fopen returns a 32-bit multichannel file descriptor with bits 0 and 31 reserved. Bit-0 is reserved for standard output, and bit-31 is always 0. The other 30 bits are assigned to 30 different files and combined with the standard output. There is no defined ordering of those 30 bits.

With two arguments, $fopen opens as may files as your operating system will allow. Bit-31 is set to 1 and you cannot combine file descriptors.