diff --git a/tgt-vhdl/process.cc b/tgt-vhdl/process.cc index 5276feed6..1c19e776c 100644 --- a/tgt-vhdl/process.cc +++ b/tgt-vhdl/process.cc @@ -71,6 +71,7 @@ static int generate_vhdl_process(vhdl_entity *ent, ivl_process_t proc) ss << ivl_scope_tname(scope); vhdl_proc->set_comment(ss.str()); + set_active_entity(NULL); return 0; } diff --git a/tgt-vhdl/scope.cc b/tgt-vhdl/scope.cc index 69861211b..6dbe66be9 100644 --- a/tgt-vhdl/scope.cc +++ b/tgt-vhdl/scope.cc @@ -768,8 +768,12 @@ static int draw_all_logic_and_lpm(ivl_scope_t scope, void *_parent) assert(ent); if (ent->get_derived_from() == ivl_scope_name(scope)) { - declare_logic(ent->get_arch(), scope); - declare_lpm(ent->get_arch(), scope); + set_active_entity(ent); + { + declare_logic(ent->get_arch(), scope); + declare_lpm(ent->get_arch(), scope); + } + set_active_entity(NULL); } }