Commit d0a0cf63 by Alan Mishchenko

Command &esop to convert AIG into ESOP.

parent 8b07237b
......@@ -4195,6 +4195,10 @@ SOURCE=.\src\aig\gia\giaEra2.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaEsop.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaFadds.c
# End Source File
# Begin Source File
......
......@@ -22,6 +22,7 @@ SRC += src/aig/gia/giaAig.c \
src/aig/gia/giaEquiv.c \
src/aig/gia/giaEra.c \
src/aig/gia/giaEra2.c \
src/aig/gia/giaEsop.c \
src/aig/gia/giaFadds.c \
src/aig/gia/giaFalse.c \
src/aig/gia/giaFanout.c \
......
......@@ -464,6 +464,7 @@ static int Abc_CommandAbc9Bmci ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandAbc9PoXsim ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Demiter ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Fadds ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Esop ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Mfs ( Abc_Frame_t * pAbc, int argc, char ** argv );
//static int Abc_CommandAbc9PoPart2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
//static int Abc_CommandAbc9CexCut ( Abc_Frame_t * pAbc, int argc, char ** argv );
......@@ -1090,6 +1091,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "ABC9", "&poxsim", Abc_CommandAbc9PoXsim, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&demiter", Abc_CommandAbc9Demiter, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&fadds", Abc_CommandAbc9Fadds, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&esop", Abc_CommandAbc9Esop, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&mfs", Abc_CommandAbc9Mfs, 0 );
// Cmd_CommandAdd( pAbc, "ABC9", "&popart2", Abc_CommandAbc9PoPart2, 0 );
// Cmd_CommandAdd( pAbc, "ABC9", "&cexcut", Abc_CommandAbc9CexCut, 0 );
......@@ -39159,6 +39161,53 @@ usage:
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Abc_CommandAbc9Esop( Abc_Frame_t * pAbc, int argc, char ** argv )
{
extern Gia_Man_t * Eso_ManCompute( Gia_Man_t * pGia, int fVerbose );
Gia_Man_t * pTemp;
int c, fVerbose = 0;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
{
switch ( c )
{
case 'v':
fVerbose ^= 1;
break;
case 'h':
goto usage;
default:
goto usage;
}
}
if ( pAbc->pGia == NULL )
{
Abc_Print( -1, "Abc_CommandAbc9Esop(): There is no AIG.\n" );
return 0;
}
pTemp = Eso_ManCompute( pAbc->pGia, fVerbose );
Abc_FrameUpdateGia( pAbc, pTemp );
return 0;
usage:
Abc_Print( -2, "usage: &esop [-vh]\n" );
Abc_Print( -2, "\t derives Exclusive Sum of Products from AIG\n" );
Abc_Print( -2, "\t-v : toggles printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
......@@ -79,6 +79,8 @@ struct Hsh_VecMan_t_
Vec_Int_t * vData; // data storage
Vec_Int_t * vMap; // mapping entries into data;
Vec_Int_t vTemp; // temporary array
Vec_Int_t vTemp1; // temporary array
Vec_Int_t vTemp2; // temporary array
};
////////////////////////////////////////////////////////////////////////
......@@ -305,6 +307,10 @@ static inline void Hsh_VecManStop( Hsh_VecMan_t * p )
Vec_IntFree( p->vMap );
ABC_FREE( p );
}
static inline int * Hsh_VecReadArray( Hsh_VecMan_t * p, int i )
{
return (int*)Hsh_VecObj(p, i) + 2;
}
static inline Vec_Int_t * Hsh_VecReadEntry( Hsh_VecMan_t * p, int i )
{
Hsh_VecObj_t * pObj = Hsh_VecObj( p, i );
......@@ -312,6 +318,20 @@ static inline Vec_Int_t * Hsh_VecReadEntry( Hsh_VecMan_t * p, int i )
p->vTemp.pArray = (int*)pObj + 2;
return &p->vTemp;
}
static inline Vec_Int_t * Hsh_VecReadEntry1( Hsh_VecMan_t * p, int i )
{
Hsh_VecObj_t * pObj = Hsh_VecObj( p, i );
p->vTemp1.nSize = p->vTemp1.nCap = pObj->nSize;
p->vTemp1.pArray = (int*)pObj + 2;
return &p->vTemp1;
}
static inline Vec_Int_t * Hsh_VecReadEntry2( Hsh_VecMan_t * p, int i )
{
Hsh_VecObj_t * pObj = Hsh_VecObj( p, i );
p->vTemp2.nSize = p->vTemp2.nCap = pObj->nSize;
p->vTemp2.pArray = (int*)pObj + 2;
return &p->vTemp2;
}
static inline int Hsh_VecSize( Hsh_VecMan_t * p )
{
return Vec_IntSize(p->vMap);
......
......@@ -770,6 +770,26 @@ static inline void Vec_PtrRemove( Vec_Ptr_t * p, void * Entry )
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static inline void Vec_PtrDrop( Vec_Ptr_t * p, int i )
{
int k;
assert( i >= 0 && i < Vec_PtrSize(p) );
p->nSize--;
for ( k = i; k < p->nSize; k++ )
p->pArray[k] = p->pArray[k+1];
}
/**Function*************************************************************
Synopsis [Interts entry at the index iHere. Shifts other entries.]
Description []
......
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