Handle concatenations in l-values.
This commit is contained in:
parent
d5d03812cd
commit
f50f06ab4e
46
synth2.cc
46
synth2.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
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CVS_IDENT
|
#ifdef HAVE_CVS_IDENT
|
||||||
#ident "$Id: synth2.cc,v 1.39.2.7 2005/12/10 03:30:51 steve Exp $"
|
#ident "$Id: synth2.cc,v 1.39.2.8 2005/12/10 04:26:32 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -105,39 +105,50 @@ bool NetAssignBase::synth_async(Design*des, NetScope*scope,
|
||||||
const NetNet*nex_map, NetNet*nex_out,
|
const NetNet*nex_map, NetNet*nex_out,
|
||||||
NetNet*accum_in)
|
NetNet*accum_in)
|
||||||
{
|
{
|
||||||
DEBUG_SYNTH2_ENTRY("NetAssignBase")
|
|
||||||
|
|
||||||
NetNet*rsig = rval_->synthesize(des);
|
NetNet*rsig = rval_->synthesize(des);
|
||||||
assert(rsig);
|
assert(rsig);
|
||||||
|
#if 0
|
||||||
NetNet*lsig = lval_->sig();
|
if (lval_->more) {
|
||||||
if (!lsig) {
|
cerr << get_line() << ": internal error: I do not know how "
|
||||||
cerr << get_line() << ": error: NetAssignBase::synth_async on unsupported lval ";
|
<< "to support this l-value concatenation: ";
|
||||||
dump_lval(cerr);
|
dump_lval(cerr);
|
||||||
cerr << endl;
|
cerr << endl;
|
||||||
DEBUG_SYNTH2_EXIT("NetAssignBase",false)
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
assert(lval_->more == 0);
|
assert(lval_->more == 0);
|
||||||
|
#endif
|
||||||
|
unsigned roff = 0;
|
||||||
|
|
||||||
|
for (NetAssign_*cur = lval_ ; cur ; cur = cur->more) {
|
||||||
|
|
||||||
|
NetNet*lsig = cur->sig();
|
||||||
|
if (!lsig) {
|
||||||
|
cerr << get_line() << ": error: NetAssignBase::synth_async "
|
||||||
|
"on unsupported lval ";
|
||||||
|
dump_lval(cerr);
|
||||||
|
cerr << endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/* Bind the outputs that we do make to the nex_out. Use the
|
/* Bind the outputs that we do make to the nex_out. Use the
|
||||||
nex_map to map the l-value bit position to the nex_out bit
|
nex_map to map the l-value bit position to the nex_out bit
|
||||||
position. */
|
position. */
|
||||||
for (unsigned idx = 0 ; idx < lval_->lwidth() ; idx += 1) {
|
for (unsigned idx = 0 ; idx < cur->lwidth() ; idx += 1) {
|
||||||
unsigned off = lval_->get_loff()+idx;
|
unsigned off = cur->get_loff()+idx;
|
||||||
unsigned ptr = find_nexus_in_set(nex_map, lsig->pin(off).nexus());
|
unsigned ptr = find_nexus_in_set(nex_map, lsig->pin(off).nexus());
|
||||||
assert(ptr <= nex_map->pin_count());
|
assert(ptr <= nex_map->pin_count());
|
||||||
connect(nex_out->pin(ptr), rsig->pin(idx));
|
connect(nex_out->pin(ptr), rsig->pin(roff+idx));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
roff += cur->lwidth();
|
||||||
|
|
||||||
/* This lval_ represents a reg that is a WIRE in the
|
/* This lval_ represents a reg that is a WIRE in the
|
||||||
synthesized results. This function signals the destructor
|
synthesized results. This function signals the destructor
|
||||||
to change the REG that this l-value refers to into a
|
to change the REG that this l-value refers to into a
|
||||||
WIRE. It is done then, at the last minute, so that pending
|
WIRE. It is done then, at the last minute, so that pending
|
||||||
synthesis can continue to work with it as a WIRE. */
|
synthesis can continue to work with it as a WIRE. */
|
||||||
lval_->turn_sig_to_wire_on_release();
|
cur->turn_sig_to_wire_on_release();
|
||||||
|
}
|
||||||
|
|
||||||
DEBUG_SYNTH2_EXIT("NetAssignBase",true)
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -913,6 +924,10 @@ bool NetCondit::synth_sync(Design*des, NetScope*scope, NetFF*ff,
|
||||||
tmp.set(bit, asig->pin(bit).nexus()->driven_value());
|
tmp.set(bit, asig->pin(bit).nexus()->driven_value());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! tmp.is_defined())
|
||||||
|
cerr << get_line() << ": internal error: "
|
||||||
|
<< "Strange clr r-value=" << tmp << endl;
|
||||||
|
|
||||||
assert(tmp.is_defined());
|
assert(tmp.is_defined());
|
||||||
if (tmp.is_zero()) {
|
if (tmp.is_zero()) {
|
||||||
connect(ff->pin_Sclr(), rst->pin(0));
|
connect(ff->pin_Sclr(), rst->pin(0));
|
||||||
|
|
@ -1196,6 +1211,9 @@ void synth2(Design*des)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: synth2.cc,v $
|
* $Log: synth2.cc,v $
|
||||||
|
* Revision 1.39.2.8 2005/12/10 04:26:32 steve
|
||||||
|
* Handle concatenations in l-values.
|
||||||
|
*
|
||||||
* Revision 1.39.2.7 2005/12/10 03:30:51 steve
|
* Revision 1.39.2.7 2005/12/10 03:30:51 steve
|
||||||
* Fix crash on block with assignments that assign lval to self.
|
* Fix crash on block with assignments that assign lval to self.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue