iverilog/vpi
Cary R ce89a68735 Add full $ferror() support, bug fixes, etc.
This patch adds $ferror() support. This is enhanced over what the standard
says needs to be supported. All file I/O routines set/clear the errno flag,
This allows $ferror() to check when an invalid fd/MCD is passed to a
system task. The $ferror() fd is only checked if errno is not set since
all the other routines will set EBADF when they are called. This allows us
to test the output from $fopen() which sets the fd to zero (an invalid fd)
when it has a problem.

The following bugs (changes) are also fixed:

Fix $fdisplay*, $fwrite*, $fstrobe*, $fflush, $fclose to not accept 0 as
a valid MCD.

For the $fdisplay*, $fwrite* and $fstrobe tasks an invalid fd/MCD is now
a warning instead of an error like the other file I/O routines.

Modify $fputc() to be a function and return a value like $ungetc().

Modify $ungetc() to return a value like the standard dictates (-1 on
error else 0) and pass the value as a full int to get EOF as an error.

Remove some extra checks that could not happen in $fseek() and to
be safe convert the numeric codes to the system symbolic values.

Skip $fstrobe callback when the fd/MCD is closed. The standard says
we need to cancel the callback, but we currently do not have the
ability to do that so just skipping this will work for now.

Free the argument handle when $fscanf() is called with an invalid fd
(memory leak).
2009-08-02 10:53:29 -07:00
..
Makefile.in Update mkinstalldirs to handle paths with spaces. 2009-02-04 08:44:22 -08:00
lxt2_write.c Synchronize lxt_write.c and lxt2_write.c with Tony Bybell 2008-01-04 16:04:18 -08:00
lxt2_write.h Synchronize lxt_write.c and lxt2_write.c with Tony Bybell 2008-01-04 16:04:18 -08:00
lxt_write.c Synchronize lxt_write.c and lxt2_write.c with Tony Bybell 2008-01-04 16:04:18 -08:00
lxt_write.h mingw needs fseeko/ftello redefinitions in lxt_write.h 2007-09-04 16:32:52 -07:00
mt19937int.c Remove most of the lingering CVS droppings. 2008-12-05 21:48:28 -08:00
sdf_lexor.lex Add support for the other edges in a SDF file. 2009-02-10 11:51:36 -08:00
sdf_parse.y Add support for the other edges in a SDF file. 2009-02-10 11:51:36 -08:00
sdf_parse_priv.h Add support for the other edges in a SDF file. 2009-02-10 11:51:36 -08:00
sdf_priv.h SDF files can have null delays. 2009-02-10 11:47:04 -08:00
stringheap.c More end of simulation memory cleanup. 2009-01-25 07:40:28 -08:00
stringheap.h More end of simulation memory cleanup. 2009-01-25 07:40:28 -08:00
sys_clog2.c More compiletf cleanup and refactoring. 2009-02-26 21:42:32 -08:00
sys_convert.c More compiletf cleanup and refactoring. 2009-02-26 21:42:32 -08:00
sys_deposit.c More compiletf cleanup and refactoring. 2009-02-26 21:42:32 -08:00
sys_display.c Add full $ferror() support, bug fixes, etc. 2009-08-02 10:53:29 -07:00
sys_fileio.c Add full $ferror() support, bug fixes, etc. 2009-08-02 10:53:29 -07:00
sys_finish.c Clean up more compiletf routines, etc. 2008-06-06 20:44:21 -07:00
sys_icarus.c Add full $ferror() support, bug fixes, etc. 2009-08-02 10:53:29 -07:00
sys_lxt.c Make the dumpers match better (VCD, LXT, LXT2). 2009-06-19 22:02:15 -07:00
sys_lxt2.c LXT2 file size limit can be set by environment variable. 2009-08-02 10:10:45 -07:00
sys_plusargs.c More compiletf cleanup and refactoring. 2009-02-26 21:42:32 -08:00
sys_priv.c More compiletf cleanup and refactoring. 2009-02-26 21:42:32 -08:00
sys_priv.h More compiletf cleanup and refactoring. 2009-02-26 21:42:32 -08:00
sys_random.c More compiletf cleanup and refactoring. 2009-02-26 21:42:32 -08:00
sys_random.h More compiletf cleanup and refactoring. 2009-02-26 21:42:32 -08:00
sys_random_mti.c More compiletf cleanup and refactoring. 2009-02-26 21:42:32 -08:00
sys_readmem.c Fix memory leak, unneeded argument. 2009-08-02 10:46:59 -07:00
sys_readmem_lex.h Fix/enhance readmem/writemem routines, etc. 2009-02-26 20:46:02 -08:00
sys_readmem_lex.lex Fix/enhance readmem/writemem routines, etc. 2009-02-26 20:46:02 -08:00
sys_scanf.c Add full $ferror() support, bug fixes, etc. 2009-08-02 10:53:29 -07:00
sys_sdf.c Fix/enhance readmem/writemem routines, etc. 2009-02-26 20:46:02 -08:00
sys_table.c Add the Verilog-2005 and Verilog-AMS constant system functions. 2008-08-29 21:11:44 -07:00
sys_time.c Add the $abstime() system function from VASM-2.3. 2009-01-09 17:26:52 -08:00
sys_vcd.c More VCD enhancements. 2009-07-03 19:38:35 -07:00
sys_vcdoff.c Rework more compiletf and calltf routines in the vpi directory. 2008-06-14 20:13:52 -07:00
system.sft Add the $abstime() system function from VASM-2.3. 2009-01-09 17:26:52 -08:00
v2005_math.c Cleanup allocated memory in the math functions and veriusertfs. 2009-01-29 17:32:53 -08:00
v2005_math.sft Add the Verilog-2005 and Verilog-AMS constant system functions. 2008-08-29 21:11:44 -07:00
va_math.c We are deprecating the $log function in favor of $log10. 2009-03-26 19:37:45 -07:00
va_math.sft Add the Verilog-2005 and Verilog-AMS constant system functions. 2008-08-29 21:11:44 -07:00
vams_simparam.c Rework $plusarg routines. 2008-11-13 15:56:29 -08:00
vcd_priv.c Add basic support for events and cleanup VCD dumper. 2009-07-03 19:38:15 -07:00
vcd_priv.h More end of simulation memory cleanup. 2009-01-25 07:40:28 -08:00
vpi_config.h.in Content-free portability fixes. 2008-09-29 18:06:47 -07:00