From 10a5ca199dd2da8fedb2ac0fa51ced67c3802e12 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sun, 3 Aug 2008 14:38:08 +0100 Subject: [PATCH] Add file / line number comments to instantiations --- tgt-vhdl/scope.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tgt-vhdl/scope.cc b/tgt-vhdl/scope.cc index c5a381fa1..3cdaeb0eb 100644 --- a/tgt-vhdl/scope.cc +++ b/tgt-vhdl/scope.cc @@ -737,7 +737,12 @@ static int draw_hierarchy(ivl_scope_t scope, void *_parent) vhdl_comp_inst *inst = new vhdl_comp_inst(inst_name.c_str(), ent->get_name().c_str()); - port_map(scope, parent_ent, inst); + port_map(scope, parent_ent, inst); + + ostringstream ss; + ss << "Generated from instantiation at " + << ivl_scope_file(scope) << ":" << ivl_scope_lineno(scope); + inst->set_comment(ss.str().c_str()); parent_arch->add_stmt(inst); }