From c9454b346ea043b78d18ab1e0d3725af1c684fd5 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Tue, 29 Jul 2008 19:04:41 +0100 Subject: [PATCH] Fix module3.12B --- tgt-vhdl/scope.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tgt-vhdl/scope.cc b/tgt-vhdl/scope.cc index d94232324..2bec7d411 100644 --- a/tgt-vhdl/scope.cc +++ b/tgt-vhdl/scope.cc @@ -211,6 +211,11 @@ void draw_nexus(ivl_nexus_t nexus) ivl_signal_t sig; if ((sig = ivl_nexus_ptr_sig(nexus_ptr))) { cout << "signal " << ivl_signal_basename(sig) << endl; + + if (!seen_signal_before(sig)) { + remember_signal(sig, NULL); + continue; + } vhdl_scope *scope = find_scope_for_signal(sig); @@ -601,6 +606,17 @@ static void map_signal(ivl_signal_t to, vhdl_entity *parent, { // TODO: Work for multiple words ivl_nexus_t nexus = ivl_signal_nex(to, 0); + seen_nexus(nexus); + + vhdl_scope *arch_scope = parent->get_arch()->get_scope(); + + nexus_private_t *priv = + static_cast(ivl_nexus_get_private(nexus)); + assert(priv); + if (!visible_nexus(priv, arch_scope)) { + // This nexus isn't attached to anything in the parent + return; + } vhdl_var_ref *ref = nexus_to_var_ref(parent->get_arch()->get_scope(), nexus);