[Verilog] How to save data to a file?

D

Davy

Guest
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
 
Try another version of ModelSim, I have been using complex file I/O
with ModelSim 6.0c and later.

RAUL
 

Welcome to EDABoard.com

Sponsor

Back
Top