Change function return value from Verilog_Result to <funcname>_Result

This commit is contained in:
Nick Gasson 2008-08-21 19:44:12 +01:00
parent d3b7d7a13d
commit 535ef6be38
2 changed files with 4 additions and 3 deletions

View File

@ -505,8 +505,9 @@ static int draw_function(ivl_scope_t scope, ivl_scope_t parent)
func->add_param(new vhdl_param_decl(signame.c_str(), sigtype)); func->add_param(new vhdl_param_decl(signame.c_str(), sigtype));
break; break;
case IVL_SIP_OUTPUT: case IVL_SIP_OUTPUT:
// The magic variable Verilog_Result holds the return value // The magic variable <funcname>_Result holds the return value
signame = "Verilog_Result"; signame = funcname;
signame += "_Result";
func->set_type(new vhdl_type(*sigtype)); func->set_type(new vhdl_type(*sigtype));
default: default:
func->get_scope()->add_decl func->get_scope()->add_decl

View File

@ -871,7 +871,7 @@ void vhdl_function::emit(std::ostream &of, int level) const
emit_children<vhdl_decl>(of, variables_.get_decls(), level); emit_children<vhdl_decl>(of, variables_.get_decls(), level);
of << "begin"; of << "begin";
stmts_.emit(of, level); stmts_.emit(of, level);
of << " return Verilog_Result;"; of << " return " << name_ << "_Result;";
newline(of, level); newline(of, level);
of << "end function;"; of << "end function;";
} }