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 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include "config.h" # 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) void hname_t::append(const char*text)
{ {
char**tmp; char**tmp;
@ -253,6 +258,10 @@ ostream& operator<< (ostream&out, const hname_t&that)
/* /*
* $Log: HName.cc,v $ * $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 * Revision 1.4 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig. * 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 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include <iostream> # include <iostream>
@ -61,6 +61,10 @@ class hname_t {
const char*peek_name(unsigned idx) const; const char*peek_name(unsigned idx) const;
const char*peek_tail_name() 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&); friend ostream& operator<< (ostream&, const hname_t&);
private: private:
@ -79,6 +83,10 @@ extern bool operator == (const hname_t&, const hname_t&);
/* /*
* $Log: HName.h,v $ * $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 * Revision 1.3 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig. * conditional ident string using autoconfig.
* *

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include "config.h" # include "config.h"
@ -501,7 +501,7 @@ NetScope* Design::find_task(const hname_t&key)
return 0; return 0;
} }
NetEvent* Design::find_event(NetScope*scope, hname_t path) NetEvent* Design::find_event(NetScope*scope, const hname_t&path)
{ {
assert(scope); assert(scope);
@ -510,8 +510,12 @@ NetEvent* Design::find_event(NetScope*scope, hname_t path)
return ev; 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; break;
scope = scope->parent(); scope = scope->parent();
} }
@ -593,6 +597,10 @@ void Design::delete_process(NetProcTop*top)
/* /*
* $Log: net_design.cc,v $ * $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 * Revision 1.28 2002/10/19 22:59:49 steve
* Redo the parameter vector support to allow * Redo the parameter vector support to allow
* parameter names in range expressions. * parameter names in range expressions.

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
/* /*
@ -2995,7 +2995,7 @@ class Design {
NetScope* find_task(const hname_t&key); NetScope* find_task(const hname_t&key);
// Events // Events
NetEvent* find_event(NetScope*scope, const hname_t path); NetEvent* find_event(NetScope*scope, const hname_t&path);
// NODES // NODES
void add_node(NetNode*); void add_node(NetNode*);
@ -3083,6 +3083,10 @@ extern ostream& operator << (ostream&, NetNet::Type);
/* /*
* $Log: netlist.h,v $ * $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 * Revision 1.267 2002/10/23 01:47:17 steve
* Fix synth2 handling of aset/aclr signals where * Fix synth2 handling of aset/aclr signals where
* flip-flops are split by begin-end blocks. * 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 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #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 #endif
# include "config.h" # include "config.h"
@ -551,11 +551,11 @@ dr_strength1
; ;
event_control event_control
: '@' IDENTIFIER : '@' identifier
{ PEIdent*tmpi = new PEIdent(hname_t($2)); { PEIdent*tmpi = new PEIdent(*$2);
tmpi->set_file(@2.text); tmpi->set_file(@2.text);
tmpi->set_lineno(@2.first_line); tmpi->set_lineno(@2.first_line);
delete[]$2; delete $2;
PEEvent*tmpe = new PEEvent(PEEvent::ANYEDGE, tmpi); PEEvent*tmpe = new PEEvent(PEEvent::ANYEDGE, tmpi);
PEventStatement*tmps = new PEventStatement(tmpe); PEventStatement*tmps = new PEventStatement(tmpe);
tmps->set_file(@1.text); tmps->set_file(@1.text);