From 2f3061c158f731699ff02b21b64a92cbd0e4b7c2 Mon Sep 17 00:00:00 2001 From: Cary R Date: Thu, 26 Mar 2009 13:41:33 -0700 Subject: [PATCH] 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. --- va_math.txt | 4 ++-- vpi/va_math.c | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/va_math.txt b/va_math.txt index 59756401e..b654acf52 100644 --- a/va_math.txt +++ b/va_math.txt @@ -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 diff --git a/vpi/va_math.c b/vpi/va_math.c index 02eed55b2..91523de7a 100644 --- a/vpi/va_math.c +++ b/vpi/va_math.c @@ -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; }