diff --git a/vhdlpp/scope.cc b/vhdlpp/scope.cc index 5182aee1a..eac3ece1e 100644 --- a/vhdlpp/scope.cc +++ b/vhdlpp/scope.cc @@ -21,6 +21,7 @@ # include "scope.h" # include "package.h" # include "subprogram.h" +# include "entity.h" # include # include # include @@ -148,6 +149,23 @@ Variable* ScopeBase::find_variable(perm_string by_name) const } } +const InterfacePort* ScopeBase::find_param(perm_string by_name) const +{ + for(map::const_iterator it = use_subprograms_.begin(); + it != use_subprograms_.end(); ++it) { + if(const InterfacePort*port = it->second->find_param(by_name)) + return port; + } + + for(map::const_iterator it = cur_subprograms_.begin(); + it != cur_subprograms_.end(); ++it) { + if(const InterfacePort*port = it->second->find_param(by_name)) + return port; + } + + return NULL; +} + Subprogram* ScopeBase::find_subprogram(perm_string name) const { map::const_iterator cur; diff --git a/vhdlpp/scope.h b/vhdlpp/scope.h index 2b0fdc5b3..8fd94b73e 100644 --- a/vhdlpp/scope.h +++ b/vhdlpp/scope.h @@ -56,6 +56,7 @@ class ScopeBase { bool find_constant(perm_string by_name, const VType*&typ, Expression*&exp); Signal* find_signal(perm_string by_name) const; Variable* find_variable(perm_string by_name) const; + virtual const InterfacePort* find_param(perm_string by_name) const; Subprogram* find_subprogram(perm_string by_name) const; // Moves all signals, variables and components from another scope to // this one. After the transfer new_* maps are emptied in the another scope.