From b3529d85933bc211d70f63204d6be430205f0ae4 Mon Sep 17 00:00:00 2001 From: steve Date: Thu, 17 Jun 2004 16:06:18 +0000 Subject: [PATCH] Help system function signedness survive elaboration. --- dup_expr.cc | 7 ++++++- elab_expr.cc | 7 ++++++- t-dll-expr.cc | 6 +++++- tgt-stub/stub.c | 9 ++++++--- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/dup_expr.cc b/dup_expr.cc index 70c97b813..423e8cccf 100644 --- a/dup_expr.cc +++ b/dup_expr.cc @@ -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 diff --git a/elab_expr.cc b/elab_expr.cc index d9ca95fea..dd780a66e 100644 --- a/elab_expr.cc +++ b/elab_expr.cc @@ -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. * diff --git a/t-dll-expr.cc b/t-dll-expr.cc index d5d62ddac..e2e6353e0 100644 --- a/t-dll-expr.cc +++ b/t-dll-expr.cc @@ -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. * diff --git a/tgt-stub/stub.c b/tgt-stub/stub.c index d1b22a85f..a2384d0c3 100644 --- a/tgt-stub/stub.c +++ b/tgt-stub/stub.c @@ -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\n", ind, "", - ivl_expr_name(net), ivl_expr_width(net)); + fprintf(out, "%*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. *