We are deprecating the $log function in favor of $log10.

When the VAMS math functions were originally built we did a
straight copy of the log() function to $log(). This can
conflict with other Verilog-D definitions of $log. We
need to deprecate this function and remove it before the
next major release.
This commit is contained in:
Cary R 2009-03-26 13:41:33 -07:00 committed by Stephen Williams
parent 86c22dec4f
commit db3ff1643b
2 changed files with 8 additions and 2 deletions

View File

@ -11,7 +11,7 @@ License.
Verilog-A math library built for Icarus Verilog Verilog-A math library built for Icarus Verilog
http://www.icarus.com/eda/verilog/ http://www.icarus.com/eda/verilog/
Copyright (C) 2007-2008 Cary R. (cygcary@yahoo.com) Copyright (C) 2007-2009 Cary R. (cygcary@yahoo.com)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -38,7 +38,7 @@ like all Verilog-D system functions the name must be prefixed with a '$'.
For reference the functions are: For reference the functions are:
$ln(x) -- Natural logarithm $ln(x) -- Natural logarithm
$log(x) -- Decimal logarithm $log10(x) -- Decimal logarithm // $log is being deprecated!
$exp(x) -- Exponential $exp(x) -- Exponential
$sqrt(x) -- Square root $sqrt(x) -- Square root
$min(x,y) -- Minimum $min(x,y) -- Minimum

View File

@ -238,6 +238,12 @@ static PLI_INT32 va_single_argument_compiletf(PLI_BYTE8 *ud)
single_funcs_count*sizeof(va_single_t **)); single_funcs_count*sizeof(va_single_t **));
single_funcs[single_funcs_count-1] = fun_data; single_funcs[single_funcs_count-1] = fun_data;
if (strcmp(name, "$log") == 0) {
vpi_printf("%s:%d: deprecation: ", vpi_get_str(vpiFile, callh),
(int)vpi_get(vpiLineNo, callh));
vpi_printf("Please use $log10() instead of $log()!\n");
}
/* vpi_scan() returning 0 (NULL) has already freed argv. */ /* vpi_scan() returning 0 (NULL) has already freed argv. */
return 0; return 0;
} }