Thanks Gabor,
Yes, I had a typo. And, yes, it works for ISIM. With ModelSim, it errors out with the following message:
# ** Warning: test.v(5): (vlog-2269) Unterminated string literal continues onto next line 5.
# ** Error: test.v(13): (vlog-2163) Macro `MYFILE is undefined.
# ** Error: C:/modeltech64_10.0b/win64/vlog failed.
# Error in macro ./tb.fdo line 23
# C:/modeltech64_10.0b/win64/vlog failed.
# while executing
# "vlog "test.v""
Any idea to make it work for both ISIM and ModelSim?
The corrected test verilog code is re-posted here:
`timescale 1ns / 1ps
module tb;
`define ROOT_DIR "C:/tmp
`define MYFILE `ROOT_DIR/mysigfile.txt"
reg clk;
integer fh_mysigfile;
initial begin
clk = 0;
fh_mysigfile = $fopen(`MYFILE, "w");
end
always #5 clk = ~clk;
always @ ( posedge clk) begin
$fwrite(fh_mysigfile, "%1b\n", clk);
end
endmodule
Line 5 is: `define ROOT_DIR "C:/tmp