Special handling of exploded memory arguments.

This commit is contained in:
steve 2006-09-15 23:56:05 +00:00
parent 79add47002
commit 4ec8b38a5c
2 changed files with 76 additions and 42 deletions

View File

@ -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
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll-expr.cc,v 1.39.2.1 2006/03/12 07:34:19 steve Exp $" #ident "$Id: t-dll-expr.cc,v 1.39.2.2 2006/09/15 23:56:05 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -226,6 +226,19 @@ void dll_target::expr_memory(const NetEMemory*net)
if (const NetNet*reg = mem->reg_from_explode()) { if (const NetNet*reg = mem->reg_from_explode()) {
if (expr_ == 0) {
// If there is no index expression for the
// exploded memory, then replace it with the
// entire exploded reg.
cur->type_ = IVL_EX_SIGNAL;
cur->value_ = IVL_VT_VECTOR;
cur->width_= reg->pin_count();
cur->signed_ = net->has_sign()? 1 : 0;
cur->u_.signal_.sig = find_signal(des_, reg);
cur->u_.signal_.lsi = 0;
cur->u_.signal_.msi = cur->width_ - 1;
} else {
cur->type_ = IVL_EX_SELECT; cur->type_ = IVL_EX_SELECT;
cur->value_ = IVL_VT_VECTOR; cur->value_ = IVL_VT_VECTOR;
cur->width_ = net->expr_width(); cur->width_ = net->expr_width();
@ -239,6 +252,7 @@ void dll_target::expr_memory(const NetEMemory*net)
sig->width_ = reg->pin_count(); sig->width_ = reg->pin_count();
sig->signed_ = 0; sig->signed_ = 0;
sig->u_.signal_.sig = find_signal(des_, reg); sig->u_.signal_.sig = find_signal(des_, reg);
assert(sig->u_.signal_.sig);
sig->u_.signal_.lsi = 0; sig->u_.signal_.lsi = 0;
sig->u_.signal_.msi = reg->pin_count()-1; sig->u_.signal_.msi = reg->pin_count()-1;
cur->u_.binary_.lef_ = sig; cur->u_.binary_.lef_ = sig;
@ -265,6 +279,7 @@ void dll_target::expr_memory(const NetEMemory*net)
mul->u_.binary_.rig_ = fac; mul->u_.binary_.rig_ = fac;
cur->u_.binary_.rig_ = mul; cur->u_.binary_.rig_ = mul;
} }
}
} else { } else {
cur->type_ = IVL_EX_MEMORY; cur->type_ = IVL_EX_MEMORY;
@ -650,6 +665,9 @@ void dll_target::expr_variable(const NetEVariable*net)
/* /*
* $Log: t-dll-expr.cc,v $ * $Log: t-dll-expr.cc,v $
* Revision 1.39.2.2 2006/09/15 23:56:05 steve
* Special handling of exploded memory arguments.
*
* Revision 1.39.2.1 2006/03/12 07:34:19 steve * Revision 1.39.2.1 2006/03/12 07:34:19 steve
* Fix the memsynth1 case. * Fix the memsynth1 case.
* *

View File

@ -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
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: stub.c,v 1.90.2.10 2006/07/23 19:42:35 steve Exp $" #ident "$Id: stub.c,v 1.90.2.11 2006/09/15 23:56:05 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -81,12 +81,21 @@ static void show_expression(ivl_expr_t net, unsigned ind)
show_expression(ivl_expr_oper1(net), ind+3); show_expression(ivl_expr_oper1(net), ind+3);
break; break;
case IVL_EX_BINARY: case IVL_EX_BINARY: {
ivl_expr_t oper1 = ivl_expr_oper1(net);
ivl_expr_t oper2 = ivl_expr_oper2(net);
fprintf(out, "%*s<\"%c\" width=%u, %s, type=%s>\n", ind, "", fprintf(out, "%*s<\"%c\" width=%u, %s, type=%s>\n", ind, "",
ivl_expr_opcode(net), width, sign, vt); ivl_expr_opcode(net), width, sign, vt);
show_expression(ivl_expr_oper1(net), ind+3); if (oper1)
show_expression(ivl_expr_oper2(net), ind+3); show_expression(oper1, ind+3);
else
fprintf(out, "%*sERROR: nil oper1\n", ind+3, "");
if (oper2)
show_expression(oper2, ind+3);
else
fprintf(out, "%*sERROR: nil oper2\n", ind+3, "");
break; break;
}
case IVL_EX_CONCAT: case IVL_EX_CONCAT:
fprintf(out, "%*s<concat repeat=%u, width=%u, %s, type=%s>\n", fprintf(out, "%*s<concat repeat=%u, width=%u, %s, type=%s>\n",
@ -122,9 +131,13 @@ static void show_expression(ivl_expr_t net, unsigned ind)
/* The SELECT expression can be used to express part /* The SELECT expression can be used to express part
select, or if the base is null vector extension. */ select, or if the base is null vector extension. */
if (ivl_expr_oper2(net)) { if (ivl_expr_oper2(net)) {
ivl_expr_t o1 = ivl_expr_oper1(net);
fprintf(out, "%*s<select: width=%u, %s>\n", ind, "", fprintf(out, "%*s<select: width=%u, %s>\n", ind, "",
width, sign); width, sign);
if (o1)
show_expression(ivl_expr_oper1(net), ind+3); show_expression(ivl_expr_oper1(net), ind+3);
else
fprintf(out, "%*sERROR: Missing oper1\n", ind+3, "");
show_expression(ivl_expr_oper2(net), ind+3); show_expression(ivl_expr_oper2(net), ind+3);
} else { } else {
fprintf(out, "%*s<expr pad: width=%u, %s>\n", ind, "", fprintf(out, "%*s<expr pad: width=%u, %s>\n", ind, "",
@ -1118,6 +1131,9 @@ int target_design(ivl_design_t des)
/* /*
* $Log: stub.c,v $ * $Log: stub.c,v $
* Revision 1.90.2.11 2006/09/15 23:56:05 steve
* Special handling of exploded memory arguments.
*
* Revision 1.90.2.10 2006/07/23 19:42:35 steve * Revision 1.90.2.10 2006/07/23 19:42:35 steve
* Handle statement output override better in blocks. * Handle statement output override better in blocks.
* *