Commit 6e4ef763 by Alan Mishchenko

Bug with in signed MUX.

parent 17c32289
...@@ -541,18 +541,21 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Vec_Int_t * vBoxIds ) ...@@ -541,18 +541,21 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Vec_Int_t * vBoxIds )
} }
else if ( pObj->Type == WLC_OBJ_MUX ) else if ( pObj->Type == WLC_OBJ_MUX )
{ {
int fSigned = 1;
assert( nRange0 >= 1 && Wlc_ObjFaninNum(pObj) >= 3 );
assert( 1 + (1 << nRange0) == Wlc_ObjFaninNum(pObj) ); 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++ ) for ( b = 0; b < nRange; b++ )
{ {
Vec_IntClear( vTemp0 ); Vec_IntClear( vTemp0 );
Wlc_ObjForEachFanin( pObj, iFanin, k ) Wlc_ObjForEachFanin( pObj, iFanin, k )
if ( k > 0 )
{ {
if ( !k ) continue; nRange1 = Wlc_ObjRange( Wlc_NtkObj(p, iFanin) );
//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) ); pFans1 = Vec_IntEntryP( vBits, Wlc_ObjCopy(p, iFanin) );
Vec_IntPush( vTemp0, b < nRange1 ? pFans1[b] : (pPrev->Signed? pFans1[nRange1-1] : 0) ); Vec_IntPush( vTemp0, b < nRange1 ? pFans1[b] : (fSigned? pFans1[nRange1-1] : 0) );
} }
Vec_IntPush( vRes, Wlc_NtkMuxTree_rec(pNew, pFans0, nRange0, vTemp0, 0) ); Vec_IntPush( vRes, Wlc_NtkMuxTree_rec(pNew, pFans0, nRange0, vTemp0, 0) );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment