Handle local variables in functions

This commit is contained in:
Nick Gasson 2008-06-27 12:21:27 +01:00
parent fd60bfd3d2
commit b24eb6ce88
1 changed files with 4 additions and 6 deletions

View File

@ -404,18 +404,16 @@ int draw_function(ivl_scope_t scope, ivl_scope_t parent)
std::string signame = make_safe_name(sig);
switch (ivl_signal_port(sig)) {
case IVL_SIP_INPUT:
func->add_param(new vhdl_param_decl(signame.c_str(), sigtype));
break;
case IVL_SIP_OUTPUT:
// The magic variable Verilog_Result holds the return value
signame = "Verilog_Result";
func->set_type(sigtype);
default:
func->get_scope()->add_decl
(new vhdl_var_decl(signame.c_str(), new vhdl_type(*sigtype)));
break;
case IVL_SIP_INPUT:
func->add_param(new vhdl_param_decl(signame.c_str(), sigtype));
break;
default:
assert(false);
}
remember_signal(sig, func->get_scope());