Guest
Hi,
Is that possible to write binary (I mean real binary, not the '0' and
'1' char)to a file in Verilog simulation? I am using NC-Verilog and
don't want to wirte the PLI function myself. I did google and someone
suggest me to use $fwrite() which +MEMPACK option but that failed in my
environment. All I want is a simple code like below:
int output_file;
initial begin
output_file = $fopen("my_output.bin", "w");
end
always @ (posedge clk)
if (data_valid)
// I don't want ASCII output in the following line
$fwrite(output_file, rd_data[31:16]);
// Thanks in advance
--
Regards,
Tsoi Kuen Hung (Brittle)
CSE CUHK
Is that possible to write binary (I mean real binary, not the '0' and
'1' char)to a file in Verilog simulation? I am using NC-Verilog and
don't want to wirte the PLI function myself. I did google and someone
suggest me to use $fwrite() which +MEMPACK option but that failed in my
environment. All I want is a simple code like below:
int output_file;
initial begin
output_file = $fopen("my_output.bin", "w");
end
always @ (posedge clk)
if (data_valid)
// I don't want ASCII output in the following line
$fwrite(output_file, rd_data[31:16]);
// Thanks in advance
--
Regards,
Tsoi Kuen Hung (Brittle)
CSE CUHK