Forum Discussion
How do I make modelsim fwrite/dump an 8 bit array literally in binary.
- 5 years ago
Hello SyafieqS, thank you for your reply, but, your link does not cover any binary writing of data. It is ok as I fround out how and finally got my testbench SystemVerilog .bmp picture saver working.
Source example located here: https://www.eevblog.com/forum/fpga/systemverilog-example-testbench-which-saves-a-bmp-picture-and-executes-a-script/msg3448860/#msg3448860
Instruction are located in the first post in that thread.
The relevant code is in the source file 'ellipse_generator_tb.sv' line 203, opening the file for write as a 'wb' for write binary. And when $fwrite data, the two possible in quotes methods are "%c" for a single character, or "%u" for writing a 32bit word located on lines 215, 218 & 225.
Hi Brian,
I found refence related to read and write to file using SV and few examples that might be helpful. Please refer to link below for details
Thanks,
Regards
Hello SyafieqS, thank you for your reply, but, your link does not cover any binary writing of data. It is ok as I fround out how and finally got my testbench SystemVerilog .bmp picture saver working.
Source example located here: https://www.eevblog.com/forum/fpga/systemverilog-example-testbench-which-saves-a-bmp-picture-and-executes-a-script/msg3448860/#msg3448860
Instruction are located in the first post in that thread.
The relevant code is in the source file 'ellipse_generator_tb.sv' line 203, opening the file for write as a 'wb' for write binary. And when $fwrite data, the two possible in quotes methods are "%c" for a single character, or "%u" for writing a 32bit word located on lines 215, 218 & 225.