Writing to a file

Keywords: $fdisplay, $fmonitor, $fwrite
Syntax:
$fdisplay(<file_handles>, --same as display--);
$fmonitor(<file_handles>, --same as monitor--);
$fwrite(<file_handles>, --same as write--);

More than one channel can be specified by assigning the file_handles an integer with more than one bit set. So for example if we wanted to write to standard output and to myfile as described in the previous page, file_handles would be 0000_0000_0000_0000_0000_0000_0000_0011.

The example below illustrates the usage.

        // using the handles described in the previous section

        integer channelsA;

        initial begin
          channelsA = handleA | 1;       // now th 2 MSBs are set to output
          $fdisplay(channelsA, "Hello"); // will be to 'myfile' and standard outut
        end


previous next contents