diff --git a/tgt-vhdl/expr.cc b/tgt-vhdl/expr.cc index 5c2fa6233..e861b4a7f 100644 --- a/tgt-vhdl/expr.cc +++ b/tgt-vhdl/expr.cc @@ -46,7 +46,7 @@ static vhdl_var_ref *translate_signal(ivl_expr_t e) const char *renamed = get_renamed_signal(sig).c_str(); - const vhdl_decl *decl = ent->get_arch()->get_decl(strip_var(renamed)); + const vhdl_decl *decl = ent->get_arch()->get_scope()->get_decl(strip_var(renamed)); assert(decl); vhdl_type *type = new vhdl_type(*decl->get_type()); diff --git a/tgt-vhdl/scope.cc b/tgt-vhdl/scope.cc index 23dd95490..2856801ff 100644 --- a/tgt-vhdl/scope.cc +++ b/tgt-vhdl/scope.cc @@ -163,7 +163,7 @@ static void declare_signals(vhdl_entity *ent, ivl_scope_t scope) ivl_signal_port_t mode = ivl_signal_port(sig); switch (mode) { case IVL_SIP_NONE: - ent->get_arch()->add_decl(new vhdl_signal_decl(name.c_str(), sig_type)); + ent->get_arch()->get_scope()->add_decl(new vhdl_signal_decl(name.c_str(), sig_type)); break; case IVL_SIP_INPUT: ent->get_scope()->add_decl @@ -184,7 +184,7 @@ static void declare_signals(vhdl_entity *ent, ivl_scope_t scope) rename_signal(sig, newname.c_str()); vhdl_type *reg_type = new vhdl_type(*sig_type); - ent->get_arch()->add_decl(new vhdl_signal_decl(newname.c_str(), reg_type)); + ent->get_arch()->get_scope()->add_decl(new vhdl_signal_decl(newname.c_str(), reg_type)); // Create a concurrent assignment statement to // connect the register to the output @@ -276,7 +276,7 @@ static void map_signal(ivl_signal_t to, vhdl_entity *parent, // Don't map a signal to itself! continue; } - else if ((decl = parent->get_arch()->get_decl(basename))) { + else if ((decl = parent->get_arch()->get_scope()->get_decl(basename))) { // It's a signal declared in the parent // Pick this one (any one will do as they're all // connected together if there's more than one) @@ -345,9 +345,9 @@ static int draw_module(ivl_scope_t scope, ivl_scope_t parent) assert(parent_arch != NULL); // Create a forward declaration for it - if (!parent_arch->have_declared(ent->get_name())) { + if (!parent_arch->get_scope()->have_declared(ent->get_name())) { vhdl_decl *comp_decl = vhdl_component_decl::component_decl_for(ent); - parent_arch->add_decl(comp_decl); + parent_arch->get_scope()->add_decl(comp_decl); } // And an instantiation statement diff --git a/tgt-vhdl/vhdl_syntax.cc b/tgt-vhdl/vhdl_syntax.cc index 770e8db7d..b8b9ca465 100644 --- a/tgt-vhdl/vhdl_syntax.cc +++ b/tgt-vhdl/vhdl_syntax.cc @@ -128,11 +128,6 @@ void vhdl_arch::add_stmt(vhdl_conc_stmt *stmt) stmts_.push_back(stmt); } -void vhdl_arch::add_decl(vhdl_decl *decl) -{ - scope_.add_decl(decl); -} - void vhdl_arch::emit(std::ofstream &of, int level) const { emit_comment(of, level); @@ -145,21 +140,6 @@ void vhdl_arch::emit(std::ofstream &of, int level) const blank_line(of, level); // Extra blank line after architectures; } -vhdl_decl *vhdl_arch::get_decl(const std::string &name) const -{ - return scope_.get_decl(name); -} - -/* - * True if any declaration of `name' has been added to the - * architecture. - */ -bool vhdl_arch::have_declared(const std::string &name) const -{ - return scope_.have_declared(name); -} - - vhdl_process::vhdl_process(const char *name) : name_(name), initial_(false) { diff --git a/tgt-vhdl/vhdl_syntax.hh b/tgt-vhdl/vhdl_syntax.hh index 72d9ce2d2..5d03eca9d 100644 --- a/tgt-vhdl/vhdl_syntax.hh +++ b/tgt-vhdl/vhdl_syntax.hh @@ -565,9 +565,6 @@ public: virtual ~vhdl_arch(); void emit(std::ofstream &of, int level=0) const; - bool have_declared(const std::string &name) const; - vhdl_decl *get_decl(const std::string &name) const; - void add_decl(vhdl_decl *decl); void add_stmt(vhdl_process *proc); void add_stmt(vhdl_conc_stmt *stmt); vhdl_scope *get_scope() { return &scope_; }