diff --git a/tgt-vhdl/scope.cc b/tgt-vhdl/scope.cc index 3cdaeb0eb..55ff84e73 100644 --- a/tgt-vhdl/scope.cc +++ b/tgt-vhdl/scope.cc @@ -543,6 +543,11 @@ static int draw_function(ivl_scope_t scope, ivl_scope_t parent) // another function that has already been added ent->get_arch()->get_scope()->add_forward_decl (new vhdl_forward_fdecl(func)); + + ostringstream ss; + ss << "Generated from function " << funcname << " at " + << ivl_scope_def_file(scope) << ":" << ivl_scope_def_lineno(scope); + func->set_comment(ss.str().c_str()); ent->get_arch()->get_scope()->add_decl(func); return 0; diff --git a/tgt-vhdl/vhdl_syntax.cc b/tgt-vhdl/vhdl_syntax.cc index dd9a365bb..d3b6ae306 100644 --- a/tgt-vhdl/vhdl_syntax.cc +++ b/tgt-vhdl/vhdl_syntax.cc @@ -823,6 +823,7 @@ vhdl_function::vhdl_function(const char *name, vhdl_type *ret_type) void vhdl_function::emit(std::ostream &of, int level) const { newline(of, level); + emit_comment(of, level); of << "function " << name_ << " ("; emit_children(of, scope_.get_decls(), level, ";"); of << ") ";