VHDL: fix spurious resize seen in pr2911213

Another case when ivl_scope_sig list was used instead of
ivl_scope_param.
This commit is contained in:
Nick Gasson 2009-12-16 22:12:50 +00:00 committed by Stephen Williams
parent 5fad844c30
commit 47d3b3365b
1 changed files with 2 additions and 5 deletions

View File

@ -533,7 +533,6 @@ static vhdl_expr *translate_ufunc(ivl_expr_t e)
vhdl_fcall *fcall = new vhdl_fcall(funcname, rettype);
int nparams = ivl_expr_parms(e);
int func_scope_sig = 0;
for (int i = 0; i < nparams; i++) {
vhdl_expr *param = translate_expr(ivl_expr_parm(e, i));
if (NULL == param) {
@ -542,10 +541,8 @@ static vhdl_expr *translate_ufunc(ivl_expr_t e)
}
// Ensure the parameter has the correct VHDL type
ivl_signal_t param_sig;
do {
param_sig = ivl_scope_sig(defscope, func_scope_sig++);
} while (ivl_signal_port(param_sig) != IVL_SIP_INPUT);
// Parameter number is i + 1 since 0th parameter is return value
ivl_signal_t param_sig = ivl_scope_port(defscope, i + 1);
vhdl_type *param_type =
vhdl_type::type_for(ivl_signal_width(param_sig),
ivl_signal_signed(param_sig) != 0);