Handle local variables in functions
This commit is contained in:
parent
fd60bfd3d2
commit
b24eb6ce88
|
|
@ -404,18 +404,16 @@ int draw_function(ivl_scope_t scope, ivl_scope_t parent)
|
||||||
std::string signame = make_safe_name(sig);
|
std::string signame = make_safe_name(sig);
|
||||||
|
|
||||||
switch (ivl_signal_port(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:
|
case IVL_SIP_OUTPUT:
|
||||||
// The magic variable Verilog_Result holds the return value
|
// The magic variable Verilog_Result holds the return value
|
||||||
signame = "Verilog_Result";
|
signame = "Verilog_Result";
|
||||||
func->set_type(sigtype);
|
func->set_type(sigtype);
|
||||||
|
default:
|
||||||
func->get_scope()->add_decl
|
func->get_scope()->add_decl
|
||||||
(new vhdl_var_decl(signame.c_str(), new vhdl_type(*sigtype)));
|
(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());
|
remember_signal(sig, func->get_scope());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue