A
Andrew Greensted
Guest
Hi All,
I'm using the textio functions to log some generated data to a file.
The problem is I need to:
- buffer some data
- write out a buffer length counter
- write out the buffer
Essentially I have:
file outputFile : text open WRITE_MODE is "dataFile.dat";
variable lineTMP : line;
variable lineOut : line;
write(lineTMP, somedata);
write(lineTMP, someMoreData); etc....
count <= b"10";
hwrite(lineOut, std_logic_vector(to_unsigned(count, 8)));
write(lineOut, string'(": "));
writeLine(outputFile, lineOut);
writeLine(outputFile, lineTMP);
However, there is a new line between lines. Is there some way to
concatenate the lines before doing the write? Note, I don't know the
count value until I've received all the buffered data.
If I could convert lineTMP to a string, I could just write this out to
lineOUT, before the writeLine call.
Thanks
Andy
I'm using the textio functions to log some generated data to a file.
The problem is I need to:
- buffer some data
- write out a buffer length counter
- write out the buffer
Essentially I have:
file outputFile : text open WRITE_MODE is "dataFile.dat";
variable lineTMP : line;
variable lineOut : line;
write(lineTMP, somedata);
write(lineTMP, someMoreData); etc....
count <= b"10";
hwrite(lineOut, std_logic_vector(to_unsigned(count, 8)));
write(lineOut, string'(": "));
writeLine(outputFile, lineOut);
writeLine(outputFile, lineTMP);
However, there is a new line between lines. Is there some way to
concatenate the lines before doing the write? Note, I don't know the
count value until I've received all the buffered data.
If I could convert lineTMP to a string, I could just write this out to
lineOUT, before the writeLine call.
Thanks
Andy