Commit a68ec38d by Alan Mishchenko

Changes and improvements to different packages.

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