Bug with in signed MUX.

This commit is contained in:
Alan Mishchenko 2015-06-14 13:18:23 -07:00
parent 17c32289e1
commit 6e4ef76311
1 changed files with 11 additions and 8 deletions

View File

@ -541,19 +541,22 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Vec_Int_t * vBoxIds )
}
else if ( pObj->Type == WLC_OBJ_MUX )
{
int fSigned = 1;
assert( nRange0 >= 1 && Wlc_ObjFaninNum(pObj) >= 3 );
assert( 1 + (1 << nRange0) == Wlc_ObjFaninNum(pObj) );
Wlc_ObjForEachFanin( pObj, iFanin, k )
if ( k > 0 )
fSigned &= Wlc_NtkObj(p, iFanin)->Signed;
for ( b = 0; b < nRange; b++ )
{
Vec_IntClear( vTemp0 );
Wlc_ObjForEachFanin( pObj, iFanin, k )
{
if ( !k ) continue;
//assert( nRange == Wlc_ObjRange(Wlc_NtkObj(p, iFanin)) );
pPrev = Wlc_NtkObj(p, iFanin);
nRange1 = Wlc_ObjRange(pPrev);
pFans1 = Vec_IntEntryP( vBits, Wlc_ObjCopy(p, iFanin) );
Vec_IntPush( vTemp0, b < nRange1 ? pFans1[b] : (pPrev->Signed? pFans1[nRange1-1] : 0) );
}
if ( k > 0 )
{
nRange1 = Wlc_ObjRange( Wlc_NtkObj(p, iFanin) );
pFans1 = Vec_IntEntryP( vBits, Wlc_ObjCopy(p, iFanin) );
Vec_IntPush( vTemp0, b < nRange1 ? pFans1[b] : (fSigned? pFans1[nRange1-1] : 0) );
}
Vec_IntPush( vRes, Wlc_NtkMuxTree_rec(pNew, pFans0, nRange0, vTemp0, 0) );
}
}