diff --git a/ivl_target.h b/ivl_target.h index 43ab1111d..3375ebb5d 100644 --- a/ivl_target.h +++ b/ivl_target.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: ivl_target.h,v 1.46 2001/04/03 04:50:37 steve Exp $" +#ident "$Id: ivl_target.h,v 1.47 2001/04/04 04:50:35 steve Exp $" #endif #ifdef __cplusplus @@ -247,6 +247,7 @@ typedef enum ivl_statement_type_e { IVL_ST_CONDIT, IVL_ST_DELAY, IVL_ST_DELAYX, + IVL_ST_FOREVER, IVL_ST_FORK, IVL_ST_STASK, IVL_ST_TRIGGER, @@ -715,7 +716,7 @@ extern ivl_expr_t ivl_stmt_parm(ivl_statement_t net, unsigned idx); extern unsigned ivl_stmt_parm_count(ivl_statement_t net); /* IVL_ST_ASSIGN IVL_ST_ASSIGN_NB */ extern ivl_expr_t ivl_stmt_rval(ivl_statement_t net); - /* IVL_ST_DELAY, IVL_ST_WAIT, IVL_ST_WHILE */ + /* IVL_ST_DELAY, IVL_ST_FOREVER, IVL_ST_WAIT, IVL_ST_WHILE */ extern ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net); @@ -736,6 +737,9 @@ _END_DECL /* * $Log: ivl_target.h,v $ + * Revision 1.47 2001/04/04 04:50:35 steve + * Support forever loops in the tgt-vvp target. + * * Revision 1.46 2001/04/03 04:50:37 steve * Support non-blocking assignments. * diff --git a/t-dll-api.cc b/t-dll-api.cc index bb39af2e3..a8c3934bb 100644 --- a/t-dll-api.cc +++ b/t-dll-api.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: t-dll-api.cc,v 1.33 2001/04/03 04:50:37 steve Exp $" +#ident "$Id: t-dll-api.cc,v 1.34 2001/04/04 04:50:35 steve Exp $" #endif # include "t-dll.h" @@ -821,6 +821,8 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net) switch (net->type_) { case IVL_ST_DELAY: return net->u_.delay_.stmt_; + case IVL_ST_FOREVER: + return net->u_.forever_.stmt_; case IVL_ST_WAIT: return net->u_.wait_.stmt_; case IVL_ST_WHILE: @@ -834,6 +836,9 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net) /* * $Log: t-dll-api.cc,v $ + * Revision 1.34 2001/04/04 04:50:35 steve + * Support forever loops in the tgt-vvp target. + * * Revision 1.33 2001/04/03 04:50:37 steve * Support non-blocking assignments. * diff --git a/t-dll-proc.cc b/t-dll-proc.cc index e470630c6..08e5cca04 100644 --- a/t-dll-proc.cc +++ b/t-dll-proc.cc @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: t-dll-proc.cc,v 1.21 2001/04/03 04:50:37 steve Exp $" +#ident "$Id: t-dll-proc.cc,v 1.22 2001/04/04 04:50:35 steve Exp $" #endif # include "target.h" @@ -349,6 +349,25 @@ bool dll_target::proc_delay(const NetPDelay*net) return flag; } +void dll_target::proc_forever(const NetForever*net) +{ + assert(stmt_cur_); + assert(stmt_cur_->type_ == IVL_ST_NONE); + + stmt_cur_->type_ = IVL_ST_FOREVER; + + ivl_statement_t tmp = (struct ivl_statement_s*) + calloc(1, sizeof(struct ivl_statement_s)); + + ivl_statement_t save_cur_ = stmt_cur_; + stmt_cur_ = tmp; + + net->emit_recurse(this); + + save_cur_->u_.forever_.stmt_ = stmt_cur_; + stmt_cur_ = save_cur_; +} + void dll_target::proc_stask(const NetSTask*net) { unsigned nparms = net->nparms(); @@ -511,6 +530,9 @@ void dll_target::proc_while(const NetWhile*net) /* * $Log: t-dll-proc.cc,v $ + * Revision 1.22 2001/04/04 04:50:35 steve + * Support forever loops in the tgt-vvp target. + * * Revision 1.21 2001/04/03 04:50:37 steve * Support non-blocking assignments. * diff --git a/t-dll.h b/t-dll.h index 5860a592e..b07df1ed1 100644 --- a/t-dll.h +++ b/t-dll.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: t-dll.h,v 1.33 2001/04/03 04:50:37 steve Exp $" +#ident "$Id: t-dll.h,v 1.34 2001/04/04 04:50:35 steve Exp $" #endif # include "target.h" @@ -83,6 +83,7 @@ struct dll_target : public target_t, public expr_scan_t { void proc_case(const NetCase*); void proc_condit(const NetCondit*); bool proc_delay(const NetPDelay*); + void proc_forever(const NetForever*); void proc_stask(const NetSTask*); bool proc_trigger(const NetEvTrig*); void proc_utask(const NetUTask*); @@ -382,6 +383,10 @@ struct ivl_statement_s { ivl_statement_t stmt_; } delayx_; + struct { /* IVL_ST_FOREVER */ + ivl_statement_t stmt_; + } forever_; + struct { /* IVL_ST_STASK */ char* name_; unsigned nparm_; @@ -410,6 +415,9 @@ struct ivl_statement_s { /* * $Log: t-dll.h,v $ + * Revision 1.34 2001/04/04 04:50:35 steve + * Support forever loops in the tgt-vvp target. + * * Revision 1.33 2001/04/03 04:50:37 steve * Support non-blocking assignments. * diff --git a/tgt-vvp/vvp_process.c b/tgt-vvp/vvp_process.c index 0b949cabe..c9649ad8d 100644 --- a/tgt-vvp/vvp_process.c +++ b/tgt-vvp/vvp_process.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: vvp_process.c,v 1.23 2001/04/04 04:28:41 steve Exp $" +#ident "$Id: vvp_process.c,v 1.24 2001/04/04 04:50:35 steve Exp $" #endif # include "vvp_priv.h" @@ -354,6 +354,19 @@ static int show_stmt_delay(ivl_statement_t net) return rc; } +static int show_stmt_forever(ivl_statement_t net) +{ + int rc = 0; + ivl_statement_t stmt = ivl_stmt_sub_stmt(net); + unsigned lab_top = local_count++; + + fprintf(vvp_out, "T_%u.%u ;\n", thread_count, lab_top); + rc += show_statement(stmt); + fprintf(vvp_out, " %%jmp T_%u.%u;\n", thread_count, lab_top); + + return rc; +} + static int show_stmt_fork(ivl_statement_t net) { unsigned idx; @@ -553,6 +566,10 @@ static int show_statement(ivl_statement_t net) rc += show_stmt_delay(net); break; + case IVL_ST_FOREVER: + rc += show_stmt_forever(net); + break; + case IVL_ST_FORK: rc += show_stmt_fork(net); break; @@ -656,6 +673,9 @@ int draw_task_definition(ivl_scope_t scope) /* * $Log: vvp_process.c,v $ + * Revision 1.24 2001/04/04 04:50:35 steve + * Support forever loops in the tgt-vvp target. + * * Revision 1.23 2001/04/04 04:28:41 steve * Fix broken look scanning down bits of number. *