Allow named events to be referenced by

hierarchical names.
This commit is contained in:
steve 2002-11-02 03:27:51 +00:00
parent f243f694b4
commit 86032c0aa5
5 changed files with 40 additions and 11 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: HName.cc,v 1.4 2002/08/12 01:34:58 steve Exp $"
#ident "$Id: HName.cc,v 1.5 2002/11/02 03:27:52 steve Exp $"
#endif
# include "config.h"
@ -75,6 +75,11 @@ hname_t::~hname_t()
}
}
unsigned hname_t::component_count() const
{
return count_;
}
void hname_t::append(const char*text)
{
char**tmp;
@ -253,6 +258,10 @@ ostream& operator<< (ostream&out, const hname_t&that)
/*
* $Log: HName.cc,v $
* Revision 1.5 2002/11/02 03:27:52 steve
* Allow named events to be referenced by
* hierarchical names.
*
* Revision 1.4 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*

10
HName.h
View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: HName.h,v 1.3 2002/08/12 01:34:58 steve Exp $"
#ident "$Id: HName.h,v 1.4 2002/11/02 03:27:51 steve Exp $"
#endif
# include <iostream>
@ -61,6 +61,10 @@ class hname_t {
const char*peek_name(unsigned idx) const;
const char*peek_tail_name() const;
// Return the number of components in the hierarchical
// name. If this is a simple name, this will return 1.
unsigned component_count() const;
friend ostream& operator<< (ostream&, const hname_t&);
private:
@ -79,6 +83,10 @@ extern bool operator == (const hname_t&, const hname_t&);
/*
* $Log: HName.h,v $
* Revision 1.4 2002/11/02 03:27:51 steve
* Allow named events to be referenced by
* hierarchical names.
*
* Revision 1.3 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: net_design.cc,v 1.28 2002/10/19 22:59:49 steve Exp $"
#ident "$Id: net_design.cc,v 1.29 2002/11/02 03:27:52 steve Exp $"
#endif
# include "config.h"
@ -501,7 +501,7 @@ NetScope* Design::find_task(const hname_t&key)
return 0;
}
NetEvent* Design::find_event(NetScope*scope, hname_t path)
NetEvent* Design::find_event(NetScope*scope, const hname_t&path)
{
assert(scope);
@ -510,8 +510,12 @@ NetEvent* Design::find_event(NetScope*scope, hname_t path)
return ev;
}
if (scope->type() == NetScope::MODULE)
// If this is a simple name, then do not scan up scopes
// past a module scope. This is a Verilog scoping rule.
if ((path.component_count() == 1)
&& (scope->type() == NetScope::MODULE))
break;
scope = scope->parent();
}
@ -593,6 +597,10 @@ void Design::delete_process(NetProcTop*top)
/*
* $Log: net_design.cc,v $
* Revision 1.29 2002/11/02 03:27:52 steve
* Allow named events to be referenced by
* hierarchical names.
*
* Revision 1.28 2002/10/19 22:59:49 steve
* Redo the parameter vector support to allow
* parameter names in range expressions.

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: netlist.h,v 1.267 2002/10/23 01:47:17 steve Exp $"
#ident "$Id: netlist.h,v 1.268 2002/11/02 03:27:52 steve Exp $"
#endif
/*
@ -2995,7 +2995,7 @@ class Design {
NetScope* find_task(const hname_t&key);
// Events
NetEvent* find_event(NetScope*scope, const hname_t path);
NetEvent* find_event(NetScope*scope, const hname_t&path);
// NODES
void add_node(NetNode*);
@ -3083,6 +3083,10 @@ extern ostream& operator << (ostream&, NetNet::Type);
/*
* $Log: netlist.h,v $
* Revision 1.268 2002/11/02 03:27:52 steve
* Allow named events to be referenced by
* hierarchical names.
*
* Revision 1.267 2002/10/23 01:47:17 steve
* Fix synth2 handling of aset/aclr signals where
* flip-flops are split by begin-end blocks.

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: parse.y,v 1.162 2002/10/13 05:01:44 steve Exp $"
#ident "$Id: parse.y,v 1.163 2002/11/02 03:27:52 steve Exp $"
#endif
# include "config.h"
@ -551,11 +551,11 @@ dr_strength1
;
event_control
: '@' IDENTIFIER
{ PEIdent*tmpi = new PEIdent(hname_t($2));
: '@' identifier
{ PEIdent*tmpi = new PEIdent(*$2);
tmpi->set_file(@2.text);
tmpi->set_lineno(@2.first_line);
delete[]$2;
delete $2;
PEEvent*tmpe = new PEEvent(PEEvent::ANYEDGE, tmpi);
PEventStatement*tmps = new PEventStatement(tmpe);
tmps->set_file(@1.text);