Commit c9e520e2 by Alan Mishchenko

Expriments with functions.

parent d05fe039
...@@ -2955,6 +2955,10 @@ SOURCE=.\src\opt\dau\dauNpn.c ...@@ -2955,6 +2955,10 @@ SOURCE=.\src\opt\dau\dauNpn.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\src\opt\dau\dauNpn2.c
# End Source File
# Begin Source File
SOURCE=.\src\opt\dau\dauTree.c SOURCE=.\src\opt\dau\dauTree.c
# End Source File # End Source File
# End Group # End Group
......
...@@ -13214,8 +13214,8 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -13214,8 +13214,8 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
} }
*/ */
{ {
// extern void Abc_EnumerateFuncs( int nDecMax, int nDivMax, int fVerbose ); extern void Abc_EnumerateFuncs( int nDecMax, int nDivMax, int fVerbose );
// Abc_EnumerateFuncs( nDecMax, nDivMax, fVerbose ); Abc_EnumerateFuncs( 4, 7, 0 );
} }
/* /*
if ( fNewAlgo ) if ( fNewAlgo )
...@@ -13266,7 +13266,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -13266,7 +13266,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
// Cba_PrsReadBlifTest(); // Cba_PrsReadBlifTest();
} }
// Abc_NtkComputePaths( Abc_FrameReadNtk(pAbc) ); // Abc_NtkComputePaths( Abc_FrameReadNtk(pAbc) );
Dau_NetworkEnumTest(); //Dau_NetworkEnumTest();
return 0; return 0;
usage: usage:
Abc_Print( -2, "usage: test [-CKDNM] [-aovwh] <file_name>\n" ); Abc_Print( -2, "usage: test [-CKDNM] [-aovwh] <file_name>\n" );
...@@ -23012,10 +23012,11 @@ usage: ...@@ -23012,10 +23012,11 @@ usage:
***********************************************************************/ ***********************************************************************/
int Abc_CommandFunEnum( Abc_Frame_t * pAbc, int argc, char ** argv ) int Abc_CommandFunEnum( Abc_Frame_t * pAbc, int argc, char ** argv )
{ {
extern void Dtt_EnumerateLf( int nVars, int nNodeMax, int fVerbose );
extern void Dau_FunctionEnum( int nInputs, int nVars, int nNodeMax, int fUseTwo, int fReduce, int fVerbose ); extern void Dau_FunctionEnum( int nInputs, int nVars, int nNodeMax, int fUseTwo, int fReduce, int fVerbose );
int c, nInputs = 4, nVars = 4, nNodeMax = 32, fUseTwo = 0, fReduce = 0, fVerbose = 0; int c, nInputs = 4, nVars = 4, nNodeMax = 32, fUseTwo = 0, fReduce = 0, fSimple = 0, fVerbose = 0;
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "SIMtrvh" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "SIMtrlvh" ) ) != EOF )
{ {
switch ( c ) switch ( c )
{ {
...@@ -23058,6 +23059,9 @@ int Abc_CommandFunEnum( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -23058,6 +23059,9 @@ int Abc_CommandFunEnum( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'r': case 'r':
fReduce ^= 1; fReduce ^= 1;
break; break;
case 'l':
fSimple ^= 1;
break;
case 'v': case 'v':
fVerbose ^= 1; fVerbose ^= 1;
break; break;
...@@ -23068,28 +23072,40 @@ int Abc_CommandFunEnum( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -23068,28 +23072,40 @@ int Abc_CommandFunEnum( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage; goto usage;
} }
} }
if ( nVars < 2 || nVars > 6 ) if ( fSimple )
{ {
Abc_Print( -1, "The number of inputs should be 2 <= I <= 6.\n" ); if ( nVars < 4 || nVars > 5 )
goto usage; {
Abc_Print( -1, "The number of inputs should be 4 <= I <= 5.\n" );
goto usage;
}
Dtt_EnumerateLf( nVars, nNodeMax, fVerbose );
} }
if ( nInputs < nVars || nInputs > 6 ) else
{ {
Abc_Print( -1, "The intermediate support size should be I <= S <= 6.\n" ); if ( nVars < 2 || nVars > 6 )
goto usage; {
Abc_Print( -1, "The number of inputs should be 2 <= I <= 6.\n" );
goto usage;
}
if ( nInputs < nVars || nInputs > 6 )
{
Abc_Print( -1, "The intermediate support size should be I <= S <= 6.\n" );
goto usage;
}
Dau_FunctionEnum( nInputs, nVars, nNodeMax, fUseTwo, fReduce, fVerbose );
} }
Dau_FunctionEnum( nInputs, nVars, nNodeMax, fUseTwo, fReduce, fVerbose );
return 0; return 0;
usage: usage:
Abc_Print( -2, "usage: funenum [-SIM num] [-trvh]\n" ); Abc_Print( -2, "usage: funenum [-SIM num] [-trlvh]\n" );
Abc_Print( -2, "\t enumerates minimum 2-input-gate implementations\n" ); Abc_Print( -2, "\t enumerates minimum 2-input-gate implementations\n" );
Abc_Print( -2, "\t-S num : the maximum intermediate support size [default = %d]\n", nInputs ); Abc_Print( -2, "\t-S num : the maximum intermediate support size [default = %d]\n", nInputs );
Abc_Print( -2, "\t-I num : the number of inputs of Boolean functions [default = %d]\n", nVars ); Abc_Print( -2, "\t-I num : the number of inputs of Boolean functions [default = %d]\n", nVars );
Abc_Print( -2, "\t-M num : the maximum number of 2-input gates [default = %d]\n", nNodeMax ); Abc_Print( -2, "\t-M num : the maximum number of 2-input gates [default = %d]\n", nNodeMax );
Abc_Print( -2, "\t-t : toggle adding combination of two gates [default = %s]\n", fUseTwo? "yes": "no" ); Abc_Print( -2, "\t-t : toggle adding combination of two gates [default = %s]\n", fUseTwo? "yes": "no" );
Abc_Print( -2, "\t-r : toggle reducing the last level [default = %s]\n", fReduce? "yes": "no" ); Abc_Print( -2, "\t-r : toggle reducing the last level [default = %s]\n", fReduce? "yes": "no" );
Abc_Print( -2, "\t-l : toggle generating L(f) rather than C(f) [default = %s]\n", fSimple? "yes": "no" );
Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" ); Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n"); Abc_Print( -2, "\t-h : print the command usage\n");
return 1; return 1;
...@@ -347,7 +347,7 @@ void Wlc_NtkCheckIntegrity( void * pData ) ...@@ -347,7 +347,7 @@ void Wlc_NtkCheckIntegrity( void * pData )
int Type = Ndr_ObjReadBody( p, Obj, NDR_OPERTYPE ); int Type = Ndr_ObjReadBody( p, Obj, NDR_OPERTYPE );
int i, * pArray, nArray = Ndr_ObjReadArray( p, Obj, NDR_INPUT, &pArray ); int i, * pArray, nArray = Ndr_ObjReadArray( p, Obj, NDR_INPUT, &pArray );
for ( i = 0; i < nArray; i++ ) for ( i = 0; i < nArray; i++ )
if ( Vec_IntGetEntry(vMap, pArray[i]) == 0 && !(Type == ABC_OPER_DFFRSE && i == 7) ) if ( Vec_IntGetEntry(vMap, pArray[i]) == 0 && !(Type == ABC_OPER_DFFRSE && (i >= 5 || i <= 7)) )
printf( "Input name %d appearing as fanin %d of obj %d is not used as output name in any object.\n", pArray[i], i, Obj ); printf( "Input name %d appearing as fanin %d of obj %d is not used as output name in any object.\n", pArray[i], i, Obj );
} }
Vec_IntFree( vMap ); Vec_IntFree( vMap );
......
...@@ -620,8 +620,8 @@ int Dau_InsertFunction( Abc_TtHieMan_t * pMan, word * pCur, int nNodes, int nInp ...@@ -620,8 +620,8 @@ int Dau_InsertFunction( Abc_TtHieMan_t * pMan, word * pCur, int nNodes, int nInp
int DumpDelta = 1000000; int DumpDelta = 1000000;
char Perm[16] = {0}; char Perm[16] = {0};
int nVarsNew = Abc_TtMinBase( pCur, NULL, nVars, nInputs ); int nVarsNew = Abc_TtMinBase( pCur, NULL, nVars, nInputs );
unsigned Phase = Abc_TtCanonicizeHie( pMan, pCur, nVarsNew, Perm, 1 ); //unsigned Phase = Abc_TtCanonicizeHie( pMan, pCur, nVarsNew, Perm, 1 );
//unsigned Phase = Dau_RunNpn( pMan, pCur, nVarsNew, Perm ); unsigned Phase = Dau_RunNpn( pMan, pCur, nInputs, Perm );
int nEntries = Vec_MemEntryNum(vTtMem); int nEntries = Vec_MemEntryNum(vTtMem);
int Entry = Vec_MemHashInsert( vTtMem, pCur ); int Entry = Vec_MemHashInsert( vTtMem, pCur );
if ( nEntries == Vec_MemEntryNum(vTtMem) ) // found in the table - not new if ( nEntries == Vec_MemEntryNum(vTtMem) ) // found in the table - not new
......
...@@ -8,4 +8,5 @@ SRC += src/opt/dau/dauCanon.c \ ...@@ -8,4 +8,5 @@ SRC += src/opt/dau/dauCanon.c \
src/opt/dau/dauMerge.c \ src/opt/dau/dauMerge.c \
src/opt/dau/dauNonDsd.c \ src/opt/dau/dauNonDsd.c \
src/opt/dau/dauNpn.c \ src/opt/dau/dauNpn.c \
src/opt/dau/dauNpn2.c \
src/opt/dau/dauTree.c src/opt/dau/dauTree.c
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