S
Steven Sharp
Guest
TorbaX <heroshimo@tiscali.it> wrote in message news:<bgu634$fbm$1@lacerta.tiscalinet.it>...
at the end of whatever it prints, because that is how it is defined to
work. If this is happening with $fwrite, then you are seeing a bug.
I/O routines are written in C and are writing the output values into a
C string buffer before writing that out, then the zero byte will look
like an early end of the string, not something to be written out.
We had a similar problem with printing the zero byte with "%c" in
NC-Verilog, but we have fixed it. It was not trivial to do.
With the I/O extensions in Verilog-2001, users can now do very general
file I/O instead of just printing out messages to be read by humans. It
is reasonable to expect to be able to print out any byte value now, to
create arbitrary binary files. I would suggest reporting this to your
simulator vendor and asking them to fix it.
Note that the "%u" format descriptor writes raw binary data, and might
work even if "%c" does not. However, it writes data in units of 32 bits,
so it cannot write one byte.
Are you using $fwrite or $fdisplay? $fdisplay will always put a newlineWhere is the problem? Simply I view (with an hex editor) the characters
written to output file which don't correctly written... and after any
bytes is written "\n"(0x0A) char (but I write ONE char!!!!);
at the end of whatever it prints, because that is how it is defined to
work. If this is happening with $fwrite, then you are seeing a bug.
It is not surprising that a zero byte is not working. If the simulator'sThe reg variables are read correctly!!!!
but when I see the destination files, the characters are differents.
The char "0x00" for example is not possible to write to a output file..
I have read the Verilog IEEE 1364 specification, but I don't find the
related function to resolve the problem for writing all 256 characters
to file....
I/O routines are written in C and are writing the output values into a
C string buffer before writing that out, then the zero byte will look
like an early end of the string, not something to be written out.
We had a similar problem with printing the zero byte with "%c" in
NC-Verilog, but we have fixed it. It was not trivial to do.
With the I/O extensions in Verilog-2001, users can now do very general
file I/O instead of just printing out messages to be read by humans. It
is reasonable to expect to be able to print out any byte value now, to
create arbitrary binary files. I would suggest reporting this to your
simulator vendor and asking them to fix it.
Note that the "%u" format descriptor writes raw binary data, and might
work even if "%c" does not. However, it writes data in units of 32 bits,
so it cannot write one byte.