Commit 1e69e7e7 by Alan Mishchenko

Adding command &reshape.

parent a3632560
...@@ -5095,6 +5095,14 @@ SOURCE=.\src\aig\gia\giaQbf.c ...@@ -5095,6 +5095,14 @@ SOURCE=.\src\aig\gia\giaQbf.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\src\aig\gia\giaReshape1.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaReshape2.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaResub.c SOURCE=.\src\aig\gia\giaResub.c
# End Source File # End Source File
# Begin Source File # Begin Source File
......
...@@ -81,8 +81,6 @@ Gia_Man_t * Gia_ManStart( int nObjsMax ) ...@@ -81,8 +81,6 @@ Gia_Man_t * Gia_ManStart( int nObjsMax )
***********************************************************************/ ***********************************************************************/
void Gia_ManStop( Gia_Man_t * p ) void Gia_ManStop( Gia_Man_t * p )
{ {
extern void Gia_DatFree( Gia_Dat_t * p );
Gia_DatFree( p->pUData );
if ( p->vSeqModelVec ) if ( p->vSeqModelVec )
Vec_PtrFreeFree( p->vSeqModelVec ); Vec_PtrFreeFree( p->vSeqModelVec );
Gia_ManStaticFanoutStop( p ); Gia_ManStaticFanoutStop( p );
......
...@@ -60,6 +60,8 @@ SRC += src/aig/gia/giaAig.c \ ...@@ -60,6 +60,8 @@ SRC += src/aig/gia/giaAig.c \
src/aig/gia/giaPat.c \ src/aig/gia/giaPat.c \
src/aig/gia/giaPf.c \ src/aig/gia/giaPf.c \
src/aig/gia/giaQbf.c \ src/aig/gia/giaQbf.c \
src/aig/gia/giaReshape1.c \
src/aig/gia/giaReshape2.c \
src/aig/gia/giaResub.c \ src/aig/gia/giaResub.c \
src/aig/gia/giaResub2.c \ src/aig/gia/giaResub2.c \
src/aig/gia/giaResub3.c \ src/aig/gia/giaResub3.c \
......
...@@ -445,6 +445,7 @@ static int Abc_CommandAbc9Extract ( Abc_Frame_t * pAbc, int argc, cha ...@@ -445,6 +445,7 @@ static int Abc_CommandAbc9Extract ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandAbc9Balance ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Balance ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9BalanceLut ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9BalanceLut ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Resub ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Resub ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Reshape ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Syn2 ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Syn2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Syn3 ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Syn3 ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Syn4 ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Syn4 ( Abc_Frame_t * pAbc, int argc, char ** argv );
...@@ -1186,6 +1187,7 @@ void Abc_Init( Abc_Frame_t * pAbc ) ...@@ -1186,6 +1187,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "ABC9", "&b", Abc_CommandAbc9Balance, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&b", Abc_CommandAbc9Balance, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&blut", Abc_CommandAbc9BalanceLut, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&blut", Abc_CommandAbc9BalanceLut, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&resub", Abc_CommandAbc9Resub, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&resub", Abc_CommandAbc9Resub, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&reshape", Abc_CommandAbc9Reshape, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&syn2", Abc_CommandAbc9Syn2, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&syn2", Abc_CommandAbc9Syn2, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&syn3", Abc_CommandAbc9Syn3, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&syn3", Abc_CommandAbc9Syn3, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&syn4", Abc_CommandAbc9Syn4, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&syn4", Abc_CommandAbc9Syn4, 0 );
...@@ -35494,6 +35496,67 @@ usage: ...@@ -35494,6 +35496,67 @@ usage:
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
int Abc_CommandAbc9Reshape( Abc_Frame_t * pAbc, int argc, char ** argv )
{
extern Gia_Man_t * Gia_ManReshape1( Gia_Man_t * pGia, int fVerbose, int fVeryVerbose );
extern Gia_Man_t * Gia_ManReshape2( Gia_Man_t * pGia, int fVerbose, int fVeryVerbose );
Gia_Man_t * pTemp;
int fUseReshape1 = 0;
int c, fVerbose = 0;
int fVeryVerbose = 0;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "avwh" ) ) != EOF )
{
switch ( c )
{
case 'a':
fUseReshape1 ^= 1;
break;
case 'v':
fVerbose ^= 1;
break;
case 'w':
fVeryVerbose ^= 1;
break;
case 'h':
goto usage;
default:
goto usage;
}
}
if ( pAbc->pGia == NULL )
{
Abc_Print( -1, "Abc_CommandAbc9Resub(): There is no AIG.\n" );
return 1;
}
if ( fUseReshape1 )
pTemp = Gia_ManReshape1( pAbc->pGia, fVerbose, fVeryVerbose );
else
pTemp = Gia_ManReshape2( pAbc->pGia, fVerbose, fVeryVerbose );
Abc_FrameUpdateGia( pAbc, pTemp );
return 0;
usage:
Abc_Print( -2, "usage: &reshape [-avwh]\n" );
Abc_Print( -2, "\t performs AIG resubstitution\n" );
Abc_Print( -2, "\t-a : toggles selecting the algorithm [default = %s]\n", fUseReshape1? "yes": "no" );
Abc_Print( -2, "\t-v : toggles printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-w : toggles printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Abc_CommandAbc9Syn2( Abc_Frame_t * pAbc, int argc, char ** argv ) int Abc_CommandAbc9Syn2( Abc_Frame_t * pAbc, int argc, char ** argv )
{ {
Gia_Man_t * pTemp; Gia_Man_t * pTemp;
...@@ -1259,27 +1259,6 @@ void Acb_Ntk4DumpWeights( char * pFileNameIn, Vec_Ptr_t * vObjNames, char * pFil ...@@ -1259,27 +1259,6 @@ void Acb_Ntk4DumpWeights( char * pFileNameIn, Vec_Ptr_t * vObjNames, char * pFil
Vec_IntFree( vObjs ); Vec_IntFree( vObjs );
} }
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Acb_NtkRunSim( char * pFileName[4], int nTimeout, int nWords, int nBeam, int LevL, int LevU, int fOrder, int fFancy, int fUseBuf, int fRandom, int fUseWeights, int fInputs, int fSkipMffc, int fVerbose, int fVeryVerbose )
{
extern int Gia_Sim4Try( char * pFileName0, char * pFileName1, char * pFileName2, int nTimeout, int nWords, int nBeam, int LevL, int LevU, int fOrder, int fFancy, int fUseBuf, int fSkipMffc, int fVerbose );
extern void Acb_NtkRunEco( char * pFileNames[4], int nTimeout, int fCheck, int fRandom, int fInputs, int fUnitW, int fVerbose, int fVeryVerbose );
char * pFileNames[4] = { pFileName[2], pFileName[1], fUseWeights ? (char *)"weights.txt" : NULL, pFileName[2] };
if ( Gia_Sim4Try( pFileName[0], pFileName[1], pFileName[2], nTimeout, nWords, nBeam, LevL, LevU, fOrder, fFancy, fUseBuf, fSkipMffc, fVerbose ) )
Acb_NtkRunEco( pFileNames, nTimeout, 1, fRandom, fInputs, 0, fVerbose, fVeryVerbose );
}
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/// END OF FILE /// /// END OF FILE ///
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
......
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