Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

Commit

Permalink
Remove unused port warnings in the VPI C code.
Browse files Browse the repository at this point in the history
  • Loading branch information
caryr committed Jul 9, 2014
1 parent 5bbc733 commit 4ff08f8
Show file tree
Hide file tree
Showing 31 changed files with 116 additions and 7 deletions.
1 change: 1 addition & 0 deletions vpi/by_name.c
Expand Up @@ -70,6 +70,7 @@ static PLI_INT32 CompileTF(char *x)
static PLI_INT32 CompileTF(PLI_BYTE8 *x)
#endif
{
(void)x; /* Parameter is not used. */
FindHandleByName();
return 0;
}
Expand Down
3 changes: 3 additions & 0 deletions vpi/celldefine.c
Expand Up @@ -5,6 +5,9 @@ static PLI_INT32 calltf(PLI_BYTE8 *data)
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
vpiHandle mod = vpi_scan(argv);

(void)data; /* Parameter is not used. */

vpi_free_object(argv);

vpi_printf("Module instance %s is%s a cell.\n",
Expand Down
2 changes: 2 additions & 0 deletions vpi/event1.c
Expand Up @@ -37,6 +37,8 @@ static PLI_INT32 CompileTF(PLI_BYTE8 *x)
vpiHandle arg;
int first = 1;

(void)x; /* Parameter is not used. */

vpi_printf("%s (", vpi_get_str(vpiName, sys));
while ((arg = vpi_scan(argv))) {
if (!first)
Expand Down
4 changes: 4 additions & 0 deletions vpi/event2.c
Expand Up @@ -32,6 +32,8 @@ Callback(s_cb_data *data)
s_vpi_time t;
static int count = 0;

(void)data; /* Parameter is not used. */

t.type = vpiScaledRealTime;
vpi_get_time(0, &t);

Expand All @@ -54,6 +56,8 @@ CallbackRegister(s_cb_data *data)
s_cb_data cb_data;
s_vpi_time timerec = { vpiSimTime, 0, 0, 0 };

(void)data; /* Parameter is not used. */

hand = vpi_handle_by_name("test.e", 0);
assert(hand);

Expand Down
2 changes: 2 additions & 0 deletions vpi/final.c
Expand Up @@ -3,6 +3,8 @@

static PLI_INT32 end_of_sim_cb(struct t_cb_data *x)
{
(void)x; /* Parameter is not used. */

vpi_printf("In VPI cbEndOfSimulation callback.\n");
return 0;
}
Expand Down
10 changes: 9 additions & 1 deletion vpi/getp.c
Expand Up @@ -6,6 +6,9 @@ calltf(int ud, int reason)
int i;
PLI_BYTE8 *inst = tf_getinstance();

(void)ud; /* Parameter is not used. */
(void)reason; /* Parameter is not used. */

for (i = 1; i < 5; i++) {
io_printf("tf_getp(%d)\t\t-> %d\n", i, (int)tf_getp(i));
io_printf("tf_igetp(%d,inst)\t-> %d\n", i, (int)tf_igetp(i,inst));
Expand All @@ -17,7 +20,12 @@ calltf(int ud, int reason)
return 0;
}

static int sizetf(int ud, int reason) { return 32; }
static int sizetf(int ud, int reason)
{
(void)ud; /* Parameter is not used. */
(void)reason; /* Parameter is not used. */
return 32;
}

s_tfcell veriusertfs[2] = {
{usertask, 0, 0, sizetf, calltf, 0, "$mytest", 1, 0, 0, {0} },
Expand Down
2 changes: 2 additions & 0 deletions vpi/hello_poke.c
Expand Up @@ -29,6 +29,8 @@ static PLI_INT32 my_hello_calltf(PLI_BYTE8 *xx)
{
s_vpi_value value;

(void)xx; /* Parameter is not used. */

vpiHandle sys = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, sys);
vpiHandle arg;
Expand Down
1 change: 1 addition & 0 deletions vpi/hello_tf.c
Expand Up @@ -26,6 +26,7 @@ static PLI_INT32 my_hello_calltf(char *xx)
static PLI_INT32 my_hello_calltf(PLI_BYTE8 *xx)
#endif
{
(void)xx; /* Parameter is not used. */
io_printf("Hello World, from VPI.\n");
return 0;
}
Expand Down
1 change: 1 addition & 0 deletions vpi/hello_vpi.c
Expand Up @@ -36,6 +36,7 @@ static PLI_INT32 my_hello_calltf(char *xx)
static PLI_INT32 my_hello_calltf(PLI_BYTE8 *xx)
#endif
{
(void)xx; /* Parameter is not used. */
vpi_printf("Hello World, from VPI.\n");
return 0;
}
Expand Down
3 changes: 3 additions & 0 deletions vpi/listparams.c
Expand Up @@ -9,6 +9,7 @@ static PLI_INT32 listparams_compiletf(char*name)
static PLI_INT32 listparams_compiletf(PLI_BYTE8*name)
#endif
{
(void)name; /* Parameter is not used. */
return 0;
}

Expand Down Expand Up @@ -56,6 +57,8 @@ static PLI_INT32 listparams_calltf(PLI_BYTE8*name)
vpiHandle argv = vpi_iterate(vpiArgument, sys);
vpiHandle item;

(void)name; /* Parameter is not used. */

while ( (item = vpi_scan(argv)) ) {
s_vpi_value value;
value.format = vpiStringVal;
Expand Down
2 changes: 2 additions & 0 deletions vpi/memmon.c
Expand Up @@ -51,6 +51,8 @@ static PLI_INT32 memmonitor_calltf(PLI_BYTE8*name)
vpiHandle argv = vpi_iterate(vpiArgument, sys);
vpiHandle arg;

(void)name; /* Parameter is not used. */

while ( (arg = vpi_scan(argv)) ) {
s_cb_data cb_data;

Expand Down
10 changes: 9 additions & 1 deletion vpi/mipname.c
Expand Up @@ -5,13 +5,21 @@ calltf(int ud, int reason)
{
char *inst = tf_getinstance();

(void)ud; /* Parameter is not used. */
(void)reason; /* Parameter is not used. */

io_printf("tf_mipname()\t\t-> %s\n", tf_mipname());
io_printf("tf_imipname(inst)\t-> %s\n", tf_imipname(inst));

return 0;
}

static int sizetf(int ud, int reason) { return 32; }
static int sizetf(int ud, int reason)
{
(void)ud; /* Parameter is not used. */
(void)reason; /* Parameter is not used. */
return 32;
}

s_tfcell veriusertfs[2] = {
{usertask, 0, 0, sizetf, calltf, 0, "$mytest", 1, 0, 0, {0} },
Expand Down
7 changes: 6 additions & 1 deletion vpi/nulls1.c
Expand Up @@ -26,7 +26,10 @@ PLI_INT32
ValueChange(p_cb_data cb_data)
{
static s_vpi_time get_time = { vpiSimTime, 0, 0, 0 };
vpi_get_time(NULL,&get_time);

(void)cb_data; /* Parameter is not used. */

vpi_get_time(NULL,&get_time);
vpi_printf("%6d: Value Change\n", (int)get_time.low);
return(0);
}
Expand All @@ -41,6 +44,8 @@ PLI_INT32 CompileTF(PLI_BYTE8 *user_data)
vpiHandle call_h=vpi_handle(vpiSysTfCall,NULL);
vpiHandle arg_i,arg_h;

(void)user_data; /* Parameter is not used. */

// Get First Argument and Setup Value Change Callback
arg_i=vpi_iterate(vpiArgument,call_h);
arg_h=vpi_scan(arg_i);
Expand Down
2 changes: 2 additions & 0 deletions vpi/ports_params.c
Expand Up @@ -97,6 +97,8 @@ static void checkPorts()

static PLI_INT32 checkPortsParams(struct t_cb_data*cb)
{
(void)cb; /* Parameter is not used. */

checkParams();
checkPorts();
return 0;
Expand Down
6 changes: 6 additions & 0 deletions vpi/pr1693971.c
Expand Up @@ -74,6 +74,7 @@ static PLI_INT32 PLIbook_PowSizetf(char *user_data)
static PLI_INT32 PLIbook_PowSizetf(PLI_BYTE8 *user_data)
#endif
{
(void)user_data; /* Parameter is not used. */
//vpi_printf("\n$my_pow PLI sizetf function.\n\n");
return(32); /* $my_pow returns 32-bit values */
}
Expand All @@ -91,6 +92,8 @@ static PLI_INT32 PLIbook_PowCompiletf(PLI_BYTE8 *user_data)
PLI_INT32 tfarg_type;
int err_flag = 0;

(void)user_data; /* Parameter is not used. */

vpi_printf("\n$my_pow PLI compiletf function.\n\n");

do { /* group all tests, so can break out of group on error */
Expand Down Expand Up @@ -153,6 +156,8 @@ static PLI_INT32 PLIbook_PowCalltf(PLI_BYTE8 *user_data)
PLI_INT32 base, expo;
double result;

(void)user_data; /* Parameter is not used. */

//vpi_printf("\n$my_pow PLI calltf function.\n\n");

systf_handle = vpi_handle(vpiSysTfCall, NULL);
Expand Down Expand Up @@ -188,6 +193,7 @@ static PLI_INT32 PLIbook_PowCalltf(PLI_BYTE8 *user_data)
*********************************************************************/
static PLI_INT32 PLIbook_PowStartOfSim(s_cb_data *callback_data)
{
(void)callback_data; /* Parameter is not used. */
vpi_printf("\n$my_pow StartOfSim callback.\n\n");
return(0);
}
Expand Down
6 changes: 6 additions & 0 deletions vpi/pr2048463.c
Expand Up @@ -39,6 +39,8 @@ static PLI_INT32 sys_end_of_simulation(p_cb_data cb_data)
{
unsigned idx;

(void)cb_data; /* Parameter is not used. */

for (idx = 0; idx < name_count; idx += 1) {
free(name_list[idx]);
}
Expand Down Expand Up @@ -101,6 +103,8 @@ PLI_INT32 PLIbook_MyMonitor_compiletf(PLI_BYTE8 *user_data)
vpiHandle systf_handle, arg_iterator, arg_handle;
PLI_INT32 tfarg_type;

(void)user_data; /* Parameter is not used. */

/* obtain a handle to the system task instance */
systf_handle = vpi_handle(vpiSysTfCall, NULL);

Expand Down Expand Up @@ -144,6 +148,8 @@ PLI_INT32 PLIbook_MyMonitor_calltf(PLI_BYTE8 *user_data)
s_cb_data cb_data_s;
PLI_BYTE8 *net_name_temp, *net_name_keep;

(void)user_data; /* Parameter is not used. */

/* setup value change callback options */
time_s.type = vpiScaledRealTime;
value_s.format = vpiBinStrVal;
Expand Down
4 changes: 3 additions & 1 deletion vpi/pr2314742.c
Expand Up @@ -29,7 +29,7 @@ static PLI_INT32 xxx_compiletf(char *user_data)
static PLI_INT32 xxx_compiletf(PLI_BYTE8 *user_data)
#endif
{
/* empty */
(void)user_data; /* Parameter is not used. */
return 0;
}

Expand All @@ -48,6 +48,8 @@ static PLI_INT32 xxx_calltf(PLI_BYTE8 *user_data)
int i;
vpiHandle argi[100];

(void)user_data; /* Parameter is not used. */

/* Get handle to this instance, look up our workarea */
systf_h = vpi_handle(vpiSysTfCall, NULL);
chkvpierr();
Expand Down
2 changes: 2 additions & 0 deletions vpi/pr2966059.c
Expand Up @@ -13,6 +13,8 @@ static PLI_INT32 number_compiletf(PLI_BYTE8 *x)

s_vpi_value var;

(void)x; /* Parameter is not used. */

if (argv == 0) {
vpi_printf("ERROR: missing required numeric argument.\n"),
vpi_control(vpiFinish, 1);
Expand Down
7 changes: 7 additions & 0 deletions vpi/pr521.c
Expand Up @@ -6,13 +6,20 @@ char *veriuser_version_str = "Test PLI v0.1 ";
static int pli_test(int ud, int reason)
{
int a;

(void)ud; /* Parameter is not used. */
(void)reason; /* Parameter is not used. */

a = tf_getp(1);
printf ("PLI Parameter received 0x%x\n",a);
return 0;
}

static int return_32(int ud, int reason)
{
(void)ud; /* Parameter is not used. */
(void)reason; /* Parameter is not used. */

return (32);
}

Expand Down
3 changes: 3 additions & 0 deletions vpi/pr686.c
Expand Up @@ -44,6 +44,7 @@ static PLI_INT32 test_next_compiletf(char *name)
static PLI_INT32 test_next_compiletf(PLI_BYTE8 *name)
#endif
{
(void)name; /* Parameter is not used. */
return 0;
}

Expand All @@ -55,6 +56,8 @@ static PLI_INT32 test_next_calltf(PLI_BYTE8 *name)
{
vpiHandle sys, argv, value;

(void)name; /* Parameter is not used. */

sys = vpi_handle(vpiSysTfCall, 0);
assert(sys);

Expand Down
2 changes: 2 additions & 0 deletions vpi/pr723.c
Expand Up @@ -9,6 +9,8 @@ static PLI_INT32 calltf(PLI_BYTE8 *data)
{
int i;

(void)data; /* Parameter is not used. */

for (i = 0; i < 31; i++) {
if (vpi_mcd_name(1U<<i))
vpi_printf("MCD %02d: %s\n", i+1, vpi_mcd_name(1U<<i));
Expand Down
10 changes: 9 additions & 1 deletion vpi/putp.c
Expand Up @@ -5,6 +5,9 @@ calltf(int ud, int reason)
{
char *inst = tf_getinstance();

(void)ud; /* Parameter is not used. */
(void)reason; /* Parameter is not used. */

tf_putp (0, 69);
tf_putp (1, 11);
tf_iputp(2, 22, inst);
Expand All @@ -17,7 +20,12 @@ calltf(int ud, int reason)
return 0;
}

static int sizetf(int ud, int reason) { return 32; }
static int sizetf(int ud, int reason)
{
(void)ud; /* Parameter is not used. */
(void)reason; /* Parameter is not used. */
return 32;
}

s_tfcell veriusertfs[2] = {
{userfunction, 0, 0, sizetf, calltf, 0, "$mytest", 1, 0, 0, {0} },
Expand Down
9 changes: 8 additions & 1 deletion vpi/putp2.c
Expand Up @@ -31,13 +31,20 @@
static int calltf(int user_data, int reason)
{
// char *inst = tf_getinstance();
(void)user_data; /* Parameter is not used. */
(void)reason; /* Parameter is not used. */

tf_putp (0, tf_getp(1));

return 0;
}

static int sizetf(int user_data, int reason) { return 32; }
static int sizetf(int user_data, int reason)
{
(void)user_data; /* Parameter is not used. */
(void)reason; /* Parameter is not used. */
return 32;
}

s_tfcell veriusertfs[2] = {
{userfunction,
Expand Down
2 changes: 2 additions & 0 deletions vpi/putvalue.c
Expand Up @@ -32,6 +32,8 @@ EndOfCompile(s_cb_data *data)
s_vpi_value val;
int i;

(void)data; /* Parameter is not used. */

hand = vpi_handle_by_name("test.r", 0);
assert(hand);

Expand Down
2 changes: 2 additions & 0 deletions vpi/realcb.c
Expand Up @@ -48,6 +48,8 @@ static PLI_INT32 my_watchreal_calltf(PLI_BYTE8 *xx)
struct t_cb_data cb;
struct t_vpi_time timerec;

(void)xx; /* Parameter is not used. */

vpiHandle sys = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, sys);

Expand Down
2 changes: 2 additions & 0 deletions vpi/realtime.c
Expand Up @@ -34,6 +34,8 @@ static PLI_INT32 calltf(PLI_BYTE8 *data)
{
vpiHandle hand, iter;

(void)data; /* Parameter is not used. */

hand = vpi_handle(vpiSysTfCall, 0);
iter = vpi_iterate(vpiArgument, hand);
hand = vpi_scan(iter);
Expand Down
2 changes: 2 additions & 0 deletions vpi/realtime2.c
Expand Up @@ -34,6 +34,8 @@ static PLI_INT32 calltf(PLI_BYTE8 *data)
{
vpiHandle hand, iter;

(void)data; /* Parameter is not used. */

hand = vpi_handle(vpiSysTfCall, 0);
iter = vpi_iterate(vpiArgument, hand);
hand = vpi_scan(iter);
Expand Down

0 comments on commit 4ff08f8

Please sign in to comment.