diff --git a/parse.y b/parse.y index 9cce0a80f..b596dfbea 100644 --- a/parse.y +++ b/parse.y @@ -1206,7 +1206,7 @@ expr_primary } | K_log '(' expression ')' - { perm_string tn = perm_string::literal("$log"); + { perm_string tn = perm_string::literal("$log10"); PECallFunction*tmp = make_call_function(tn, $3); FILE_NAME(tmp,@1); $$ = tmp; diff --git a/vpi/va_math.c b/vpi/va_math.c index 602d4a1e7..a5cb115d3 100644 --- a/vpi/va_math.c +++ b/vpi/va_math.c @@ -68,7 +68,12 @@ typedef struct s_single_data { static t_single_data va_single_data[]= { {"$sqrt", sqrt}, {"$ln", log}, - {"$log", log10}, + {"$log", log10}, /* FIXME: The $log function is replaced by the + $log10 function to eliminate confusion with + the natural log. In C, "log" is ln and log10 + is log-base-10. The $log is being left in for + compatibility. */ + {"$log10", log10}, {"$exp", exp}, {"$abs", fabs}, {"$ceil", ceil}, diff --git a/vpi/va_math.sft b/vpi/va_math.sft index 3d85358a8..0c3b78e47 100644 --- a/vpi/va_math.sft +++ b/vpi/va_math.sft @@ -7,6 +7,7 @@ $sqrt vpiSysFuncReal $ln vpiSysFuncReal $log vpiSysFuncReal +$log10 vpiSysFuncReal $exp vpiSysFuncReal $abs vpiSysFuncReal $ceil vpiSysFuncReal