Ken, Thanks for your help! Indeed, I donot want to write the periods into the file any more after it is closed. The verlioga code is showed in following:
......
@(initial_step)begin
fp=$fopen("PLLPeriods.tcl","w");
end
@(cross((V(VCO_out)-v_th),1)) begin
if ($abstime>=tstart) $fstrobe(fp,"%3.10e",$abstime-prev);
prev=$abstime;
end
if($abstime >= tclose) $fclose(fp);
end
endmodule
Something wrong in the code ? :P
This problem is not very serious. More samples periods is not a bad thing.