Commit Graph

21 Commits

Author SHA1 Message Date
Martin Whitaker a92a3074c0 Fix some missing/incorrect function return types in the system VPI modules. 2019-10-21 13:45:09 +01:00
Martin Whitaker 0d494da702 Further fixes for const-correctness.
- allow ICARUS_VPI_CONST to be pre-defined by the user
- use it for sizetf as well as for compiletf and calltf
- fix remaining warnings when it is defined as 'const'
2018-09-29 12:04:16 +01:00
Cary R 774d173d69 Remove missing parameter warnings 2014-07-09 14:16:57 -07:00
Larry Doolittle 6ebb57195b Fuss with C function prototypes
119 formal void parameters added to keep -Wstrict-prototypes happy.
Process found one real missing prototype in vpi/vcd_priv.h:
EXTERN void vcd_names_delete(struct vcd_names_list_s*tab);
8 such warnings left, all in Tony's code
2014-07-08 13:44:11 -07:00
Cary R 12c588fc35 Mostly fix a portability problem in $rtoi (run time) 2013-10-11 17:32:58 -07:00
Cary R 7b07fca285 Fix $rtoi to correctly convert NaN and +/- infinity 2013-10-11 10:49:45 -07:00
Arun Persaud f5aafc32f9 updated FSF-address 2012-08-29 10:12:10 -07:00
Larry Doolittle 5d977cac73 Brainless start to const-correct changes
Results of running
cd vpi
for f in *.c *.h; do sed -i \
  -e "s/_calltf(PLI_BYTE8/_calltf(ICARUS_VPI_CONST PLI_BYTE8/" \
  -e "s/_compiletf(PLI_BYTE8/_compiletf(ICARUS_VPI_CONST PLI_BYTE8/" $f; done
and a trivial patch to vpi_user.h to, among other things, make
ICARUS_VPI_CONST blank.

Thus, this patch does absolutely nothing.  Will be followed by a
(much shorter) patch that makes it do something.  :-)
2010-10-06 15:08:54 -07:00
Cary R ecacd7bae9 Make sure to call vpi_config.h first.
vpi_config.h defines _FILE_OFFSET_BITS. This must be defined before
any system includes files are processed, so vpi_config.h must be
called first. This patch puts vpi_config.h first. It also removes
direct calls for both vpi_config.h and vpi_user.h when sys_priv.h
is included since it already includes these two files.

It also updates the code to always include vpi_user.h using double
quotes.
2010-05-17 20:51:59 -07:00
Cary R f2d5acabd5 Add support for vpiUserSystf iteration, etc.
This patch adds support for iterating over the list of vpiUserSystf
tasks/functions that have vpiUserDefn set. The vpiUserDefn property
is true by default, but you can call vpip_make_systf_system_defined()
to set this property false (will hide the vpiUserSystf object). All
the normal system tasks/functions have been modified to call this
procedure to remove them from the list of vpiUserSystf objects. Only
user defined system tasks or functions should appear in the list.

vpi_compare_objects() is just a simple are the two pointers the
same. This works correctly for the vpiUserSystf objects, but the
other handle objects have not been checked.
2010-04-13 20:54:59 -07:00
Cary R ddea64445c More compiletf cleanup and refactoring.
This patch adds compiletf routines for the mti random functions
and adds a common routine to check for extra arguments. It also
adds file and line information to the rest of the compiletf
routines that were missing them.
2009-02-26 21:42:32 -08:00
Cary R 221b83b932 Rework $plusarg routines.
This patch addresses a number of issues:

Rewrote the $test$plusargs and $value$plusargs routines to have
better error/warning messages, to support runtime strings, to
correctly load bit based values (truncating, padding, negative
value), added support for the real formats using strtod() and
added "x/X" as an alias for "h/H" to match the other part of
Icarus.

Rewrite the vpip_{bin,oct,hex}_str_to_vec4 routines to ignore
embedded "_" characters. Add support for a negative value and
set the entire value to 'bx if an invalid digit is found. A
warning is printed for this case.

Rewrite vpip_dec_str_to_vec4 to ignore embedded "_" characters,
to support a single "x" or "z" constant and to return 'bx if an
invalid digit is found. A warning is printed for this case.

It simplifies the system task/functions error/warning messages.

It removes the signed flag for the bin and dec string conversions.
This was not being used (was always false) and the new negative
value support makes this obsolete.

Add support for a real variable to handle Bin, Oct, Dec and Hex
strings. They are converted into a vvp_vector4_t which is then
converted to a real value.

Add support for setting a bit based value using a real value.

Removed an unneeded rfp signal in vpip_make_reg()
2008-11-13 15:56:29 -08:00
Stephen Williams c3ac01d31b Make casts from double to unsigned bits portable.
Several places in Icarus Verilog try to get the bits of the integer
part of a double by casting to unsigned or unsigned long. But that
causes some compilers to generate smart code that converts all values
less then 0 to 0, even though we are after the bits, not the math
value. So be careful to do this cast only to non-negative values and
uminus the bits if necessary to get exactly what we want.

Signed-off-by: Stephen Williams <steve@icarus.com>
2008-04-27 18:21:32 -07:00
Cary R 61b6b8358d Speed up the conversion functions and add file/line info.
This patch modifies the conversion functions $rtoi, $itor,
$realtobits and $bitstoreal calltf routines to be more efficient.
This is done by caching the vpiHandle to the argument in the userdata
pointer. This eliminated the need to get the argument iterator, scan
and free the iterator.

It also updates the error messages to use the new file and line
number information that is available for system functions. It also
adds a check that verifies the functions are only called with one
argument and makes the errors fatal.
2008-01-07 18:59:52 -08:00
steve 72ec3a2c09 VPI tasks take PLI_BYTE* by the standard. 2007-03-14 04:05:51 +00:00
steve 841378426f Updates for Cygwin portability (pr1585922) 2006-10-30 22:45:36 +00:00
steve 0fd5a79760 Cleanup of warnings. 2004-02-15 18:03:30 +00:00
steve 4987970af4 Give the vip directory its own configure and vpi_config.h 2004-01-21 01:22:51 +00:00
steve 99b1cb0f74 Implement $itor and $bitstoreal 2003-03-17 21:59:54 +00:00
steve 7e9095acf2 Add support for $rtoi 2003-03-10 23:40:10 +00:00
steve f40ea15cce Implement $realtobits. 2003-03-07 02:44:33 +00:00