Quote:
> Since i am using Verilog-95 constructs, hence the system task $ferror
> cannot be used, and $feof is also not possible as i am using Modelsim.
I just thought I would point out that $fgets is not a Verilog-1995
construct. It was added to Verilog-2001 along with $ferror. I don't
know why a $feof was not added at the same time. I have already
proposed this to the IEEE as a possible enhancement.
$fgets will return 0 if it fails to read anything, due to an error
or presumably end of file. This would be the most obvious way of
detecting that you have reached end of file. However, Modelsim might
produce the error message at that time, so this might not allow you
to avoid it. There are also some things you could do with $ftell and
$fseek, but that would be clumsy.