Documente Academic
Documente Profesional
Documente Cultură
integer MyFileHandle; MyFileHandle = $fopen(MyFileName,MyAccessType); $fclose(MyFileHandle); Access Type r or rb w or wb a or ab Meaning Open text or binary le for reading Open text or binary le for write Open text or binary le for appending
r e a l MyNumber ; integer i ; i = 1; w h i l e ( i > 0) begin @( posedge C h a n g e I n p u t s ) ; i=$ f s c a n f ( M y I n p u t F i l e , %f , MyNumber ) ; end %b %h %t %m %v binary hexadecimal time module name strength %d %s %c %f %e decimal string character real exponential
The $fscanf should return 1 at end-of-le. . . this is broken in Xilinx ISE Version 11. . . use $feof instead.
integer MyFileDescriptor ; r e a l MyNumber ; M y F i l e D e s c r i p t o r = $ fopen ( MyFileName , w ) ; always @( posedge O u t p u t S t r o b e ) $ f d i s p l a y ( M y F i l e D e s c r i p t o r , %f , MyNumber ) ; $fwrite is similar to $fdisplay but does not append an end-of-line.
parameter STDOUT = 1 ; i n t e g e r MyMCD; // A m u l t i c h a n n e l d e s c r i p t o r r e a l MyNumber ; MyMCD = $ fopen ( MyFileName ) ; // no a c c e s s t y p e always @( posedge O u t p u t S t r o b e ) ; $ f d i s p l a y ( (MyMCD | STDOUT) , %f , MyNumber ) ; end Note that $fdisplay (STDOUT, %f, MyNumber); is equivalent to $display(%f, MyNumber); and similar equivalents exist for $fwrite and $fmonitor.
initial $ monitor ( A= %h t i m e= %t , MySig , $ r e a l t i m e ) ; A monitor prints whenever one of the specied variables changes. Only one monitor can be active at any time. Using $fmonitor with a le handle writes to a le
Write when signal becomes stable ($fstrobe) Read, write, and display without format string
Default format is decimal Final character of command is default format (e.g. $writeb for binary)