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:
parent
86c22dec4f
commit
db3ff1643b
|
|
@ -11,7 +11,7 @@ License.
|
|||
Verilog-A math library built for Icarus 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
|
||||
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:
|
||||
|
||||
$ln(x) -- Natural logarithm
|
||||
$log(x) -- Decimal logarithm
|
||||
$log10(x) -- Decimal logarithm // $log is being deprecated!
|
||||
$exp(x) -- Exponential
|
||||
$sqrt(x) -- Square root
|
||||
$min(x,y) -- Minimum
|
||||
|
|
|
|||
|
|
@ -238,6 +238,12 @@ static PLI_INT32 va_single_argument_compiletf(PLI_BYTE8 *ud)
|
|||
single_funcs_count*sizeof(va_single_t **));
|
||||
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. */
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue