Support calculated delays in vvp.tgt.
This commit is contained in:
parent
e773ccfe49
commit
cd8e491028
10
ivl_target.h
10
ivl_target.h
|
|
@ -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: ivl_target.h,v 1.71 2001/07/04 22:59:25 steve Exp $"
|
#ident "$Id: ivl_target.h,v 1.72 2001/07/19 04:55:06 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
@ -850,7 +850,7 @@ extern ivl_expr_t ivl_stmt_cond_expr(ivl_statement_t net);
|
||||||
extern ivl_statement_t ivl_stmt_cond_false(ivl_statement_t net);
|
extern ivl_statement_t ivl_stmt_cond_false(ivl_statement_t net);
|
||||||
/* IVL_ST_CONDIT */
|
/* IVL_ST_CONDIT */
|
||||||
extern ivl_statement_t ivl_stmt_cond_true(ivl_statement_t net);
|
extern ivl_statement_t ivl_stmt_cond_true(ivl_statement_t net);
|
||||||
/* IVL_ST_ASSIGN IVL_ST_ASSIGN_NB */
|
/* IVL_ST_ASSIGN IVL_ST_ASSIGN_NB IVL_ST_DELAYX */
|
||||||
extern ivl_expr_t ivl_stmt_delay_expr(ivl_statement_t net);
|
extern ivl_expr_t ivl_stmt_delay_expr(ivl_statement_t net);
|
||||||
/* IVL_ST_DELAY */
|
/* IVL_ST_DELAY */
|
||||||
extern unsigned long ivl_stmt_delay_val(ivl_statement_t net);
|
extern unsigned long ivl_stmt_delay_val(ivl_statement_t net);
|
||||||
|
|
@ -870,7 +870,8 @@ extern ivl_expr_t ivl_stmt_parm(ivl_statement_t net, unsigned idx);
|
||||||
extern unsigned ivl_stmt_parm_count(ivl_statement_t net);
|
extern unsigned ivl_stmt_parm_count(ivl_statement_t net);
|
||||||
/* IVL_ST_ASSIGN IVL_ST_ASSIGN_NB */
|
/* IVL_ST_ASSIGN IVL_ST_ASSIGN_NB */
|
||||||
extern ivl_expr_t ivl_stmt_rval(ivl_statement_t net);
|
extern ivl_expr_t ivl_stmt_rval(ivl_statement_t net);
|
||||||
/* IVL_ST_DELAY, IVL_ST_FOREVER, IVL_ST_REPEAT IVL_ST_WAIT, IVL_ST_WHILE */
|
/* IVL_ST_DELAY, IVL_ST_DELAYX, IVL_ST_FOREVER, IVL_ST_REPEAT
|
||||||
|
IVL_ST_WAIT, IVL_ST_WHILE */
|
||||||
extern ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net);
|
extern ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -891,6 +892,9 @@ _END_DECL
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: ivl_target.h,v $
|
* $Log: ivl_target.h,v $
|
||||||
|
* Revision 1.72 2001/07/19 04:55:06 steve
|
||||||
|
* Support calculated delays in vvp.tgt.
|
||||||
|
*
|
||||||
* Revision 1.71 2001/07/04 22:59:25 steve
|
* Revision 1.71 2001/07/04 22:59:25 steve
|
||||||
* handle left shifter in dll output.
|
* handle left shifter in dll output.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
10
t-dll-api.cc
10
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.55 2001/07/07 20:20:10 steve Exp $"
|
#ident "$Id: t-dll-api.cc,v 1.56 2001/07/19 04:55:06 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "t-dll.h"
|
# include "t-dll.h"
|
||||||
|
|
@ -1111,6 +1111,9 @@ extern "C" ivl_expr_t ivl_stmt_delay_expr(ivl_statement_t net)
|
||||||
case IVL_ST_ASSIGN_NB:
|
case IVL_ST_ASSIGN_NB:
|
||||||
return net->u_.assign_.delay;
|
return net->u_.assign_.delay;
|
||||||
|
|
||||||
|
case IVL_ST_DELAYX:
|
||||||
|
return net->u_.delayx_.expr;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -1241,6 +1244,8 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net)
|
||||||
switch (net->type_) {
|
switch (net->type_) {
|
||||||
case IVL_ST_DELAY:
|
case IVL_ST_DELAY:
|
||||||
return net->u_.delay_.stmt_;
|
return net->u_.delay_.stmt_;
|
||||||
|
case IVL_ST_DELAYX:
|
||||||
|
return net->u_.delayx_.stmt_;
|
||||||
case IVL_ST_FOREVER:
|
case IVL_ST_FOREVER:
|
||||||
return net->u_.forever_.stmt_;
|
return net->u_.forever_.stmt_;
|
||||||
case IVL_ST_WAIT:
|
case IVL_ST_WAIT:
|
||||||
|
|
@ -1257,6 +1262,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.56 2001/07/19 04:55:06 steve
|
||||||
|
* Support calculated delays in vvp.tgt.
|
||||||
|
*
|
||||||
* Revision 1.55 2001/07/07 20:20:10 steve
|
* Revision 1.55 2001/07/07 20:20:10 steve
|
||||||
* Pass parameters to system functions.
|
* Pass parameters to system functions.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -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.30 2001/06/21 23:23:14 steve Exp $"
|
#ident "$Id: t-dll-proc.cc,v 1.31 2001/07/19 04:55:06 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "target.h"
|
# include "target.h"
|
||||||
|
|
@ -444,6 +444,11 @@ bool dll_target::proc_delay(const NetPDelay*net)
|
||||||
if (const NetExpr*expr = net->expr()) {
|
if (const NetExpr*expr = net->expr()) {
|
||||||
|
|
||||||
stmt_cur_->type_ = IVL_ST_DELAYX;
|
stmt_cur_->type_ = IVL_ST_DELAYX;
|
||||||
|
assert(expr_ == 0);
|
||||||
|
expr->expr_scan(this);
|
||||||
|
stmt_cur_->u_.delayx_.expr = expr_;
|
||||||
|
expr_ = 0;
|
||||||
|
|
||||||
stmt_cur_->u_.delayx_.stmt_ = tmp;
|
stmt_cur_->u_.delayx_.stmt_ = tmp;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -684,6 +689,9 @@ void dll_target::proc_while(const NetWhile*net)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: t-dll-proc.cc,v $
|
* $Log: t-dll-proc.cc,v $
|
||||||
|
* Revision 1.31 2001/07/19 04:55:06 steve
|
||||||
|
* Support calculated delays in vvp.tgt.
|
||||||
|
*
|
||||||
* Revision 1.30 2001/06/21 23:23:14 steve
|
* Revision 1.30 2001/06/21 23:23:14 steve
|
||||||
* Initialize stmt_cur_ substatements during dll case building.
|
* Initialize stmt_cur_ substatements during dll case building.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
7
t-dll.h
7
t-dll.h
|
|
@ -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: t-dll.h,v 1.54 2001/07/07 20:20:10 steve Exp $"
|
#ident "$Id: t-dll.h,v 1.55 2001/07/19 04:55:06 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "target.h"
|
# include "target.h"
|
||||||
|
|
@ -512,7 +512,7 @@ struct ivl_statement_s {
|
||||||
} delay_;
|
} delay_;
|
||||||
|
|
||||||
struct { /* IVL_ST_DELAYX */
|
struct { /* IVL_ST_DELAYX */
|
||||||
int expr_; /* XXXX */
|
ivl_expr_t expr; /* XXXX */
|
||||||
ivl_statement_t stmt_;
|
ivl_statement_t stmt_;
|
||||||
} delayx_;
|
} delayx_;
|
||||||
|
|
||||||
|
|
@ -552,6 +552,9 @@ struct ivl_statement_s {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: t-dll.h,v $
|
* $Log: t-dll.h,v $
|
||||||
|
* Revision 1.55 2001/07/19 04:55:06 steve
|
||||||
|
* Support calculated delays in vvp.tgt.
|
||||||
|
*
|
||||||
* Revision 1.54 2001/07/07 20:20:10 steve
|
* Revision 1.54 2001/07/07 20:20:10 steve
|
||||||
* Pass parameters to system functions.
|
* Pass parameters to system functions.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -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.38 2001/06/29 02:41:05 steve Exp $"
|
#ident "$Id: vvp_process.c,v 1.39 2001/07/19 04:55:06 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "vvp_priv.h"
|
# include "vvp_priv.h"
|
||||||
|
|
@ -453,6 +453,29 @@ static int show_stmt_delay(ivl_statement_t net, ivl_scope_t sscope)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The delayx statement is slightly more complex in that it is
|
||||||
|
* necessary to calculate the delay first. Load the calculated delay
|
||||||
|
* into and index register and use the %delayx instruction to do the
|
||||||
|
* actual delay.
|
||||||
|
*/
|
||||||
|
static int show_stmt_delayx(ivl_statement_t net, ivl_scope_t sscope)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
ivl_expr_t exp = ivl_stmt_delay_expr(net);
|
||||||
|
ivl_statement_t stmt = ivl_stmt_sub_stmt(net);
|
||||||
|
|
||||||
|
{ struct vector_info del = draw_eval_expr(exp);
|
||||||
|
fprintf(vvp_out, " %%ix/get 0, %u, %u;\n", del.base, del.wid);
|
||||||
|
clr_vector(del);
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(vvp_out, " %%delayx 0;\n");
|
||||||
|
|
||||||
|
rc += show_statement(stmt, sscope);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
static int show_stmt_disable(ivl_statement_t net, ivl_scope_t sscope)
|
static int show_stmt_disable(ivl_statement_t net, ivl_scope_t sscope)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
@ -755,6 +778,10 @@ static int show_statement(ivl_statement_t net, ivl_scope_t sscope)
|
||||||
rc += show_stmt_delay(net, sscope);
|
rc += show_stmt_delay(net, sscope);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case IVL_ST_DELAYX:
|
||||||
|
rc += show_stmt_delayx(net, sscope);
|
||||||
|
break;
|
||||||
|
|
||||||
case IVL_ST_DISABLE:
|
case IVL_ST_DISABLE:
|
||||||
rc += show_stmt_disable(net, sscope);
|
rc += show_stmt_disable(net, sscope);
|
||||||
break;
|
break;
|
||||||
|
|
@ -887,6 +914,9 @@ int draw_func_definition(ivl_scope_t scope)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: vvp_process.c,v $
|
* $Log: vvp_process.c,v $
|
||||||
|
* Revision 1.39 2001/07/19 04:55:06 steve
|
||||||
|
* Support calculated delays in vvp.tgt.
|
||||||
|
*
|
||||||
* Revision 1.38 2001/06/29 02:41:05 steve
|
* Revision 1.38 2001/06/29 02:41:05 steve
|
||||||
* Handle null parameters to system tasks.
|
* Handle null parameters to system tasks.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue