Commit a68ec38d by Alan Mishchenko

Changes and improvements to different packages.

parent 2edf2a97
......@@ -3895,6 +3895,10 @@ SOURCE=.\src\aig\gia\giaStg.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaStr.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaSupMin.c
# End Source File
# Begin Source File
......
......@@ -609,11 +609,20 @@ static inline int Gia_ManAppendXorReal( Gia_Man_t * p, int iLit0, int iLit1 )
assert( Abc_Lit2Var(iLit0) != Abc_Lit2Var(iLit1) );
assert( !Abc_LitIsCompl(iLit0) );
assert( !Abc_LitIsCompl(iLit1) );
assert( Abc_Lit2Var(iLit0) > Abc_Lit2Var(iLit1) );
pObj->iDiff0 = Gia_ObjId(p, pObj) - Abc_Lit2Var(iLit0);
pObj->fCompl0 = Abc_LitIsCompl(iLit0);
pObj->iDiff1 = Gia_ObjId(p, pObj) - Abc_Lit2Var(iLit1);
pObj->fCompl1 = Abc_LitIsCompl(iLit1);
if ( Abc_Lit2Var(iLit0) > Abc_Lit2Var(iLit1) )
{
pObj->iDiff0 = Gia_ObjId(p, pObj) - Abc_Lit2Var(iLit0);
pObj->fCompl0 = Abc_LitIsCompl(iLit0);
pObj->iDiff1 = Gia_ObjId(p, pObj) - Abc_Lit2Var(iLit1);
pObj->fCompl1 = Abc_LitIsCompl(iLit1);
}
else
{
pObj->iDiff1 = Gia_ObjId(p, pObj) - Abc_Lit2Var(iLit0);
pObj->fCompl1 = Abc_LitIsCompl(iLit0);
pObj->iDiff0 = Gia_ObjId(p, pObj) - Abc_Lit2Var(iLit1);
pObj->fCompl0 = Abc_LitIsCompl(iLit1);
}
p->nXors++;
return Gia_ObjId( p, pObj ) << 1;
}
......@@ -627,13 +636,23 @@ static inline int Gia_ManAppendMuxReal( Gia_Man_t * p, int iLitC, int iLit1, int
assert( Abc_Lit2Var(iLit0) != Abc_Lit2Var(iLit1) );
assert( Abc_Lit2Var(iLitC) != Abc_Lit2Var(iLit0) );
assert( Abc_Lit2Var(iLitC) != Abc_Lit2Var(iLit1) );
assert( Abc_Lit2Var(iLit0) < Abc_Lit2Var(iLit1) );
assert( !Abc_LitIsCompl(iLit1) );
pObj->iDiff0 = Gia_ObjId(p, pObj) - Abc_Lit2Var(iLit0);
pObj->fCompl0 = Abc_LitIsCompl(iLit0);
pObj->iDiff1 = Gia_ObjId(p, pObj) - Abc_Lit2Var(iLit1);
pObj->fCompl1 = Abc_LitIsCompl(iLit1);
p->pMuxes[Gia_ObjId(p, pObj)] = iLitC;
assert( !p->pHTable || !Abc_LitIsCompl(iLit1) );
if ( Abc_Lit2Var(iLit0) < Abc_Lit2Var(iLit1) )
{
pObj->iDiff0 = Gia_ObjId(p, pObj) - Abc_Lit2Var(iLit0);
pObj->fCompl0 = Abc_LitIsCompl(iLit0);
pObj->iDiff1 = Gia_ObjId(p, pObj) - Abc_Lit2Var(iLit1);
pObj->fCompl1 = Abc_LitIsCompl(iLit1);
p->pMuxes[Gia_ObjId(p, pObj)] = iLitC;
}
else
{
pObj->iDiff1 = Gia_ObjId(p, pObj) - Abc_Lit2Var(iLit0);
pObj->fCompl1 = Abc_LitIsCompl(iLit0);
pObj->iDiff0 = Gia_ObjId(p, pObj) - Abc_Lit2Var(iLit1);
pObj->fCompl0 = Abc_LitIsCompl(iLit1);
p->pMuxes[Gia_ObjId(p, pObj)] = Abc_LitNot(iLitC);
}
p->nMuxes++;
return Gia_ObjId( p, pObj ) << 1;
}
......@@ -916,13 +935,15 @@ static inline int Gia_ObjLutFanin( Gia_Man_t * p, int Id, int i ) { re
for ( i = 0; (i < Vec_IntSize(vVec)) && ((pObj) = Gia_ManObj(p, Abc_Lit2Var(Vec_IntEntry(vVec,i)))) && (((fCompl) = Abc_LitIsCompl(Vec_IntEntry(vVec,i))),1); i++ )
#define Gia_ManForEachObjReverse( p, pObj, i ) \
for ( i = p->nObjs - 1; (i >= 0) && ((pObj) = Gia_ManObj(p, i)); i-- )
#define Gia_ManForEachObjReverse1( p, pObj, i ) \
#define Gia_ManForEachObjReverse1( p, pObj, i ) \
for ( i = p->nObjs - 1; (i > 0) && ((pObj) = Gia_ManObj(p, i)); i-- )
#define Gia_ManForEachAnd( p, pObj, i ) \
for ( i = 0; (i < p->nObjs) && ((pObj) = Gia_ManObj(p, i)); i++ ) if ( !Gia_ObjIsAnd(pObj) ) {} else
#define Gia_ManForEachAndId( p, i ) \
for ( i = 0; (i < p->nObjs); i++ ) if ( !Gia_ObjIsAnd(Gia_ManObj(p, i)) ) {} else
#define Gia_ManForEachCand( p, pObj, i ) \
#define Gia_ManForEachMuxId( p, i ) \
for ( i = 0; (i < p->nObjs); i++ ) if ( !Gia_ObjIsMuxId(p, i) ) {} else
#define Gia_ManForEachCand( p, pObj, i ) \
for ( i = 0; (i < p->nObjs) && ((pObj) = Gia_ManObj(p, i)); i++ ) if ( !Gia_ObjIsCand(pObj) ) {} else
#define Gia_ManForEachAndReverse( p, pObj, i ) \
for ( i = p->nObjs - 1; (i > 0) && ((pObj) = Gia_ManObj(p, i)); i-- ) if ( !Gia_ObjIsAnd(pObj) ) {} else
......
......@@ -35937,6 +35937,7 @@ int Abc_CommandAbc9Test( Abc_Frame_t * pAbc, int argc, char ** argv )
// extern void Gia_ParTest( Gia_Man_t * p, int nWords, int nProcs );
// extern void Gia_ManTisTest( Gia_Man_t * pInit );
extern void Gia_Iso3Test( Gia_Man_t * p );
// extern Gia_Man_t * Str_NormalizeTest( Gia_Man_t * p );
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "WPFsvh" ) ) != EOF )
......@@ -36041,6 +36042,8 @@ int Abc_CommandAbc9Test( Abc_Frame_t * pAbc, int argc, char ** argv )
// Gia_ManCheckFalseTest( pAbc->pGia, nFrames );
// Gia_ParTest( pAbc->pGia, nWords, nProcs );
Gia_Iso3Test( pAbc->pGia );
// pTemp = Str_NormalizeTest( pAbc->pGia );
// Abc_FrameUpdateGia( pAbc, pTemp );
// printf( "\nThis command is currently disabled.\n\n" );
return 0;
......@@ -42,6 +42,9 @@ typedef struct Abc_Nam_t_ Abc_Nam_t;
/// MACRO DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
#define Abc_NamManForEachObj( p, pStr, i ) \
for ( i = 1; (i < Abc_NamObjNumMax(p)) && ((pStr) = Abc_NamStr(p, i)); i++ )
////////////////////////////////////////////////////////////////////////
/// FUNCTION DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
......
......@@ -1715,16 +1715,27 @@ static inline void Vec_IntSelectSort( int * pArray, int nSize )
***********************************************************************/
static inline void Vec_IntSelectSortCost( int * pArray, int nSize, Vec_Int_t * vCosts )
{
int temp, i, j, best_i;
int i, j, best_i;
for ( i = 0; i < nSize-1; i++ )
{
best_i = i;
for ( j = i+1; j < nSize; j++ )
if ( Vec_IntEntry(vCosts, pArray[j]) < Vec_IntEntry(vCosts, pArray[best_i]) )
best_i = j;
temp = pArray[i];
pArray[i] = pArray[best_i];
pArray[best_i] = temp;
ABC_SWAP( int, pArray[i], pArray[best_i] );
}
}
static inline void Vec_IntSelectSortCost2( int * pArray, int nSize, int * pCosts )
{
int i, j, best_i;
for ( i = 0; i < nSize-1; i++ )
{
best_i = i;
for ( j = i+1; j < nSize; j++ )
if ( pCosts[j] < pCosts[best_i] )
best_i = j;
ABC_SWAP( int, pArray[i], pArray[best_i] );
ABC_SWAP( int, pCosts[i], pCosts[best_i] );
}
}
......
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