Commit 372a348c by Alan Mishchenko

Detecting full-adder chains and putting them into white boxes.

parent 153e8887
...@@ -3815,6 +3815,10 @@ SOURCE=.\src\aig\gia\giaEra2.c ...@@ -3815,6 +3815,10 @@ SOURCE=.\src\aig\gia\giaEra2.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\src\aig\gia\giaFadds.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaFalse.c SOURCE=.\src\aig\gia\giaFalse.c
# End Source File # End Source File
# Begin Source File # Begin Source File
......
...@@ -719,6 +719,13 @@ static inline int Gia_ManAppendMux( Gia_Man_t * p, int iCtrl, int iData1, int iD ...@@ -719,6 +719,13 @@ static inline int Gia_ManAppendMux( Gia_Man_t * p, int iCtrl, int iData1, int iD
int iTemp1 = Gia_ManAppendAnd( p, iCtrl, iData1 ); int iTemp1 = Gia_ManAppendAnd( p, iCtrl, iData1 );
return Abc_LitNotCond( Gia_ManAppendAnd( p, Abc_LitNot(iTemp0), Abc_LitNot(iTemp1) ), 1 ); return Abc_LitNotCond( Gia_ManAppendAnd( p, Abc_LitNot(iTemp0), Abc_LitNot(iTemp1) ), 1 );
} }
static inline int Gia_ManAppendMaj( Gia_Man_t * p, int iData0, int iData1, int iData2 )
{
int iTemp0 = Gia_ManAppendOr( p, iData1, iData2 );
int iTemp1 = Gia_ManAppendAnd( p, iData0, iTemp0 );
int iTemp2 = Gia_ManAppendAnd( p, iData1, iData2 );
return Gia_ManAppendOr( p, iTemp1, iTemp2 );
}
static inline int Gia_ManAppendXor( Gia_Man_t * p, int iLit0, int iLit1 ) static inline int Gia_ManAppendXor( Gia_Man_t * p, int iLit0, int iLit1 )
{ {
return Gia_ManAppendMux( p, iLit0, Abc_LitNot(iLit1), iLit1 ); return Gia_ManAppendMux( p, iLit0, Abc_LitNot(iLit1), iLit1 );
......
...@@ -21,6 +21,7 @@ SRC += src/aig/gia/giaAig.c \ ...@@ -21,6 +21,7 @@ SRC += src/aig/gia/giaAig.c \
src/aig/gia/giaEquiv.c \ src/aig/gia/giaEquiv.c \
src/aig/gia/giaEra.c \ src/aig/gia/giaEra.c \
src/aig/gia/giaEra2.c \ src/aig/gia/giaEra2.c \
src/aig/gia/giaFadds.c \
src/aig/gia/giaFalse.c \ src/aig/gia/giaFalse.c \
src/aig/gia/giaFanout.c \ src/aig/gia/giaFanout.c \
src/aig/gia/giaForce.c \ src/aig/gia/giaForce.c \
......
...@@ -439,6 +439,7 @@ static int Abc_CommandAbc9Maxi ( Abc_Frame_t * pAbc, int argc, cha ...@@ -439,6 +439,7 @@ static int Abc_CommandAbc9Maxi ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandAbc9Bmci ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Bmci ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9PoXsim ( Abc_Frame_t * pAbc, int argc, char ** argv ); 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_CommandAbc9Demiter ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Fadds ( Abc_Frame_t * pAbc, int argc, char ** argv );
//static int Abc_CommandAbc9PoPart2 ( 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 ); //static int Abc_CommandAbc9CexCut ( Abc_Frame_t * pAbc, int argc, char ** argv );
//static int Abc_CommandAbc9CexMerge ( Abc_Frame_t * pAbc, int argc, char ** argv ); //static int Abc_CommandAbc9CexMerge ( Abc_Frame_t * pAbc, int argc, char ** argv );
...@@ -1040,6 +1041,7 @@ void Abc_Init( Abc_Frame_t * pAbc ) ...@@ -1040,6 +1041,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "ABC9", "&bmci", Abc_CommandAbc9Bmci, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&bmci", Abc_CommandAbc9Bmci, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&poxsim", Abc_CommandAbc9PoXsim, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&poxsim", Abc_CommandAbc9PoXsim, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&demiter", Abc_CommandAbc9Demiter, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&demiter", Abc_CommandAbc9Demiter, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&fadds", Abc_CommandAbc9Fadds, 0 );
// Cmd_CommandAdd( pAbc, "ABC9", "&popart2", Abc_CommandAbc9PoPart2, 0 ); // Cmd_CommandAdd( pAbc, "ABC9", "&popart2", Abc_CommandAbc9PoPart2, 0 );
// Cmd_CommandAdd( pAbc, "ABC9", "&cexcut", Abc_CommandAbc9CexCut, 0 ); // Cmd_CommandAdd( pAbc, "ABC9", "&cexcut", Abc_CommandAbc9CexCut, 0 );
// Cmd_CommandAdd( pAbc, "ABC9", "&cexmerge", Abc_CommandAbc9CexMerge, 0 ); // Cmd_CommandAdd( pAbc, "ABC9", "&cexmerge", Abc_CommandAbc9CexMerge, 0 );
...@@ -36557,6 +36559,64 @@ usage: ...@@ -36557,6 +36559,64 @@ usage:
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
int Abc_CommandAbc9Fadds( Abc_Frame_t * pAbc, int argc, char ** argv )
{
extern Gia_Man_t * Gia_ManDupWithFaddBoxes( Gia_Man_t * p, int nFaddMin, int fVerbose );
Gia_Man_t * pTemp;
int c, nFaddMin = 3, fVerbose = 0;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF )
{
switch ( c )
{
case 'N':
if ( globalUtilOptind >= argc )
{
Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
nFaddMin = atoi(argv[globalUtilOptind]);
globalUtilOptind++;
if ( nFaddMin < 0 )
goto usage;
break;
case 'v':
fVerbose ^= 1;
break;
case 'h':
goto usage;
default:
goto usage;
}
}
if ( pAbc->pGia == NULL )
{
Abc_Print( -1, "Abc_CommandAbc9Fadds(): There is no AIG.\n" );
return 0;
}
pTemp = Gia_ManDupWithFaddBoxes( pAbc->pGia, nFaddMin, fVerbose );
Abc_FrameUpdateGia( pAbc, pTemp );
return 0;
usage:
Abc_Print( -2, "usage: &fadds [-N num] [-vh]\n" );
Abc_Print( -2, "\t detects full-adder chains and puts them into white boxes\n" );
Abc_Print( -2, "\t-N num : the minimum length of full-adder chain to box [default = %d]\n", nFaddMin );
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 []
SeeAlso []
***********************************************************************/
int Abc_CommandAbc9CexCut( Abc_Frame_t * pAbc, int argc, char ** argv ) int Abc_CommandAbc9CexCut( Abc_Frame_t * pAbc, int argc, char ** argv )
{ {
return -1; return -1;
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