Remove the unused parameter warnings in tgt-vlog

This commit is contained in:
Cary R 2014-07-09 09:33:06 -07:00
parent e221a8ced9
commit 8f7277a5ab
5 changed files with 21 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2013 Cary R. (cygcary@yahoo.com)
* Copyright (C) 2011-2014 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
@ -293,6 +293,7 @@ static unsigned emit_power_as_shift(ivl_scope_t scope, ivl_expr_t expr,
unsigned expr_wid;
ivl_expr_t lval = ivl_expr_oper1(expr);
ivl_expr_t rval = ivl_expr_oper2(expr);
(void)wid; /* wid is not used. */
/* The L-value must be a number. */
if (ivl_expr_type(lval) != IVL_EX_NUMBER) return 0;
/* The L-value must of the form 2^n. */
@ -357,6 +358,7 @@ static unsigned emit_power_as_shift(ivl_scope_t scope, ivl_expr_t expr,
static void emit_expr_array(ivl_scope_t scope, ivl_expr_t expr, unsigned wid)
{
ivl_signal_t sig = ivl_expr_signal(expr);
(void)wid; /* wid is not used. */
emit_scope_call_path(scope, ivl_signal_scope(sig));
emit_id(ivl_signal_basename(sig));
}
@ -559,6 +561,7 @@ static void emit_expr_concat(ivl_scope_t scope, ivl_expr_t expr, unsigned wid)
unsigned repeat = ivl_expr_repeat(expr);
unsigned idx, count = ivl_expr_parms(expr);
(void)wid; /* wid is not used. */
if (repeat != 1) fprintf(vlog_out, "{%u", repeat);
fprintf(vlog_out, "{");
count -= 1;
@ -573,6 +576,7 @@ static void emit_expr_concat(ivl_scope_t scope, ivl_expr_t expr, unsigned wid)
static void emit_expr_delay(ivl_scope_t scope, ivl_expr_t expr, unsigned wid)
{
(void)wid; /* wid is not used. */
emit_scaled_delay(scope, ivl_expr_delay_val(expr));
}
@ -583,6 +587,7 @@ static void emit_expr_event(ivl_scope_t scope, ivl_expr_t expr, unsigned wid)
{
ivl_event_t event = ivl_expr_event(expr);
ivl_scope_t ev_scope = ivl_event_scope(event);
(void)wid; /* wid is not used. */
assert(! ivl_event_nany(event));
assert(! ivl_event_npos(event));
assert(! ivl_event_nneg(event));
@ -598,6 +603,7 @@ static void emit_expr_event(ivl_scope_t scope, ivl_expr_t expr, unsigned wid)
static void emit_expr_number(ivl_scope_t scope, ivl_expr_t expr, unsigned wid)
{
ivl_parameter_t param = ivl_expr_parameter(expr);
(void)wid; /* wid is not used. */
if (param && (param != emitting_param)) {
emit_scope_call_path(scope, ivl_parameter_scope(param));
emit_id(ivl_parameter_basename(param));
@ -612,6 +618,7 @@ static void emit_expr_real_number(ivl_scope_t scope, ivl_expr_t expr,
unsigned wid)
{
ivl_parameter_t param = ivl_expr_parameter(expr);
(void)wid; /* wid is not used. */
if (param && (param != emitting_param)) {
emit_scope_call_path(scope, ivl_parameter_scope(param));
emit_id(ivl_parameter_basename(param));
@ -626,6 +633,7 @@ static void emit_expr_real_number(ivl_scope_t scope, ivl_expr_t expr,
void emit_class_property(ivl_scope_t scope, ivl_expr_t expr, unsigned wid)
{
ivl_signal_t sig = ivl_expr_signal(expr);
(void)wid; /* wid is not used. */
emit_scope_call_path(scope, ivl_signal_scope(sig));
emit_id(ivl_signal_basename(sig));
fprintf(vlog_out, ".%s", ivl_expr_name(expr));
@ -644,6 +652,8 @@ static void emit_expr_scope_piece(ivl_scope_t scope)
static void emit_expr_scope(ivl_scope_t scope, ivl_expr_t expr, unsigned wid)
{
(void)scope; /* scope is not used. */
(void)wid; /* wid is not used. */
emit_expr_scope_piece(ivl_expr_scope(expr));
}
@ -844,6 +854,7 @@ static void emit_expr_select(ivl_scope_t scope, ivl_expr_t expr, unsigned wid)
ivl_expr_t sel_expr = ivl_expr_oper2(expr);
ivl_expr_t sig_expr = ivl_expr_oper1(expr);
ivl_select_type_t sel_type = ivl_expr_sel_type(expr);
(void)wid; /* wid is not used. */
/* If this is a dynamic array select, translate it differently. */
if ((ivl_expr_type(sig_expr) == IVL_EX_SIGNAL) &&
(ivl_signal_data_type(ivl_expr_signal(sig_expr)) == IVL_VT_DARRAY)) {
@ -923,6 +934,7 @@ static void emit_expr_select(ivl_scope_t scope, ivl_expr_t expr, unsigned wid)
static void emit_expr_func(ivl_scope_t scope, ivl_expr_t expr, unsigned wid)
{
unsigned count = ivl_expr_parms(expr);
(void)wid; /* wid is not used. */
if (count) {
unsigned idx;
fprintf(vlog_out, "(");
@ -945,6 +957,7 @@ static void emit_expr_func(ivl_scope_t scope, ivl_expr_t expr, unsigned wid)
static void emit_expr_signal(ivl_scope_t scope, ivl_expr_t expr, unsigned wid)
{
ivl_signal_t sig = ivl_expr_signal(expr);
(void)wid; /* wid is not used. */
emit_scope_call_path(scope, ivl_signal_scope(sig));
emit_id(ivl_signal_basename(sig));
if (ivl_signal_dimensions(sig)) {

View File

@ -738,6 +738,7 @@ static ivl_signal_t find_output_signal(ivl_scope_t scope, ivl_nexus_t nex,
unsigned*array_word)
{
unsigned idx, count = ivl_nexus_ptrs(nex);
(void)array_word; /* array_word is not used. */
for (idx = 0; idx < count; idx += 1) {
ivl_nexus_ptr_t nex_ptr = ivl_nexus_ptr(nex, idx);
ivl_signal_t t_sig = ivl_nexus_ptr_sig(nex_ptr);

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2013 Cary R. (cygcary@yahoo.com)
* Copyright (C) 2011-2014 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
@ -369,6 +369,7 @@ void emit_scaled_range(ivl_scope_t scope, ivl_expr_t expr, unsigned width,
int rtype;
int64_t value = get_in_range_int64_from_number(expr, &rtype,
"range value");
(void)scope; /* scope is not used. */
if (rtype < 0) fprintf(vlog_out, "[1'bx:1'bx]");
if (rtype) return;
@ -689,6 +690,7 @@ static unsigned is_local_input(ivl_scope_t scope, ivl_nexus_t nex)
ivl_signal_t sig = 0;
unsigned idx, count = ivl_nexus_ptrs(nex);
(void)scope; /* scope is not used. */
for (idx = 0; idx < count; idx += 1) {
ivl_nexus_ptr_t nex_ptr = ivl_nexus_ptr(nex, idx);
ivl_signal_t t_sig = ivl_nexus_ptr_sig(nex_ptr);

View File

@ -725,6 +725,7 @@ static int find_tf_process(ivl_process_t proc, ivl_scope_t scope)
static int emit_tf_process(ivl_scope_t scope, ivl_scope_t parent)
{
ivl_scope_type_t sc_type = ivl_scope_type(scope);
(void)parent; /* parent is not used. */
if ((sc_type == IVL_SCT_FUNCTION) || (sc_type == IVL_SCT_TASK)) {
/* Output the initial/always blocks for this module. */
ivl_design_process(design, (ivl_process_f)find_tf_process, scope);

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2013 Cary R. (cygcary@yahoo.com)
* Copyright (C) 2011-2014 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
@ -1429,6 +1429,7 @@ static void emit_stmt_utask(ivl_scope_t scope, ivl_statement_t stmt)
/* Look to see if this is a SystemVerilog wait fork statement. */
static unsigned is_wait_fork(ivl_scope_t scope, ivl_statement_t stmt)
{
(void)scope; /* scope is not used. */
if (ivl_stmt_nevent(stmt) != 1) return 0;
if (ivl_stmt_events(stmt, 0) != 0) return 0;
assert(ivl_statement_type(ivl_stmt_sub_stmt(stmt)) == IVL_ST_NOOP);