Behavioral trigger statements.
This commit is contained in:
parent
2cb76cabef
commit
966f7a4bff
14
t-dll-api.cc
14
t-dll-api.cc
|
|
@ -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
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT) && !defined(macintosh)
|
#if !defined(WINNT) && !defined(macintosh)
|
||||||
#ident "$Id: t-dll-api.cc,v 1.25 2001/03/29 02:52:39 steve Exp $"
|
#ident "$Id: t-dll-api.cc,v 1.26 2001/03/29 03:47:38 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "t-dll.h"
|
# include "t-dll.h"
|
||||||
|
|
@ -601,8 +601,15 @@ extern "C" unsigned long ivl_stmt_delay_val(ivl_statement_t net)
|
||||||
|
|
||||||
extern "C" ivl_event_t ivl_stmt_event(ivl_statement_t net)
|
extern "C" ivl_event_t ivl_stmt_event(ivl_statement_t net)
|
||||||
{
|
{
|
||||||
assert(net->type_ == IVL_ST_WAIT);
|
switch (net->type_) {
|
||||||
|
case IVL_ST_WAIT:
|
||||||
return net->u_.wait_.event_;
|
return net->u_.wait_.event_;
|
||||||
|
case IVL_ST_TRIGGER:
|
||||||
|
return net->u_.trig_.event_;
|
||||||
|
default:
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" ivl_lval_t ivl_stmt_lval(ivl_statement_t net, unsigned idx)
|
extern "C" ivl_lval_t ivl_stmt_lval(ivl_statement_t net, unsigned idx)
|
||||||
|
|
@ -709,6 +716,9 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: t-dll-api.cc,v $
|
* $Log: t-dll-api.cc,v $
|
||||||
|
* Revision 1.26 2001/03/29 03:47:38 steve
|
||||||
|
* Behavioral trigger statements.
|
||||||
|
*
|
||||||
* Revision 1.25 2001/03/29 02:52:39 steve
|
* Revision 1.25 2001/03/29 02:52:39 steve
|
||||||
* Add unary ~ operator to tgt-vvp.
|
* Add unary ~ operator to tgt-vvp.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,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: t-dll-proc.cc,v 1.13 2001/03/28 06:07:39 steve Exp $"
|
#ident "$Id: t-dll-proc.cc,v 1.14 2001/03/29 03:47:38 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "target.h"
|
# include "target.h"
|
||||||
|
|
@ -262,6 +262,21 @@ bool dll_target::proc_trigger(const NetEvTrig*net)
|
||||||
assert(stmt_cur_->type_ == IVL_ST_NONE);
|
assert(stmt_cur_->type_ == IVL_ST_NONE);
|
||||||
|
|
||||||
stmt_cur_->type_ = IVL_ST_TRIGGER;
|
stmt_cur_->type_ = IVL_ST_TRIGGER;
|
||||||
|
|
||||||
|
/* Locate the event by name. Save the ivl_event_t in the
|
||||||
|
statement so that the generator can find it easily. */
|
||||||
|
const NetEvent*ev = net->event();
|
||||||
|
ivl_scope_t ev_scope = lookup_scope_(ev->scope());
|
||||||
|
|
||||||
|
for (unsigned idx = 0 ; idx < ev_scope->nevent_ ; idx += 1) {
|
||||||
|
const char*ename = ivl_event_basename(ev_scope->event_[idx]);
|
||||||
|
if (strcmp(ev->name(), ename) == 0) {
|
||||||
|
stmt_cur_->u_.wait_.event_ = ev_scope->event_[idx];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -341,6 +356,9 @@ void dll_target::proc_while(const NetWhile*net)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: t-dll-proc.cc,v $
|
* $Log: t-dll-proc.cc,v $
|
||||||
|
* Revision 1.14 2001/03/29 03:47:38 steve
|
||||||
|
* Behavioral trigger statements.
|
||||||
|
*
|
||||||
* Revision 1.13 2001/03/28 06:07:39 steve
|
* Revision 1.13 2001/03/28 06:07:39 steve
|
||||||
* Add the ivl_event_t to ivl_target, and use that to generate
|
* Add the ivl_event_t to ivl_target, and use that to generate
|
||||||
* .event statements in vvp way ahead of the thread that uses it.
|
* .event statements in vvp way ahead of the thread that uses it.
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT)
|
#if !defined(WINNT)
|
||||||
#ident "$Id: vvp_process.c,v 1.10 2001/03/28 06:07:40 steve Exp $"
|
#ident "$Id: vvp_process.c,v 1.11 2001/03/29 03:47:38 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "vvp_priv.h"
|
# include "vvp_priv.h"
|
||||||
|
|
@ -193,6 +193,14 @@ static int show_stmt_noop(ivl_statement_t net)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int show_stmt_trigger(ivl_statement_t net)
|
||||||
|
{
|
||||||
|
ivl_event_t ev = ivl_stmt_event(net);
|
||||||
|
assert(ev);
|
||||||
|
fprintf(vvp_out, " %%set E_%s, 0;\n", ivl_event_name(ev));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int show_stmt_wait(ivl_statement_t net)
|
static int show_stmt_wait(ivl_statement_t net)
|
||||||
{
|
{
|
||||||
ivl_event_t ev = ivl_stmt_event(net);
|
ivl_event_t ev = ivl_stmt_event(net);
|
||||||
|
|
@ -277,6 +285,10 @@ static int show_statement(ivl_statement_t net)
|
||||||
rc += show_system_task_call(net);
|
rc += show_system_task_call(net);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case IVL_ST_TRIGGER:
|
||||||
|
rc += show_stmt_trigger(net);
|
||||||
|
break;
|
||||||
|
|
||||||
case IVL_ST_WAIT:
|
case IVL_ST_WAIT:
|
||||||
rc += show_stmt_wait(net);
|
rc += show_stmt_wait(net);
|
||||||
break;
|
break;
|
||||||
|
|
@ -387,6 +399,9 @@ int draw_process(ivl_process_t net, void*x)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: vvp_process.c,v $
|
* $Log: vvp_process.c,v $
|
||||||
|
* Revision 1.11 2001/03/29 03:47:38 steve
|
||||||
|
* Behavioral trigger statements.
|
||||||
|
*
|
||||||
* Revision 1.10 2001/03/28 06:07:40 steve
|
* Revision 1.10 2001/03/28 06:07:40 steve
|
||||||
* Add the ivl_event_t to ivl_target, and use that to generate
|
* Add the ivl_event_t to ivl_target, and use that to generate
|
||||||
* .event statements in vvp way ahead of the thread that uses it.
|
* .event statements in vvp way ahead of the thread that uses it.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue