davyzhu
Advanced Member level 1
verilog fwrite
Hi all,
I want to save data to a file. And I use $fopen, %fwrite, %fclose. But I found these function only can be called in initial block. When I use them outside initial block, the compiler report errors??
I want to use it in a for block, how?
I use Modelsim 5.6.
Any suggestions will be appreciated!
//-------------------
module tb;
integer os1;
initial
begin
os1 = $fopen("E:\\tb.txt");
$fwrite(os1,"aaaaaaaaaaaa");
$fclose(os1);
end
endmodule
//-------------------
Best regards,
Davy
Hi all,
I want to save data to a file. And I use $fopen, %fwrite, %fclose. But I found these function only can be called in initial block. When I use them outside initial block, the compiler report errors??
I want to use it in a for block, how?
I use Modelsim 5.6.
Any suggestions will be appreciated!
//-------------------
module tb;
integer os1;
initial
begin
os1 = $fopen("E:\\tb.txt");
$fwrite(os1,"aaaaaaaaaaaa");
$fclose(os1);
end
endmodule
//-------------------
Best regards,
Davy