2 * Copyright (c) 2003 Stephen Williams (steve@icarus.com)
4 * This source code is free software; you can redistribute it
5 * and/or modify it in source code form under the terms of the GNU
6 * General Public License as published by the Free Software
7 * Foundation; either version 2 of the License, or (at your option)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 #ident "$Id: symbol_search.cc,v 1.7 2007/06/02 03:42:13 steve Exp $"
29 * Search for the hierarchical name.
31 NetScope
*symbol_search(Design
*des
, NetScope
*scope
, pform_name_t path
,
35 const NetExpr
*&ex1
, const NetExpr
*&ex2
)
39 /* Get the tail name of the object we are looking for. */
40 perm_string key
= peek_tail_name(path
);
43 /* Initialize output argument to cleared. */
48 /* If the path has a scope part, then search for the specified
49 scope that we are supposed to search. */
51 list
<hname_t
> path_list
= eval_scope_path(des
, scope
, path
);
52 assert(path_list
.size() == path
.size());
53 scope
= des
->find_scope(scope
, path_list
);
57 if ( (net
= scope
->find_signal(key
)) )
60 if ( (eve
= scope
->find_event(key
)) )
63 if ( (par
= scope
->get_parameter(key
, ex1
, ex2
)) )
66 if (scope
->type() == NetScope::MODULE
)
69 scope
= scope
->parent();
77 * $Log: symbol_search.cc,v $
78 * Revision 1.7 2007/06/02 03:42:13 steve
79 * Properly evaluate scope path expressions.
81 * Revision 1.6 2007/05/24 04:07:12 steve
82 * Rework the heirarchical identifier parse syntax and pform
83 * to handle more general combinations of heirarch and bit selects.
85 * Revision 1.5 2007/04/26 03:06:22 steve
86 * Rework hname_t to use perm_strings.
88 * Revision 1.4 2007/01/16 05:44:15 steve
89 * Major rework of array handling. Memories are replaced with the
90 * more general concept of arrays. The NetMemory and NetEMemory
91 * classes are removed from the ivl core program, and the IVL_LPM_RAM
92 * lpm type is removed from the ivl_target API.
94 * Revision 1.3 2005/11/27 05:56:20 steve
95 * Handle bit select of parameter with ranges.
97 * Revision 1.2 2005/07/11 16:56:51 steve
98 * Remove NetVariable and ivl_variable_t structures.
100 * Revision 1.1 2003/09/19 03:30:05 steve
101 * Fix name search in elab_lval.