Catch event declarations during scope elaborate.

This commit is contained in:
steve 2000-04-09 17:44:30 +00:00
parent 8d16ee9dd5
commit 72b3508911
3 changed files with 37 additions and 18 deletions

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: PEvent.h,v 1.2 2000/04/04 03:20:15 steve Exp $"
#ident "$Id: PEvent.h,v 1.3 2000/04/09 17:44:30 steve Exp $"
#endif
# include "LineInfo.h"
@ -40,7 +40,7 @@ class PEvent : public LineInfo {
string name() const;
void elaborate(Design*des, NetScope*scope) const;
void elaborate_scope(Design*des, NetScope*scope) const;
private:
string name_;
@ -52,6 +52,9 @@ class PEvent : public LineInfo {
/*
* $Log: PEvent.h,v $
* Revision 1.3 2000/04/09 17:44:30 steve
* Catch event declarations during scope elaborate.
*
* Revision 1.2 2000/04/04 03:20:15 steve
* Simulate named event trigger and waits.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: elab_scope.cc,v 1.3 2000/03/12 17:09:41 steve Exp $"
#ident "$Id: elab_scope.cc,v 1.4 2000/04/09 17:44:30 steve Exp $"
#endif
/*
@ -28,6 +28,7 @@
*/
# include "Module.h"
# include "PEvent.h"
# include "PExpr.h"
# include "PGate.h"
# include "PTask.h"
@ -173,6 +174,17 @@ bool Module::elaborate_scope(Design*des, NetScope*scope) const
(*cur) -> statement() -> elaborate_scope(des, scope);
}
// Scan through all the named events in this scope. We do not
// need anything more then the current scope to do this
// elaboration, so do it now. This allows for normal
// elaboration to reference these events.
for (map<string,PEvent*>::const_iterator et = events.begin()
; et != events.end() ; et ++ ) {
(*et).second->elaborate_scope(des, scope);
}
return des->errors == 0;
}
@ -254,6 +266,18 @@ void PGModule::elaborate_scope_mod_(Design*des, Module*mod, NetScope*sc) const
}
}
/*
* The isn't really able to create new scopes, but it does create the
* event name in the current scope, so can be done during the
* elaborate_scope scan.
*/
void PEvent::elaborate_scope(Design*des, NetScope*scope) const
{
NetEvent*ev = new NetEvent(name_);
ev->set_line(*this);
scope->add_event(ev);
}
void PFunction::elaborate_scope(Design*des, NetScope*scope) const
{
}
@ -391,6 +415,9 @@ void PWhile::elaborate_scope(Design*des, NetScope*scope) const
/*
* $Log: elab_scope.cc,v $
* Revision 1.4 2000/04/09 17:44:30 steve
* Catch event declarations during scope elaborate.
*
* Revision 1.3 2000/03/12 17:09:41 steve
* Support localparam.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: elaborate.cc,v 1.155 2000/04/09 16:43:50 steve Exp $"
#ident "$Id: elaborate.cc,v 1.156 2000/04/09 17:44:30 steve Exp $"
#endif
/*
@ -48,13 +48,6 @@ string Design::local_symbol(const string&path)
static const map<string,Module*>* modlist = 0;
static const map<string,PUdp*>* udplist = 0;
void PEvent::elaborate(Design*des, NetScope*scope) const
{
NetEvent*ev = new NetEvent(name_);
ev->set_line(*this);
scope->add_event(ev);
}
/*
* Elaborate a source wire. The "wire" is the declaration of wires,
* registers, ports and memories. The parser has already merged the
@ -1928,13 +1921,6 @@ bool Module::elaborate(Design*des, NetScope*scope) const
const string path = scope->name();
bool result_flag = true;
// Scan through the named events and elaborate them.
for (map<string,PEvent*>::const_iterator et = events.begin()
; et != events.end() ; et ++ ) {
(*et).second->elaborate(des, scope);
}
// Get all the explicitly declared wires of the module and
// start the signals list with them.
@ -2092,6 +2078,9 @@ Design* elaborate(const map<string,Module*>&modules,
/*
* $Log: elaborate.cc,v $
* Revision 1.156 2000/04/09 17:44:30 steve
* Catch event declarations during scope elaborate.
*
* Revision 1.155 2000/04/09 16:43:50 steve
* Catch event names in parentheses.
*