Guest
I'm trying to write data from a port to a file in binary format. This
is my code.
integer v_hand;
integer vcount;
initial
begin
v_hand = $fopen("vid_test.es", "w");
vcount = 0;
forever @(posedge Clk)
if (VS_Valid)
begin
vcount = vcount + 1;
if (vcount == 16) vcount = 0;
$fwrite(vhand, "%x%c", VS_Data, (vcount == 0) ? "\n" : " ");
end
end
This writes the code in a hex \ characters as opposed to hex \ binary
Any suggestions
PJ
is my code.
integer v_hand;
integer vcount;
initial
begin
v_hand = $fopen("vid_test.es", "w");
vcount = 0;
forever @(posedge Clk)
if (VS_Valid)
begin
vcount = vcount + 1;
if (vcount == 16) vcount = 0;
$fwrite(vhand, "%x%c", VS_Data, (vcount == 0) ? "\n" : " ");
end
end
This writes the code in a hex \ characters as opposed to hex \ binary
Any suggestions
PJ