Help system function signedness survive elaboration.

This commit is contained in:
steve 2004-06-17 16:06:18 +00:00
parent 112368c7de
commit b3529d8593
4 changed files with 23 additions and 6 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: dup_expr.cc,v 1.17 2004/05/31 23:34:36 steve Exp $"
#ident "$Id: dup_expr.cc,v 1.18 2004/06/17 16:06:18 steve Exp $"
#endif
# include "config.h"
@ -75,6 +75,8 @@ NetESFunc* NetESFunc::dup_expr() const
{
NetESFunc*tmp = new NetESFunc(name_, type_, expr_width(), nparms());
assert(tmp);
tmp->cast_signed(has_sign());
for (unsigned idx = 0 ; idx < nparms() ; idx += 1) {
assert(tmp->parm(idx));
tmp->parm(idx, tmp->parm(idx)->dup_expr());
@ -141,6 +143,9 @@ NetEVariable* NetEVariable::dup_expr() const
/*
* $Log: dup_expr.cc,v $
* Revision 1.18 2004/06/17 16:06:18 steve
* Help system function signedness survive elaboration.
*
* Revision 1.17 2004/05/31 23:34:36 steve
* Rewire/generalize parsing an elaboration of
* function return values to allow for better

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: elab_expr.cc,v 1.87 2004/06/04 23:34:15 steve Exp $"
#ident "$Id: elab_expr.cc,v 1.88 2004/06/17 16:06:18 steve Exp $"
#endif
# include "config.h"
@ -244,6 +244,8 @@ NetExpr* PECallFunction::elaborate_sfunc_(Design*des, NetScope*scope) const
NetESFunc*fun = new NetESFunc(path_.peek_name(0), sfunc_type,
wid, nparms);
if (sfunc_info->signed_flag)
fun->cast_signed(true);
/* Now run through the expected parameters. If we find that
there are missing parameters, print an error message.
@ -965,6 +967,9 @@ NetExpr* PEUnary::elaborate_expr(Design*des, NetScope*scope, bool) const
/*
* $Log: elab_expr.cc,v $
* Revision 1.88 2004/06/17 16:06:18 steve
* Help system function signedness survive elaboration.
*
* Revision 1.87 2004/06/04 23:34:15 steve
* Special case for unary - of real literal.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll-expr.cc,v 1.38 2003/07/26 03:34:43 steve Exp $"
#ident "$Id: t-dll-expr.cc,v 1.39 2004/06/17 16:06:19 steve Exp $"
#endif
# include "config.h"
@ -382,6 +382,7 @@ void dll_target::expr_sfunc(const NetESFunc*net)
break;
}
expr->width_= net->expr_width();
expr->signed_ = net->has_sign()? 1 : 0;
/* system function names are lex_strings strings. */
expr->u_.sfunc_.name_ = net->name();
@ -603,6 +604,9 @@ void dll_target::expr_variable(const NetEVariable*net)
/*
* $Log: t-dll-expr.cc,v $
* Revision 1.39 2004/06/17 16:06:19 steve
* Help system function signedness survive elaboration.
*
* Revision 1.38 2003/07/26 03:34:43 steve
* Start handling pad of expressions in code generators.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: stub.c,v 1.85 2004/06/16 16:22:04 steve Exp $"
#ident "$Id: stub.c,v 1.86 2004/06/17 16:06:19 steve Exp $"
#endif
# include "config.h"
@ -121,8 +121,8 @@ static void show_expression(ivl_expr_t net, unsigned ind)
break;
case IVL_EX_SFUNC:
fprintf(out, "%*s<function=\"%s\", width=%u>\n", ind, "",
ivl_expr_name(net), ivl_expr_width(net));
fprintf(out, "%*s<function=\"%s\", width=%u, %s>\n", ind, "",
ivl_expr_name(net), ivl_expr_width(net), sign);
{ unsigned cnt = ivl_expr_parms(net);
unsigned idx;
for (idx = 0 ; idx < cnt ; idx += 1)
@ -909,6 +909,9 @@ int target_design(ivl_design_t des)
/*
* $Log: stub.c,v $
* Revision 1.86 2004/06/17 16:06:19 steve
* Help system function signedness survive elaboration.
*
* Revision 1.85 2004/06/16 16:22:04 steve
* Dump NE LPM device.
*