Commit 5a692406 by Alan Mishchenko

Version abc80207

parent 7174787a
This diff is collapsed. Click to expand it.
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: abctestlib - Win32 Release--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\alanmi\LOCALS~1\Temp\RSP20B8.tmp" with contents
[
/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Release/abctestlib.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c
"C:\_projects\abc\demo.c"
]
Creating command line "cl.exe @C:\DOCUME~1\alanmi\LOCALS~1\Temp\RSP20B8.tmp"
Creating temporary file "C:\DOCUME~1\alanmi\LOCALS~1\Temp\RSP20B9.tmp" with contents
[
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib C:\_projects\abc\abclib\abclib_release.lib /nologo /subsystem:console /incremental:no /pdb:"Release/abctestlib.pdb" /machine:I386 /out:"_TEST/abctestlib.exe"
.\Release\demo.obj
]
Creating command line "link.exe @C:\DOCUME~1\alanmi\LOCALS~1\Temp\RSP20B9.tmp"
<h3>Output Window</h3>
Compiling...
demo.c
Linking...
<h3>Results</h3>
abctestlib.exe - 0 error(s), 0 warning(s)
</pre>
</body>
</html>
...@@ -39,7 +39,7 @@ extern "C" { ...@@ -39,7 +39,7 @@ extern "C" {
#include "aig.h" #include "aig.h"
#include "dar.h" #include "dar.h"
#include "satSolver.h" #include "satSolver.h"
//#include "bar.h" #include "ioa.h"
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/// PARAMETERS /// /// PARAMETERS ///
......
...@@ -1530,7 +1530,7 @@ void Fra_ClausWriteIndClauses( Clu_Man_t * p ) ...@@ -1530,7 +1530,7 @@ void Fra_ClausWriteIndClauses( Clu_Man_t * p )
extern void Ioa_WriteAiger( Aig_Man_t * pMan, char * pFileName, int fWriteSymbols, int fCompact ); extern void Ioa_WriteAiger( Aig_Man_t * pMan, char * pFileName, int fWriteSymbols, int fCompact );
Aig_Man_t * pNew; Aig_Man_t * pNew;
Aig_Obj_t * pClause, * pLiteral; Aig_Obj_t * pClause, * pLiteral;
char Buffer[500]; char Buffer[500], * pName;
int * pStart, * pVar2Id; int * pStart, * pVar2Id;
int Beg, End, i, k; int Beg, End, i, k;
// create mapping from SAT vars to node IDs // create mapping from SAT vars to node IDs
...@@ -1561,7 +1561,9 @@ void Fra_ClausWriteIndClauses( Clu_Man_t * p ) ...@@ -1561,7 +1561,9 @@ void Fra_ClausWriteIndClauses( Clu_Man_t * p )
free( pVar2Id ); free( pVar2Id );
Aig_ManCleanup( pNew ); Aig_ManCleanup( pNew );
// write the manager into a file // write the manager into a file
sprintf( Buffer, "%s_care.aig", p->pAig->pName ); pName = Ioa_FileNameGeneric(p->pAig->pName);
sprintf( Buffer, "%s_care.aig", pName );
free( pName );
printf( "Care clauses are written into file \"%s\".\n", Buffer ); printf( "Care clauses are written into file \"%s\".\n", Buffer );
Ioa_WriteAiger( pNew, Buffer, 0, 1 ); Ioa_WriteAiger( pNew, Buffer, 0, 1 );
Aig_ManStop( pNew ); Aig_ManStop( pNew );
......
...@@ -130,7 +130,7 @@ int Fra_OneHotNodesAreClause( Fra_Sml_t * pSeq, Aig_Obj_t * pObj1, Aig_Obj_t * p ...@@ -130,7 +130,7 @@ int Fra_OneHotNodesAreClause( Fra_Sml_t * pSeq, Aig_Obj_t * pObj1, Aig_Obj_t * p
***********************************************************************/ ***********************************************************************/
Vec_Int_t * Fra_OneHotCompute( Fra_Man_t * p, Fra_Sml_t * pSim ) Vec_Int_t * Fra_OneHotCompute( Fra_Man_t * p, Fra_Sml_t * pSim )
{ {
int fSkipConstEqu = 1; int fSkipConstEqu = 0;
Vec_Int_t * vOneHots; Vec_Int_t * vOneHots;
Aig_Obj_t * pObj1, * pObj2; Aig_Obj_t * pObj1, * pObj2;
int i, k; int i, k;
......
...@@ -471,12 +471,14 @@ clk2 = clock(); ...@@ -471,12 +471,14 @@ clk2 = clock();
if ( p->pPars->fWriteImps && p->vOneHots && Fra_OneHotCount(p, p->vOneHots) ) if ( p->pPars->fWriteImps && p->vOneHots && Fra_OneHotCount(p, p->vOneHots) )
{ {
extern void Ioa_WriteAiger( Aig_Man_t * pMan, char * pFileName, int fWriteSymbols, int fCompact ); extern void Ioa_WriteAiger( Aig_Man_t * pMan, char * pFileName, int fWriteSymbols, int fCompact );
char Buffer[500]; char Buffer[500], * pStart;
Aig_Man_t * pNew; Aig_Man_t * pNew;
pManAigNew = Aig_ManDup( pManAig, 1 ); pManAigNew = Aig_ManDup( pManAig, 1 );
// pManAigNew->pManExdc = Fra_OneHotCreateExdc( p, p->vOneHots ); // pManAigNew->pManExdc = Fra_OneHotCreateExdc( p, p->vOneHots );
pNew = Fra_OneHotCreateExdc( p, p->vOneHots ); pNew = Fra_OneHotCreateExdc( p, p->vOneHots );
sprintf( Buffer, "%s_care.aig", p->pManAig->pName ); pStart = Ioa_FileNameGeneric(p->pManAig->pName);
sprintf( Buffer, "%s_care.aig", pStart );
free( pStart );
printf( "Care one-hotness clauses are written into file \"%s\".\n", Buffer ); printf( "Care one-hotness clauses are written into file \"%s\".\n", Buffer );
Ioa_WriteAiger( pNew, Buffer, 0, 1 ); Ioa_WriteAiger( pNew, Buffer, 0, 1 );
Aig_ManStop( pNew ); Aig_ManStop( pNew );
......
...@@ -1025,7 +1025,7 @@ int Abc_NtkLevelReverse( Abc_Ntk_t * pNtk ) ...@@ -1025,7 +1025,7 @@ int Abc_NtkLevelReverse( Abc_Ntk_t * pNtk )
return LevelsMax; return LevelsMax;
} }
/**Function************************************************************* /**Function*************************************************************
Synopsis [Recursively detects combinational loops.] Synopsis [Recursively detects combinational loops.]
......
...@@ -3130,7 +3130,7 @@ int Abc_CommandImfs( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -3130,7 +3130,7 @@ int Abc_CommandImfs( Abc_Frame_t * pAbc, int argc, char ** argv )
pPars->nWindow = 62; pPars->nWindow = 62;
pPars->nCands = 5; pPars->nCands = 5;
pPars->nSimWords = 4; pPars->nSimWords = 4;
pPars->nGrowthLevel = 0; pPars->nGrowthLevel = 1;
pPars->fArea = 0; pPars->fArea = 0;
pPars->fVerbose = 0; pPars->fVerbose = 0;
pPars->fVeryVerbose = 0; pPars->fVeryVerbose = 0;
...@@ -3225,7 +3225,7 @@ usage: ...@@ -3225,7 +3225,7 @@ usage:
fprintf( pErr, "\t-W <NM> : fanin/fanout levels (NxM) of the window (00 <= NM <= 99) [default = %d%d]\n", pPars->nWindow/10, pPars->nWindow%10 ); fprintf( pErr, "\t-W <NM> : fanin/fanout levels (NxM) of the window (00 <= NM <= 99) [default = %d%d]\n", pPars->nWindow/10, pPars->nWindow%10 );
fprintf( pErr, "\t-C <num> : the max number of resub candidates (1 <= n) [default = %d]\n", pPars->nCands ); fprintf( pErr, "\t-C <num> : the max number of resub candidates (1 <= n) [default = %d]\n", pPars->nCands );
fprintf( pErr, "\t-S <num> : the number of simulation words (1 <= n <= 256) [default = %d]\n", pPars->nSimWords ); fprintf( pErr, "\t-S <num> : the number of simulation words (1 <= n <= 256) [default = %d]\n", pPars->nSimWords );
fprintf( pErr, "\t-L <num> : the largest increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel ); fprintf( pErr, "\t-L <num> : the max increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
fprintf( pErr, "\t-a : toggle optimization for area only [default = %s]\n", pPars->fArea? "yes": "no" ); fprintf( pErr, "\t-a : toggle optimization for area only [default = %s]\n", pPars->fArea? "yes": "no" );
fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" ); fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
fprintf( pErr, "\t-w : toggle printout subgraph statistics [default = %s]\n", pPars->fVeryVerbose? "yes": "no" ); fprintf( pErr, "\t-w : toggle printout subgraph statistics [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
...@@ -3264,13 +3264,15 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -3264,13 +3264,15 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv )
pPars->nDepthMax = 20; pPars->nDepthMax = 20;
pPars->nDivMax = 200; pPars->nDivMax = 200;
pPars->nWinSizeMax = 300; pPars->nWinSizeMax = 300;
pPars->nGrowthLevel = 0; pPars->nGrowthLevel = 1;
pPars->fResub = 1; pPars->fResub = 1;
pPars->fArea = 0; pPars->fArea = 0;
pPars->fMoreEffort = 0;
pPars->fSwapEdge = 0;
pPars->fVerbose = 0; pPars->fVerbose = 0;
pPars->fVeryVerbose = 0; pPars->fVeryVerbose = 0;
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "WFDMLravwh" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "WFDMLraesvwh" ) ) != EOF )
{ {
switch ( c ) switch ( c )
{ {
...@@ -3335,6 +3337,12 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -3335,6 +3337,12 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'a': case 'a':
pPars->fArea ^= 1; pPars->fArea ^= 1;
break; break;
case 'e':
pPars->fMoreEffort ^= 1;
break;
case 's':
pPars->fSwapEdge ^= 1;
break;
case 'v': case 'v':
pPars->fVerbose ^= 1; pPars->fVerbose ^= 1;
break; break;
...@@ -3368,15 +3376,17 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -3368,15 +3376,17 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0; return 0;
usage: usage:
fprintf( pErr, "usage: mfs [-WFDML <num>] [-arvh]\n" ); fprintf( pErr, "usage: mfs [-WFDML <num>] [-raesvh]\n" );
fprintf( pErr, "\t performs don't-care-based optimization of logic networks\n" ); fprintf( pErr, "\t performs don't-care-based optimization of logic networks\n" );
fprintf( pErr, "\t-W <num> : the number of levels in the TFO cone (0 <= num) [default = %d]\n", pPars->nWinTfoLevs ); fprintf( pErr, "\t-W <num> : the number of levels in the TFO cone (0 <= num) [default = %d]\n", pPars->nWinTfoLevs );
fprintf( pErr, "\t-F <num> : the max number of fanouts to skip (1 <= num) [default = %d]\n", pPars->nFanoutsMax ); fprintf( pErr, "\t-F <num> : the max number of fanouts to skip (1 <= num) [default = %d]\n", pPars->nFanoutsMax );
fprintf( pErr, "\t-D <num> : the max depth nodes to try (0 = no limit) [default = %d]\n", pPars->nDepthMax ); fprintf( pErr, "\t-D <num> : the max depth nodes to try (0 = no limit) [default = %d]\n", pPars->nDepthMax );
fprintf( pErr, "\t-M <num> : the max size of window to consider (0 = no limit) [default = %d]\n", pPars->nWinSizeMax ); fprintf( pErr, "\t-M <num> : the max size of window to consider (0 = no limit) [default = %d]\n", pPars->nWinSizeMax );
fprintf( pErr, "\t-L <num> : the largest increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel ); fprintf( pErr, "\t-L <num> : the max increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
fprintf( pErr, "\t-a : toggle minimizing area or edges [default = %s]\n", pPars->fArea? "area": "edges" );
fprintf( pErr, "\t-r : toggle resubstitution and dc-minimization [default = %s]\n", pPars->fResub? "resub": "dc-min" ); fprintf( pErr, "\t-r : toggle resubstitution and dc-minimization [default = %s]\n", pPars->fResub? "resub": "dc-min" );
fprintf( pErr, "\t-a : toggle minimizing area or area+edges [default = %s]\n", pPars->fArea? "area": "area+edges" );
fprintf( pErr, "\t-e : toggle high-effort resubstitution [default = %s]\n", pPars->fMoreEffort? "yes": "no" );
fprintf( pErr, "\t-s : toggle evaluation of edge swapping [default = %s]\n", pPars->fSwapEdge? "yes": "no" );
fprintf( pErr, "\t-v : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" ); fprintf( pErr, "\t-v : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" );
fprintf( pErr, "\t-w : toggle printing detailed stats for each node [default = %s]\n", pPars->fVeryVerbose? "yes": "no" ); fprintf( pErr, "\t-w : toggle printing detailed stats for each node [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
fprintf( pErr, "\t-h : print the command usage\n"); fprintf( pErr, "\t-h : print the command usage\n");
...@@ -6208,12 +6218,14 @@ int Abc_CommandGen( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -6208,12 +6218,14 @@ int Abc_CommandGen( Abc_Frame_t * pAbc, int argc, char ** argv )
int fSorter; int fSorter;
int fMesh; int fMesh;
int fFpga; int fFpga;
int fOneHot;
int fVerbose; int fVerbose;
char * FileName; char * FileName;
extern void Abc_GenAdder( char * pFileName, int nVars ); extern void Abc_GenAdder( char * pFileName, int nVars );
extern void Abc_GenSorter( char * pFileName, int nVars ); extern void Abc_GenSorter( char * pFileName, int nVars );
extern void Abc_GenMesh( char * pFileName, int nVars ); extern void Abc_GenMesh( char * pFileName, int nVars );
extern void Abc_GenFpga( char * pFileName, int nLutSize, int nLuts, int nVars ); extern void Abc_GenFpga( char * pFileName, int nLutSize, int nLuts, int nVars );
extern void Abc_GenOneHot( char * pFileName, int nVars );
pNtk = Abc_FrameReadNtk(pAbc); pNtk = Abc_FrameReadNtk(pAbc);
...@@ -6226,9 +6238,10 @@ int Abc_CommandGen( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -6226,9 +6238,10 @@ int Abc_CommandGen( Abc_Frame_t * pAbc, int argc, char ** argv )
fSorter = 0; fSorter = 0;
fMesh = 0; fMesh = 0;
fFpga = 0; fFpga = 0;
fOneHot = 0;
fVerbose = 0; fVerbose = 0;
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "Nasmfvh" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "Nasmftvh" ) ) != EOF )
{ {
switch ( c ) switch ( c )
{ {
...@@ -6255,6 +6268,9 @@ int Abc_CommandGen( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -6255,6 +6268,9 @@ int Abc_CommandGen( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'f': case 'f':
fFpga ^= 1; fFpga ^= 1;
break; break;
case 't':
fOneHot ^= 1;
break;
case 'v': case 'v':
fVerbose ^= 1; fVerbose ^= 1;
break; break;
...@@ -6282,18 +6298,21 @@ int Abc_CommandGen( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -6282,18 +6298,21 @@ int Abc_CommandGen( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_GenFpga( FileName, 4, 3, 10 ); Abc_GenFpga( FileName, 4, 3, 10 );
// Abc_GenFpga( FileName, 2, 2, 3 ); // Abc_GenFpga( FileName, 2, 2, 3 );
// Abc_GenFpga( FileName, 3, 2, 5 ); // Abc_GenFpga( FileName, 3, 2, 5 );
else if ( fOneHot )
Abc_GenOneHot( FileName, nVars );
else else
printf( "Type of circuit is not specified.\n" ); printf( "Type of circuit is not specified.\n" );
return 0; return 0;
usage: usage:
fprintf( pErr, "usage: gen [-N] [-asmfvh] <file>\n" ); fprintf( pErr, "usage: gen [-N num] [-asmftvh] <file>\n" );
fprintf( pErr, "\t generates simple circuits\n" ); fprintf( pErr, "\t generates simple circuits\n" );
fprintf( pErr, "\t-N num : the number of variables [default = %d]\n", nVars ); fprintf( pErr, "\t-N num : the number of variables [default = %d]\n", nVars );
fprintf( pErr, "\t-a : generate ripple-carry adder [default = %s]\n", fAdder? "yes": "no" ); fprintf( pErr, "\t-a : generate ripple-carry adder [default = %s]\n", fAdder? "yes": "no" );
fprintf( pErr, "\t-s : generate a sorter [default = %s]\n", fSorter? "yes": "no" ); fprintf( pErr, "\t-s : generate a sorter [default = %s]\n", fSorter? "yes": "no" );
fprintf( pErr, "\t-m : generate a mesh [default = %s]\n", fMesh? "yes": "no" ); fprintf( pErr, "\t-m : generate a mesh [default = %s]\n", fMesh? "yes": "no" );
fprintf( pErr, "\t-f : generate a LUT FPGA structure [default = %s]\n", fFpga? "yes": "no" ); fprintf( pErr, "\t-f : generate a LUT FPGA structure [default = %s]\n", fFpga? "yes": "no" );
fprintf( pErr, "\t-t : generate one-hotness conditions [default = %s]\n", fOneHot? "yes": "no" );
fprintf( pErr, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" ); fprintf( pErr, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
fprintf( pErr, "\t-h : print the command usage\n"); fprintf( pErr, "\t-h : print the command usage\n");
fprintf( pErr, "\t<file> : output file name\n"); fprintf( pErr, "\t<file> : output file name\n");
...@@ -6634,7 +6653,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -6634,7 +6653,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkDarToCnf( Abc_Ntk_t * pNtk, char * pFileName ); extern Abc_Ntk_t * Abc_NtkDarToCnf( Abc_Ntk_t * pNtk, char * pFileName );
extern Abc_Ntk_t * Abc_NtkFilter( Abc_Ntk_t * pNtk ); extern Abc_Ntk_t * Abc_NtkFilter( Abc_Ntk_t * pNtk );
// extern Abc_Ntk_t * Abc_NtkDarRetime( Abc_Ntk_t * pNtk, int nStepsMax, int fVerbose ); // extern Abc_Ntk_t * Abc_NtkDarRetime( Abc_Ntk_t * pNtk, int nStepsMax, int fVerbose );
extern Abc_Ntk_t * Abc_NtkPcmTest( Abc_Ntk_t * pNtk, int fVerbose ); // extern Abc_Ntk_t * Abc_NtkPcmTest( Abc_Ntk_t * pNtk, int fVerbose );
extern Abc_NtkDarHaigRecord( Abc_Ntk_t * pNtk ); extern Abc_NtkDarHaigRecord( Abc_Ntk_t * pNtk );
// extern void Abc_NtkDarTestBlif( char * pFileName ); // extern void Abc_NtkDarTestBlif( char * pFileName );
......
...@@ -504,6 +504,48 @@ void Abc_GenFpga( char * pFileName, int nLutSize, int nLuts, int nVars ) ...@@ -504,6 +504,48 @@ void Abc_GenFpga( char * pFileName, int nLutSize, int nLuts, int nVars )
fclose( pFile ); fclose( pFile );
} }
/**Function*************************************************************
Synopsis [Generates structure of L K-LUTs implementing an N-var function.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Abc_GenOneHot( char * pFileName, int nVars )
{
FILE * pFile;
int i, k, Counter, nDigitsIn, nDigitsOut;
pFile = fopen( pFileName, "w" );
fprintf( pFile, "# One-hotness condition for %d vars generated by ABC on %s\n", nVars, Extra_TimeStamp() );
fprintf( pFile, ".model 1hot_%dvars\n", nVars );
fprintf( pFile, ".inputs" );
nDigitsIn = Extra_Base10Log( nVars );
for ( i = 0; i < nVars; i++ )
fprintf( pFile, " i%0*d", nDigitsIn, i );
fprintf( pFile, "\n" );
fprintf( pFile, ".outputs" );
nDigitsOut = Extra_Base10Log( nVars * (nVars - 1) / 2 );
for ( i = 0; i < nVars * (nVars - 1) / 2; i++ )
fprintf( pFile, " o%0*d", nDigitsOut, i );
fprintf( pFile, "\n" );
Counter = 0;
for ( i = 0; i < nVars; i++ )
for ( k = i+1; k < nVars; k++ )
{
fprintf( pFile, ".names i%0*d i%0*d o%0*d\n", nDigitsIn, i, nDigitsIn, k, nDigitsOut, Counter );
fprintf( pFile, "11 0\n" );
Counter++;
}
fprintf( pFile, ".end\n" );
fprintf( pFile, "\n" );
fclose( pFile );
}
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/// END OF FILE /// /// END OF FILE ///
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
......
...@@ -1130,6 +1130,7 @@ int Abc_NtkCombinePos( Abc_Ntk_t * pNtk, int fAnd ) ...@@ -1130,6 +1130,7 @@ int Abc_NtkCombinePos( Abc_Ntk_t * pNtk, int fAnd )
pNode = Abc_NtkCreatePo( pNtk ); pNode = Abc_NtkCreatePo( pNtk );
Abc_ObjAddFanin( pNode, pMiter ); Abc_ObjAddFanin( pNode, pMiter );
Abc_ObjAssignName( pNode, "miter", NULL ); Abc_ObjAssignName( pNode, "miter", NULL );
Abc_NtkOrderCisCos( pNtk );
// make sure that everything is okay // make sure that everything is okay
if ( !Abc_NtkCheck( pNtk ) ) if ( !Abc_NtkCheck( pNtk ) )
{ {
......
...@@ -218,7 +218,20 @@ Abc_Ntk_t * Io_ReadBlifNetworkOne( Io_ReadBlif_t * p ) ...@@ -218,7 +218,20 @@ Abc_Ntk_t * Io_ReadBlifNetworkOne( Io_ReadBlif_t * p )
p->pNtkCur = pNtk = Abc_NtkAlloc( ABC_NTK_NETLIST, ABC_FUNC_SOP, 1 ); p->pNtkCur = pNtk = Abc_NtkAlloc( ABC_NTK_NETLIST, ABC_FUNC_SOP, 1 );
// read the model name // read the model name
if ( strcmp( p->vTokens->pArray[0], ".model" ) == 0 ) if ( strcmp( p->vTokens->pArray[0], ".model" ) == 0 )
pNtk->pName = Extra_UtilStrsav( p->vTokens->pArray[1] ); {
char * pToken, * pPivot;
if ( Vec_PtrSize(p->vTokens) != 2 )
{
p->LineCur = Extra_FileReaderGetLineNumber(p->pReader, 0);
sprintf( p->sError, "The .model line does not have exactly two entries." );
Io_ReadBlifPrintErrorMessage( p );
return NULL;
}
for ( pPivot = pToken = Vec_PtrEntry(p->vTokens, 1); *pToken; pToken++ )
if ( *pToken == '/' || *pToken == '\\' )
pPivot = pToken+1;
pNtk->pName = Extra_UtilStrsav( pPivot );
}
else if ( strcmp( p->vTokens->pArray[0], ".exdc" ) != 0 ) else if ( strcmp( p->vTokens->pArray[0], ".exdc" ) != 0 )
{ {
printf( "%s: File parsing skipped after line %d (\"%s\").\n", p->pFileName, printf( "%s: File parsing skipped after line %d (\"%s\").\n", p->pFileName,
......
...@@ -90,7 +90,7 @@ static Io_MvMod_t * Io_MvModAlloc(); ...@@ -90,7 +90,7 @@ static Io_MvMod_t * Io_MvModAlloc();
static void Io_MvModFree( Io_MvMod_t * p ); static void Io_MvModFree( Io_MvMod_t * p );
static char * Io_MvLoadFile( char * pFileName ); static char * Io_MvLoadFile( char * pFileName );
static void Io_MvReadPreparse( Io_MvMan_t * p ); static void Io_MvReadPreparse( Io_MvMan_t * p );
static void Io_MvReadInterfaces( Io_MvMan_t * p ); static int Io_MvReadInterfaces( Io_MvMan_t * p );
static Abc_Lib_t * Io_MvParse( Io_MvMan_t * p ); static Abc_Lib_t * Io_MvParse( Io_MvMan_t * p );
static int Io_MvParseLineModel( Io_MvMod_t * p, char * pLine ); static int Io_MvParseLineModel( Io_MvMod_t * p, char * pLine );
static int Io_MvParseLineInputs( Io_MvMod_t * p, char * pLine ); static int Io_MvParseLineInputs( Io_MvMod_t * p, char * pLine );
...@@ -128,7 +128,7 @@ Abc_Ntk_t * Io_ReadBlifMv( char * pFileName, int fBlifMv, int fCheck ) ...@@ -128,7 +128,7 @@ Abc_Ntk_t * Io_ReadBlifMv( char * pFileName, int fBlifMv, int fCheck )
FILE * pFile; FILE * pFile;
Io_MvMan_t * p; Io_MvMan_t * p;
Abc_Ntk_t * pNtk; Abc_Ntk_t * pNtk;
Abc_Lib_t * pDesign; Abc_Lib_t * pDesign = NULL;
char * pDesignName; char * pDesignName;
int RetValue, i; int RetValue, i;
...@@ -161,10 +161,9 @@ Abc_Ntk_t * Io_ReadBlifMv( char * pFileName, int fBlifMv, int fCheck ) ...@@ -161,10 +161,9 @@ Abc_Ntk_t * Io_ReadBlifMv( char * pFileName, int fBlifMv, int fCheck )
p->pDesign->pManFunc = NULL; p->pDesign->pManFunc = NULL;
// prepare the file for parsing // prepare the file for parsing
Io_MvReadPreparse( p ); Io_MvReadPreparse( p );
// parse interfaces of each network // parse interfaces of each network and construct the network
Io_MvReadInterfaces( p ); if ( Io_MvReadInterfaces( p ) )
// construct the network pDesign = Io_MvParse( p );
pDesign = Io_MvParse( p );
if ( p->sError[0] ) if ( p->sError[0] )
fprintf( stdout, "%s\n", p->sError ); fprintf( stdout, "%s\n", p->sError );
Io_MvFree( p ); Io_MvFree( p );
...@@ -646,7 +645,7 @@ static void Io_MvReadPreparse( Io_MvMan_t * p ) ...@@ -646,7 +645,7 @@ static void Io_MvReadPreparse( Io_MvMan_t * p )
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
static void Io_MvReadInterfaces( Io_MvMan_t * p ) static int Io_MvReadInterfaces( Io_MvMan_t * p )
{ {
Io_MvMod_t * pMod; Io_MvMod_t * pMod;
char * pLine; char * pLine;
...@@ -656,22 +655,23 @@ static void Io_MvReadInterfaces( Io_MvMan_t * p ) ...@@ -656,22 +655,23 @@ static void Io_MvReadInterfaces( Io_MvMan_t * p )
{ {
// parse the model // parse the model
if ( !Io_MvParseLineModel( pMod, pMod->pName ) ) if ( !Io_MvParseLineModel( pMod, pMod->pName ) )
return; return 0;
// add model to the design // add model to the design
if ( !Abc_LibAddModel( p->pDesign, pMod->pNtk ) ) if ( !Abc_LibAddModel( p->pDesign, pMod->pNtk ) )
{ {
sprintf( p->sError, "Line %d: Model %s is defined twice.", Io_MvGetLine(p, pMod->pName), pMod->pName ); sprintf( p->sError, "Line %d: Model %s is defined twice.", Io_MvGetLine(p, pMod->pName), pMod->pName );
return; return 0;
} }
// parse the inputs // parse the inputs
Vec_PtrForEachEntry( pMod->vInputs, pLine, k ) Vec_PtrForEachEntry( pMod->vInputs, pLine, k )
if ( !Io_MvParseLineInputs( pMod, pLine ) ) if ( !Io_MvParseLineInputs( pMod, pLine ) )
return; return 0;
// parse the outputs // parse the outputs
Vec_PtrForEachEntry( pMod->vOutputs, pLine, k ) Vec_PtrForEachEntry( pMod->vOutputs, pLine, k )
if ( !Io_MvParseLineOutputs( pMod, pLine ) ) if ( !Io_MvParseLineOutputs( pMod, pLine ) )
return; return 0;
} }
return 1;
} }
...@@ -767,7 +767,7 @@ static Abc_Lib_t * Io_MvParse( Io_MvMan_t * p ) ...@@ -767,7 +767,7 @@ static Abc_Lib_t * Io_MvParse( Io_MvMan_t * p )
static int Io_MvParseLineModel( Io_MvMod_t * p, char * pLine ) static int Io_MvParseLineModel( Io_MvMod_t * p, char * pLine )
{ {
Vec_Ptr_t * vTokens = p->pMan->vTokens; Vec_Ptr_t * vTokens = p->pMan->vTokens;
char * pToken; char * pToken, * pPivot;
Io_MvSplitIntoTokens( vTokens, pLine, '\0' ); Io_MvSplitIntoTokens( vTokens, pLine, '\0' );
pToken = Vec_PtrEntry( vTokens, 0 ); pToken = Vec_PtrEntry( vTokens, 0 );
assert( !strcmp(pToken, "model") ); assert( !strcmp(pToken, "model") );
...@@ -782,7 +782,10 @@ static int Io_MvParseLineModel( Io_MvMod_t * p, char * pLine ) ...@@ -782,7 +782,10 @@ static int Io_MvParseLineModel( Io_MvMod_t * p, char * pLine )
p->pNtk = Abc_NtkAlloc( ABC_NTK_NETLIST, ABC_FUNC_BLIFMV, 1 ); p->pNtk = Abc_NtkAlloc( ABC_NTK_NETLIST, ABC_FUNC_BLIFMV, 1 );
else else
p->pNtk = Abc_NtkAlloc( ABC_NTK_NETLIST, ABC_FUNC_SOP, 1 ); p->pNtk = Abc_NtkAlloc( ABC_NTK_NETLIST, ABC_FUNC_SOP, 1 );
p->pNtk->pName = Extra_UtilStrsav( Vec_PtrEntry(vTokens, 1) ); for ( pPivot = pToken = Vec_PtrEntry(vTokens, 1); *pToken; pToken++ )
if ( *pToken == '/' || *pToken == '\\' )
pPivot = pToken+1;
p->pNtk->pName = Extra_UtilStrsav( pPivot );
return 1; return 1;
} }
......
...@@ -705,6 +705,24 @@ static inline void Vec_PtrCleanSimInfo( Vec_Ptr_t * vInfo, int iWord, int nWords ...@@ -705,6 +705,24 @@ static inline void Vec_PtrCleanSimInfo( Vec_Ptr_t * vInfo, int iWord, int nWords
/**Function************************************************************* /**Function*************************************************************
Synopsis [Cleans simulation info of each entry beginning with iWord.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static inline void Vec_PtrFillSimInfo( Vec_Ptr_t * vInfo, int iWord, int nWords )
{
int i;
for ( i = 0; i < vInfo->nSize; i++ )
memset( (char*)Vec_PtrEntry(vInfo,i) + 4*iWord, 0xFF, 4*(nWords-iWord) );
}
/**Function*************************************************************
Synopsis [Resizes the array of simulation info.] Synopsis [Resizes the array of simulation info.]
Description [Doubles the number of objects for which siminfo is allocated.] Description [Doubles the number of objects for which siminfo is allocated.]
......
...@@ -49,6 +49,8 @@ struct Mfs_Par_t_ ...@@ -49,6 +49,8 @@ struct Mfs_Par_t_
int nGrowthLevel; // the maximum allowed growth in level int nGrowthLevel; // the maximum allowed growth in level
int fResub; // performs resubstitution int fResub; // performs resubstitution
int fArea; // performs optimization for area int fArea; // performs optimization for area
int fMoreEffort; // performs high-affort minimization
int fSwapEdge; // performs edge swapping
int fDelay; // performs optimization for delay int fDelay; // performs optimization for delay
int fVerbose; // enable basic stats int fVerbose; // enable basic stats
int fVeryVerbose; // enable detailed stats int fVeryVerbose; // enable detailed stats
......
...@@ -74,10 +74,14 @@ clk = clock(); ...@@ -74,10 +74,14 @@ clk = clock();
return 1; return 1;
} }
// solve the SAT problem // solve the SAT problem
if ( p->pPars->fArea ) if ( p->pPars->fSwapEdge )
Abc_NtkMfsResubArea( p, pNode ); Abc_NtkMfsEdgeSwapEval( p, pNode );
else else
Abc_NtkMfsResubEdge( p, pNode ); {
Abc_NtkMfsResubNode( p, pNode );
if ( p->pPars->fMoreEffort )
Abc_NtkMfsResubNode2( p, pNode );
}
p->timeSat += clock() - clk; p->timeSat += clock() - clk;
return 1; return 1;
} }
...@@ -140,12 +144,13 @@ int Abc_NtkMfs( Abc_Ntk_t * pNtk, Mfs_Par_t * pPars ) ...@@ -140,12 +144,13 @@ int Abc_NtkMfs( Abc_Ntk_t * pNtk, Mfs_Par_t * pPars )
ProgressBar * pProgress; ProgressBar * pProgress;
Mfs_Man_t * p; Mfs_Man_t * p;
Abc_Obj_t * pObj; Abc_Obj_t * pObj;
int i, clk = clock(); int i, nFaninMax, clk = clock();
int nTotalNodesBeg = Abc_NtkNodeNum(pNtk); int nTotalNodesBeg = Abc_NtkNodeNum(pNtk);
int nTotalEdgesBeg = Abc_NtkGetTotalFanins(pNtk); int nTotalEdgesBeg = Abc_NtkGetTotalFanins(pNtk);
assert( Abc_NtkIsLogic(pNtk) ); assert( Abc_NtkIsLogic(pNtk) );
if ( Abc_NtkGetFaninMax(pNtk) > MFS_FANIN_MAX ) nFaninMax = Abc_NtkGetFaninMax(pNtk);
if ( nFaninMax > MFS_FANIN_MAX )
{ {
printf( "Some nodes have more than %d fanins. Quitting.\n", MFS_FANIN_MAX ); printf( "Some nodes have more than %d fanins. Quitting.\n", MFS_FANIN_MAX );
return 1; return 1;
...@@ -162,7 +167,8 @@ int Abc_NtkMfs( Abc_Ntk_t * pNtk, Mfs_Par_t * pPars ) ...@@ -162,7 +167,8 @@ int Abc_NtkMfs( Abc_Ntk_t * pNtk, Mfs_Par_t * pPars )
// start the manager // start the manager
p = Mfs_ManAlloc( pPars ); p = Mfs_ManAlloc( pPars );
p->pNtk = pNtk; p->pNtk = pNtk;
p->nFaninMax = nFaninMax;
if ( pNtk->pExcare ) if ( pNtk->pExcare )
{ {
Abc_Ntk_t * pTemp; Abc_Ntk_t * pTemp;
...@@ -170,7 +176,7 @@ int Abc_NtkMfs( Abc_Ntk_t * pNtk, Mfs_Par_t * pPars ) ...@@ -170,7 +176,7 @@ int Abc_NtkMfs( Abc_Ntk_t * pNtk, Mfs_Par_t * pPars )
p->pCare = Abc_NtkToDar( pTemp, 0 ); p->pCare = Abc_NtkToDar( pTemp, 0 );
Abc_NtkDelete( pTemp ); Abc_NtkDelete( pTemp );
} }
if ( pPars->fVerbose ) // if ( pPars->fVerbose )
{ {
if ( p->pCare != NULL ) if ( p->pCare != NULL )
printf( "Performing optimization with %d external care clauses.\n", Aig_ManPoNum(p->pCare) ); printf( "Performing optimization with %d external care clauses.\n", Aig_ManPoNum(p->pCare) );
......
...@@ -49,6 +49,7 @@ struct Mfs_Man_t_ ...@@ -49,6 +49,7 @@ struct Mfs_Man_t_
Mfs_Par_t * pPars; Mfs_Par_t * pPars;
Abc_Ntk_t * pNtk; Abc_Ntk_t * pNtk;
Aig_Man_t * pCare; Aig_Man_t * pCare;
int nFaninMax;
// intermeditate data for the node // intermeditate data for the node
Vec_Ptr_t * vRoots; // the roots of the window Vec_Ptr_t * vRoots; // the roots of the window
Vec_Ptr_t * vSupp; // the support of the window Vec_Ptr_t * vSupp; // the support of the window
...@@ -78,7 +79,6 @@ struct Mfs_Man_t_ ...@@ -78,7 +79,6 @@ struct Mfs_Man_t_
// performance statistics // performance statistics
int nNodesTried; int nNodesTried;
int nNodesResub; int nNodesResub;
int nNodesGained;
int nMintsCare; int nMintsCare;
int nMintsTotal; int nMintsTotal;
int nNodesBad; int nNodesBad;
...@@ -119,8 +119,10 @@ extern Mfs_Man_t * Mfs_ManAlloc( Mfs_Par_t * pPars ); ...@@ -119,8 +119,10 @@ extern Mfs_Man_t * Mfs_ManAlloc( Mfs_Par_t * pPars );
extern void Mfs_ManStop( Mfs_Man_t * p ); extern void Mfs_ManStop( Mfs_Man_t * p );
extern void Mfs_ManClean( Mfs_Man_t * p ); extern void Mfs_ManClean( Mfs_Man_t * p );
/*=== mfsResub.c ==========================================================*/ /*=== mfsResub.c ==========================================================*/
extern int Abc_NtkMfsResubArea( Mfs_Man_t * p, Abc_Obj_t * pNode ); extern void Abc_NtkMfsPrintResubStats( Mfs_Man_t * p );
extern int Abc_NtkMfsResubEdge( Mfs_Man_t * p, Abc_Obj_t * pNode ); extern int Abc_NtkMfsEdgeSwapEval( Mfs_Man_t * p, Abc_Obj_t * pNode );
extern int Abc_NtkMfsResubNode( Mfs_Man_t * p, Abc_Obj_t * pNode );
extern int Abc_NtkMfsResubNode2( Mfs_Man_t * p, Abc_Obj_t * pNode );
/*=== mfsSat.c ==========================================================*/ /*=== mfsSat.c ==========================================================*/
extern void Abc_NtkMfsSolveSat( Mfs_Man_t * p, Abc_Obj_t * pNode ); extern void Abc_NtkMfsSolveSat( Mfs_Man_t * p, Abc_Obj_t * pNode );
/*=== mfsStrash.c ==========================================================*/ /*=== mfsStrash.c ==========================================================*/
......
...@@ -85,12 +85,12 @@ void Mfs_ManClean( Mfs_Man_t * p ) ...@@ -85,12 +85,12 @@ void Mfs_ManClean( Mfs_Man_t * p )
if ( p->vDivs ) if ( p->vDivs )
Vec_PtrFree( p->vDivs ); Vec_PtrFree( p->vDivs );
p->pAigWin = NULL; p->pAigWin = NULL;
p->pCnf = NULL; p->pCnf = NULL;
p->pSat = NULL; p->pSat = NULL;
p->vRoots = NULL; p->vRoots = NULL;
p->vSupp = NULL; p->vSupp = NULL;
p->vNodes = NULL; p->vNodes = NULL;
p->vDivs = NULL; p->vDivs = NULL;
} }
/**Function************************************************************* /**Function*************************************************************
...@@ -117,6 +117,11 @@ void Mfs_ManPrint( Mfs_Man_t * p ) ...@@ -117,6 +117,11 @@ void Mfs_ManPrint( Mfs_Man_t * p )
printf( "\n" ); printf( "\n" );
printf( "Nodes = %d. Tried = %d. Resub = %d. Skipped = %d. SAT calls = %d.\n", printf( "Nodes = %d. Tried = %d. Resub = %d. Skipped = %d. SAT calls = %d.\n",
Abc_NtkNodeNum(p->pNtk), p->nNodesTried, p->nNodesResub, p->nNodesBad, p->nSatCalls ); Abc_NtkNodeNum(p->pNtk), p->nNodesTried, p->nNodesResub, p->nNodesBad, p->nSatCalls );
if ( p->pPars->fSwapEdge )
printf( "Swappable edges = %d. Total edges = %d. Ratio = %5.2f.\n",
p->nNodesResub, Abc_NtkGetTotalFanins(p->pNtk), 1.00 * p->nNodesResub / Abc_NtkGetTotalFanins(p->pNtk) );
else
Abc_NtkMfsPrintResubStats( p );
} }
else else
{ {
......
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