2008-06-03 04:23:48 +02:00
|
|
|
/*
|
2018-09-29 09:53:32 +02:00
|
|
|
* Copyright (C) 2008-2018 Cary R. (cygcary@yahoo.com)
|
2008-06-03 04:23:48 +02:00
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
*/
|
|
|
|
|
|
2010-05-17 18:38:23 +02:00
|
|
|
#include "sys_priv.h"
|
2008-06-03 04:23:48 +02:00
|
|
|
#include <assert.h>
|
|
|
|
|
#include <math.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <unistd.h>
|
2009-11-27 18:25:50 +01:00
|
|
|
#include "version_base.h"
|
2008-06-03 04:23:48 +02:00
|
|
|
|
|
|
|
|
/* Once we have real string objects replace this with a dynamic string. */
|
|
|
|
|
#define MAX_STRING_RESULT 1024
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Check that the routines are called with the correct arguments.
|
|
|
|
|
*/
|
2010-10-04 18:31:01 +02:00
|
|
|
static PLI_INT32 simparam_compiletf(ICARUS_VPI_CONST PLI_BYTE8 *name_ext)
|
2008-06-03 04:23:48 +02:00
|
|
|
{
|
2008-09-30 03:06:47 +02:00
|
|
|
vpiHandle callh, argv, arg;
|
|
|
|
|
|
|
|
|
|
callh = vpi_handle(vpiSysTfCall, 0);
|
2008-06-03 04:23:48 +02:00
|
|
|
assert(callh != 0);
|
2008-09-30 03:06:47 +02:00
|
|
|
argv = vpi_iterate(vpiArgument, callh);
|
2008-06-03 04:23:48 +02:00
|
|
|
|
|
|
|
|
/* We must have at least one argument. */
|
|
|
|
|
if (argv == 0) {
|
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 22:28:19 +01:00
|
|
|
vpi_printf("ERROR: %s:%d: ", vpi_get_str(vpiFile, callh),
|
2008-06-03 04:23:48 +02:00
|
|
|
(int)vpi_get(vpiLineNo, callh));
|
2008-06-06 04:25:19 +02:00
|
|
|
vpi_printf("$simparam%s requires a string argument.\n", name_ext);
|
2008-06-03 04:23:48 +02:00
|
|
|
vpi_control(vpiFinish, 1);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* The first argument must be a string. */
|
|
|
|
|
arg = vpi_scan(argv);
|
|
|
|
|
if (! is_string_obj(arg)) {
|
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 22:28:19 +01:00
|
|
|
vpi_printf("ERROR: %s:%d: ", vpi_get_str(vpiFile, callh),
|
2008-06-03 04:23:48 +02:00
|
|
|
(int)vpi_get(vpiLineNo, callh));
|
2008-06-06 04:25:19 +02:00
|
|
|
vpi_printf("The first argument to $simparam%s must be a string.\n",
|
|
|
|
|
name_ext);
|
2008-06-03 04:23:48 +02:00
|
|
|
vpi_control(vpiFinish, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* The second argument (default value) is optional. */
|
|
|
|
|
arg = vpi_scan(argv);
|
|
|
|
|
if (arg == 0) return 0;
|
2008-06-04 02:12:27 +02:00
|
|
|
|
2008-06-03 04:23:48 +02:00
|
|
|
/* For the string version the default must also be a string. */
|
2008-06-06 04:25:19 +02:00
|
|
|
if (strcmp(name_ext, "$str") == 0) {
|
2008-06-03 04:23:48 +02:00
|
|
|
if (! is_string_obj(arg)) {
|
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 22:28:19 +01:00
|
|
|
vpi_printf("ERROR: %s:%d: ", vpi_get_str(vpiFile, callh),
|
2008-06-03 04:23:48 +02:00
|
|
|
(int)vpi_get(vpiLineNo, callh));
|
2008-06-04 02:12:27 +02:00
|
|
|
vpi_printf("When provided, the second argument to $simparam%s"
|
2008-06-06 04:25:19 +02:00
|
|
|
"must be a string.\n", name_ext);
|
2008-06-03 04:23:48 +02:00
|
|
|
vpi_control(vpiFinish, 1);
|
|
|
|
|
}
|
|
|
|
|
/* For the rest the default must be numeric. */
|
|
|
|
|
} else {
|
|
|
|
|
if (! is_numeric_obj(arg)) {
|
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 22:28:19 +01:00
|
|
|
vpi_printf("ERROR: %s:%d: ", vpi_get_str(vpiFile, callh),
|
2008-06-03 04:23:48 +02:00
|
|
|
(int)vpi_get(vpiLineNo, callh));
|
2008-06-04 02:12:27 +02:00
|
|
|
vpi_printf("When provided, the second argument to $simparam%s"
|
2008-06-06 04:25:19 +02:00
|
|
|
"must be numeric.\n", name_ext);
|
2008-06-03 04:23:48 +02:00
|
|
|
vpi_control(vpiFinish, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-06-21 03:11:11 +02:00
|
|
|
/* We can have a maximum of two arguments. */
|
2008-06-03 04:23:48 +02:00
|
|
|
if (vpi_scan(argv) != 0) {
|
2011-05-02 18:09:22 +02:00
|
|
|
char msg[64];
|
2008-09-30 03:06:47 +02:00
|
|
|
unsigned argc;
|
|
|
|
|
|
2011-05-02 18:09:22 +02:00
|
|
|
snprintf(msg, sizeof(msg), "ERROR: %s:%d:",
|
2008-06-06 04:25:19 +02:00
|
|
|
vpi_get_str(vpiFile, callh),
|
|
|
|
|
(int)vpi_get(vpiLineNo, callh));
|
2011-05-02 18:09:22 +02:00
|
|
|
msg[sizeof(msg)-1] = 0;
|
2008-06-06 04:25:19 +02:00
|
|
|
|
2008-09-30 03:06:47 +02:00
|
|
|
argc = 1;
|
2008-06-06 04:25:19 +02:00
|
|
|
while (vpi_scan(argv)) argc += 1;
|
|
|
|
|
|
|
|
|
|
vpi_printf("%s $simparam%s takes at most two arguments.\n",
|
|
|
|
|
msg, name_ext);
|
|
|
|
|
vpi_printf("%*s Found %u extra argument%s.\n",
|
2008-06-20 19:12:17 +02:00
|
|
|
(int) strlen(msg), " ", argc, argc == 1 ? "" : "s");
|
2008-06-06 04:25:19 +02:00
|
|
|
vpi_control(vpiFinish, 1);
|
2008-06-03 04:23:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2010-10-04 18:31:01 +02:00
|
|
|
static PLI_INT32 simparam_calltf(ICARUS_VPI_CONST PLI_BYTE8 *name_ext)
|
2008-06-03 04:23:48 +02:00
|
|
|
{
|
|
|
|
|
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
|
|
|
|
|
vpiHandle argv = vpi_iterate(vpiArgument, callh);
|
|
|
|
|
vpiHandle arg;
|
|
|
|
|
s_vpi_value val;
|
|
|
|
|
char *param;
|
|
|
|
|
unsigned have_def_val = 0;
|
|
|
|
|
double retval, defval = 0.0;
|
|
|
|
|
|
|
|
|
|
/* Get the parameter we are looking for. */
|
|
|
|
|
arg = vpi_scan(argv);
|
|
|
|
|
val.format = vpiStringVal;
|
|
|
|
|
vpi_get_value(arg, &val);
|
|
|
|
|
param = strdup(val.value.str);
|
|
|
|
|
|
|
|
|
|
/* See if there is a default value. */
|
|
|
|
|
arg = vpi_scan(argv);
|
|
|
|
|
if (arg != 0) {
|
|
|
|
|
vpi_free_object(argv);
|
|
|
|
|
have_def_val = 1;
|
|
|
|
|
val.format = vpiRealVal;
|
|
|
|
|
vpi_get_value(arg, &val);
|
|
|
|
|
defval = val.value.real;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Now check the various things we can return. */
|
|
|
|
|
if (strcmp(param, "gdev") == 0) {
|
|
|
|
|
retval = 0.0; /* Nothing for now. */
|
|
|
|
|
} else if (strcmp(param, "gmin") == 0) {
|
|
|
|
|
retval = 0.0; /* Nothing for now. */
|
|
|
|
|
} else if (strcmp(param, "imax") == 0) {
|
|
|
|
|
retval = 0.0; /* Nothing for now. */
|
|
|
|
|
} else if (strcmp(param, "imelt") == 0) {
|
|
|
|
|
retval = 0.0; /* Nothing for now. */
|
|
|
|
|
} else if (strcmp(param, "iteration") == 0) {
|
|
|
|
|
retval = 0.0; /* Nothing for now. */
|
|
|
|
|
} else if (strcmp(param, "scale") == 0) {
|
|
|
|
|
retval = 0.0; /* Nothing for now. */
|
|
|
|
|
} else if (strcmp(param, "shrink") == 0) {
|
|
|
|
|
retval = 0.0; /* Nothing for now. */
|
|
|
|
|
} else if (strcmp(param, "simulatorSubversion") == 0) {
|
2009-11-27 18:25:50 +01:00
|
|
|
retval = VERSION_MINOR;
|
2008-06-03 04:23:48 +02:00
|
|
|
} else if (strcmp(param, "simulatorVersion") == 0) {
|
2009-11-27 18:25:50 +01:00
|
|
|
retval = VERSION_MAJOR;
|
2008-06-03 04:23:48 +02:00
|
|
|
} else if (strcmp(param, "sourceScaleFactor") == 0) {
|
|
|
|
|
retval = 0.0; /* Nothing for now. */
|
|
|
|
|
} else if (strcmp(param, "tnom") == 0) {
|
|
|
|
|
retval = 0.0; /* Nothing for now. */
|
|
|
|
|
} else if (strcmp(param, "timeUnit") == 0) {
|
|
|
|
|
retval = pow(10, vpi_get(vpiTimeUnit, sys_func_module(callh)));
|
|
|
|
|
} else if (strcmp(param, "timePrecision") == 0) {
|
|
|
|
|
retval = pow(10, vpi_get(vpiTimePrecision, sys_func_module(callh)));
|
|
|
|
|
} else if (strcmp(param, "CPUWordSize") == 0) {
|
|
|
|
|
retval = 8.0*sizeof(long);
|
|
|
|
|
} else {
|
|
|
|
|
if (! have_def_val) {
|
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 22:28:19 +01:00
|
|
|
vpi_printf("ERROR: %s:%d: ", vpi_get_str(vpiFile, callh),
|
2008-06-03 04:23:48 +02:00
|
|
|
(int)vpi_get(vpiLineNo, callh));
|
2008-06-06 04:25:19 +02:00
|
|
|
vpi_printf("$simparam%s unknown parameter name \"%s\".\n",
|
|
|
|
|
name_ext, param);
|
2008-06-03 04:23:48 +02:00
|
|
|
}
|
|
|
|
|
retval = defval;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
free(param);
|
|
|
|
|
|
|
|
|
|
/* Return the value to the system. */
|
|
|
|
|
val.format = vpiRealVal;
|
|
|
|
|
val.value.real = retval;
|
|
|
|
|
vpi_put_value(callh, &val, 0, vpiNoDelay);
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2010-10-04 18:31:01 +02:00
|
|
|
static PLI_INT32 simparam_str_calltf(ICARUS_VPI_CONST PLI_BYTE8 *name_ext)
|
2008-06-03 04:23:48 +02:00
|
|
|
{
|
|
|
|
|
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
|
|
|
|
|
vpiHandle argv = vpi_iterate(vpiArgument, callh);
|
|
|
|
|
vpiHandle arg;
|
|
|
|
|
s_vpi_value val;
|
|
|
|
|
char *param;
|
|
|
|
|
char *retval, *defval = NULL;
|
|
|
|
|
|
|
|
|
|
/* Get the parameter we are looking for. */
|
|
|
|
|
arg = vpi_scan(argv);
|
|
|
|
|
val.format = vpiStringVal;
|
|
|
|
|
vpi_get_value(arg, &val);
|
|
|
|
|
param = strdup(val.value.str);
|
|
|
|
|
|
|
|
|
|
/* See if there is a default value. */
|
|
|
|
|
arg = vpi_scan(argv);
|
|
|
|
|
if (arg != 0) {
|
|
|
|
|
vpi_free_object(argv);
|
|
|
|
|
val.format = vpiStringVal;
|
|
|
|
|
vpi_get_value(arg, &val);
|
|
|
|
|
defval = strdup(val.value.str);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Now check the various things we can return. */
|
|
|
|
|
/* For now we limit the result to 1024 characters. */
|
|
|
|
|
if (strcmp(param, "analysis_name") == 0) {
|
|
|
|
|
retval = strdup("N/A"); /* Nothing for now. */
|
|
|
|
|
} else if (strcmp(param, "analysis_type") == 0) {
|
|
|
|
|
retval = strdup("N/A"); /* Nothing for now. */
|
|
|
|
|
} else if (strcmp(param, "cwd") == 0) {
|
|
|
|
|
char path [MAX_STRING_RESULT];
|
|
|
|
|
char *ptr = getcwd(path, MAX_STRING_RESULT);
|
|
|
|
|
if (ptr == NULL) {
|
2011-10-21 00:48:07 +02:00
|
|
|
strcpy(path, "<error getting the cwd, is it too long?>");
|
2008-06-03 04:23:48 +02:00
|
|
|
}
|
|
|
|
|
retval = strdup(path);
|
|
|
|
|
} else if (strcmp(param, "module") == 0) {
|
|
|
|
|
retval = strdup(vpi_get_str(vpiDefName, sys_func_module(callh)));
|
|
|
|
|
} else if (strcmp(param, "instance") == 0) {
|
|
|
|
|
retval = strdup(vpi_get_str(vpiFullName, sys_func_module(callh)));
|
|
|
|
|
} else if (strcmp(param, "path") == 0) {
|
|
|
|
|
retval = strdup(vpi_get_str(vpiFullName,
|
|
|
|
|
vpi_handle(vpiScope,callh)));
|
|
|
|
|
} else {
|
2014-07-28 19:45:01 +02:00
|
|
|
if (defval == NULL) {
|
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 22:28:19 +01:00
|
|
|
vpi_printf("ERROR: %s:%d: ", vpi_get_str(vpiFile, callh),
|
2008-06-03 04:23:48 +02:00
|
|
|
(int)vpi_get(vpiLineNo, callh));
|
2008-06-06 04:25:19 +02:00
|
|
|
vpi_printf("$simparam%s unknown parameter name \"%s\".\n",
|
|
|
|
|
name_ext, param);
|
2008-06-03 04:23:48 +02:00
|
|
|
defval = strdup("<error>");
|
|
|
|
|
}
|
|
|
|
|
retval = defval;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
free(param);
|
|
|
|
|
|
|
|
|
|
/* Return the value to the system. */
|
|
|
|
|
val.format = vpiStringVal;
|
|
|
|
|
val.value.str = retval;
|
|
|
|
|
vpi_put_value(callh, &val, 0, vpiNoDelay);
|
2014-07-28 19:45:01 +02:00
|
|
|
if (defval != retval) free(defval);
|
2008-06-03 04:23:48 +02:00
|
|
|
free(retval);
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-29 09:53:32 +02:00
|
|
|
static PLI_INT32 simparam_str_sizetf(ICARUS_VPI_CONST PLI_BYTE8 *name_ext)
|
2008-06-03 04:23:48 +02:00
|
|
|
{
|
2014-07-09 23:16:57 +02:00
|
|
|
(void) name_ext; /* Parameter is not used. */
|
2008-09-30 03:06:47 +02:00
|
|
|
return MAX_STRING_RESULT; /* 128 characters max! */
|
2008-06-03 04:23:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Register the function with Verilog.
|
|
|
|
|
*/
|
|
|
|
|
void vams_simparam_register(void)
|
|
|
|
|
{
|
|
|
|
|
s_vpi_systf_data tf_data;
|
2010-04-12 08:39:08 +02:00
|
|
|
vpiHandle res;
|
2008-06-03 04:23:48 +02:00
|
|
|
|
|
|
|
|
tf_data.type = vpiSysFunc;
|
|
|
|
|
tf_data.sysfunctype = vpiRealFunc;
|
|
|
|
|
tf_data.calltf = simparam_calltf;
|
|
|
|
|
tf_data.compiletf = simparam_compiletf;
|
|
|
|
|
tf_data.sizetf = 0;
|
|
|
|
|
tf_data.tfname = "$simparam";
|
|
|
|
|
tf_data.user_data = "";
|
2010-04-12 08:39:08 +02:00
|
|
|
res = vpi_register_systf(&tf_data);
|
|
|
|
|
vpip_make_systf_system_defined(res);
|
2008-06-03 04:23:48 +02:00
|
|
|
|
|
|
|
|
tf_data.type = vpiSysFunc;
|
|
|
|
|
tf_data.sysfunctype = vpiSizedFunc; /* What should this be? */
|
|
|
|
|
tf_data.calltf = simparam_str_calltf;
|
|
|
|
|
tf_data.compiletf = simparam_compiletf;
|
|
|
|
|
tf_data.sizetf = simparam_str_sizetf; /* Only 128 characters! */
|
|
|
|
|
tf_data.tfname = "$simparam$str";
|
|
|
|
|
tf_data.user_data = "$str";
|
2010-04-12 08:39:08 +02:00
|
|
|
res = vpi_register_systf(&tf_data);
|
|
|
|
|
vpip_make_systf_system_defined(res);
|
2008-06-03 04:23:48 +02:00
|
|
|
}
|