verilator/test_regress/t/t_file.v
Wilson Snyder ce10dbd11c Version bump
git-svn-id: file://localhost/svn/verilator/trunk/verilator@753 77ca24e4-aefa-0310-84f0-b9a241c72d87
2006-08-26 11:35:28 +00:00

34 lines
807 B
Verilog

// $Id$
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2003 by Wilson Snyder.
`include "verilated.v"
module t;
`verilator_file_descriptor file;
initial begin
// Display formatting
`ifdef verilator
if (file != 0) $stop;
$fwrite(file, "Never printed, file closed\n");
`endif
file = $fopen("obj_dir/t_file_test.log","w"); // The "w" is required so we get a FD not a MFD
$fdisplay(file, "[%0t] hello v=%x", $time, 32'h12345667);
$fwrite(file, "[%0t] %s\n", $time, "Hello2");
$fclose(file);
`ifdef verilator
if (file != 0) $stop;
$fwrite(file, "Never printed, file closed\n");
`endif
$write("*-* All Finished *-*\n");
$finish;
end
endmodule