How do I make modelsim fwrite/dump an 8 bit array literally in binary.
I'm having trouble finding the right way to dump a memory array from my System Verilog testbench into a file. This is as close as I can get, but, it has 2 problems.
Anytime I try to write character 8'h00, it gets replaced with character 8'h20.
Anytime I try to write character 8'h0A, 2 characters come out, first 8'h0D, then 8'h0A.
for (int i=0;i<256;i++) $fwrite(fout_pointer,"%s",8'(i)) ;
This code is supposed to generate a file where if I analyze it with a hex editor, it should go from 8'h00 the 8'hFF. But, the 8'h00 position has an 8'h20 and the 8'h0A position has a 8'h0D, then the 8'h0A comes next.