summaryrefslogtreecommitdiffstats
path: root/src/base/abci
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/abci')
-rw-r--r--src/base/abci/abc.c244
-rw-r--r--src/base/abci/abcBalance.c7
-rw-r--r--src/base/abci/abcGen.c144
-rw-r--r--src/base/abci/abcHaig.c506
-rw-r--r--src/base/abci/abcOdc.c4
-rw-r--r--src/base/abci/abcPrint.c19
-rw-r--r--src/base/abci/abcResub.c2
-rw-r--r--src/base/abci/abcStrash.c2
-rw-r--r--src/base/abci/abcVerify.c10
-rw-r--r--src/base/abci/module.make1
10 files changed, 907 insertions, 32 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index fbe81f48..4aa13733 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -61,7 +61,7 @@ static int Abc_CommandCleanup ( Abc_Frame_t * pAbc, int argc, char ** arg
static int Abc_CommandSweep ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandFastExtract ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandDisjoint ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandMfs ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandIfs ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandRewrite ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandRefactor ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -85,8 +85,8 @@ static int Abc_CommandReorder ( Abc_Frame_t * pAbc, int argc, char ** arg
static int Abc_CommandOrder ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandMuxes ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandExtSeqDcs ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandCone ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandNode ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandCone ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandNode ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandShortNames ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandExdcFree ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandExdcGet ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -123,6 +123,10 @@ static int Abc_CommandFraigClean ( Abc_Frame_t * pAbc, int argc, char ** arg
static int Abc_CommandFraigSweep ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandFraigDress ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandHaigStart ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandHaigStop ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandHaigUse ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
static int Abc_CommandMap ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandUnmap ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAttach ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -204,7 +208,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "Synthesis", "sweep", Abc_CommandSweep, 1 );
Cmd_CommandAdd( pAbc, "Synthesis", "fx", Abc_CommandFastExtract, 1 );
Cmd_CommandAdd( pAbc, "Synthesis", "dsd", Abc_CommandDisjoint, 1 );
- Cmd_CommandAdd( pAbc, "Synthesis", "mfs", Abc_CommandMfs, 1 );
+ Cmd_CommandAdd( pAbc, "Synthesis", "ifs", Abc_CommandIfs, 1 );
Cmd_CommandAdd( pAbc, "Synthesis", "rewrite", Abc_CommandRewrite, 1 );
Cmd_CommandAdd( pAbc, "Synthesis", "refactor", Abc_CommandRefactor, 1 );
@@ -228,8 +232,8 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "Various", "order", Abc_CommandOrder, 0 );
Cmd_CommandAdd( pAbc, "Various", "muxes", Abc_CommandMuxes, 1 );
Cmd_CommandAdd( pAbc, "Various", "ext_seq_dcs", Abc_CommandExtSeqDcs, 0 );
- Cmd_CommandAdd( pAbc, "Various", "cone", Abc_CommandCone, 1 );
- Cmd_CommandAdd( pAbc, "Various", "node", Abc_CommandNode, 1 );
+ Cmd_CommandAdd( pAbc, "Various", "cone", Abc_CommandCone, 1 );
+ Cmd_CommandAdd( pAbc, "Various", "node", Abc_CommandNode, 1 );
Cmd_CommandAdd( pAbc, "Various", "short_names", Abc_CommandShortNames, 0 );
Cmd_CommandAdd( pAbc, "Various", "exdc_free", Abc_CommandExdcFree, 1 );
Cmd_CommandAdd( pAbc, "Various", "exdc_get", Abc_CommandExdcGet, 1 );
@@ -266,6 +270,10 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "Fraiging", "fraig_sweep", Abc_CommandFraigSweep, 1 );
Cmd_CommandAdd( pAbc, "Fraiging", "dress", Abc_CommandFraigDress, 1 );
+ Cmd_CommandAdd( pAbc, "Choicing", "haig_start", Abc_CommandHaigStart, 0 );
+ Cmd_CommandAdd( pAbc, "Choicing", "haig_stop", Abc_CommandHaigStop, 0 );
+ Cmd_CommandAdd( pAbc, "Choicing", "haig_use", Abc_CommandHaigUse, 1 );
+
Cmd_CommandAdd( pAbc, "SC mapping", "map", Abc_CommandMap, 1 );
Cmd_CommandAdd( pAbc, "SC mapping", "unmap", Abc_CommandUnmap, 1 );
Cmd_CommandAdd( pAbc, "SC mapping", "attach", Abc_CommandAttach, 1 );
@@ -2641,7 +2649,7 @@ usage:
SeeAlso []
***********************************************************************/
-int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv )
+int Abc_CommandIfs( Abc_Frame_t * pAbc, int argc, char ** argv )
{
FILE * pOut, * pErr;
Abc_Ntk_t * pNtk;
@@ -2657,13 +2665,14 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv )
// set defaults
pPars->nWindow = 62;
+ pPars->nGrowthLevel = 3;
pPars->nCands = 5;
pPars->nSimWords = 4;
pPars->fArea = 0;
pPars->fVerbose = 0;
pPars->fVeryVerbose = 0;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "WSavwh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "WSCLavwh" ) ) != EOF )
{
switch ( c )
{
@@ -2689,6 +2698,28 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pPars->nSimWords < 1 || pPars->nSimWords > 256 )
goto usage;
break;
+ case 'C':
+ if ( globalUtilOptind >= argc )
+ {
+ fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nCands = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nCands < 0 || pPars->nCands > ABC_INFINITY )
+ goto usage;
+ break;
+ case 'L':
+ if ( globalUtilOptind >= argc )
+ {
+ fprintf( pErr, "Command line switch \"-L\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nGrowthLevel = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nGrowthLevel < 0 || pPars->nGrowthLevel > ABC_INFINITY )
+ goto usage;
+ break;
case 'a':
pPars->fArea ^= 1;
break;
@@ -2725,9 +2756,11 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: mfs [-W <NM>] [-S <num>] [-avwh]\n" );
- fprintf( pErr, "\t performs resubstitution-based resynthesis with don't-cares\n" );
- 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, "usage: ifs [-W <NM>] [-L <num>] [-C <num>] [-S <num>] [-avwh]\n" );
+ fprintf( pErr, "\t performs resubstitution-based resynthesis with interpolation\n" );
+ 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-L <num> : the largest increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
+ 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-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" );
@@ -5287,11 +5320,13 @@ int Abc_CommandGen( Abc_Frame_t * pAbc, int argc, char ** argv )
int fAdder;
int fSorter;
int fMesh;
+ int fFpga;
int fVerbose;
char * FileName;
extern void Abc_GenAdder( char * pFileName, int nVars );
extern void Abc_GenSorter( char * pFileName, int nVars );
extern void Abc_GenMesh( char * pFileName, int nVars );
+ extern void Abc_GenFpga( char * pFileName, int nLutSize, int nLuts, int nVars );
pNtk = Abc_FrameReadNtk(pAbc);
@@ -5302,9 +5337,11 @@ int Abc_CommandGen( Abc_Frame_t * pAbc, int argc, char ** argv )
nVars = 8;
fAdder = 0;
fSorter = 0;
+ fMesh = 0;
+ fFpga = 0;
fVerbose = 0;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "Nasmvh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "Nasmfvh" ) ) != EOF )
{
switch ( c )
{
@@ -5328,6 +5365,9 @@ int Abc_CommandGen( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'm':
fMesh ^= 1;
break;
+ case 'f':
+ fFpga ^= 1;
+ break;
case 'v':
fVerbose ^= 1;
break;
@@ -5351,17 +5391,22 @@ int Abc_CommandGen( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_GenSorter( FileName, nVars );
else if ( fMesh )
Abc_GenMesh( FileName, nVars );
+ else if ( fFpga )
+ Abc_GenFpga( FileName, 4, 3, 10 );
+// Abc_GenFpga( FileName, 2, 2, 3 );
+// Abc_GenFpga( FileName, 3, 2, 5 );
else
printf( "Type of circuit is not specified.\n" );
return 0;
usage:
- fprintf( pErr, "usage: gen [-N] [-asmvh] <file>\n" );
+ fprintf( pErr, "usage: gen [-N] [-asmfvh] <file>\n" );
fprintf( pErr, "\t generates simple circuits\n" );
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-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-f : generate a LUT FPGA structure [default = %s]\n", fFpga? "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<file> : output file name\n");
@@ -7498,6 +7543,158 @@ usage:
SeeAlso []
***********************************************************************/
+int Abc_CommandHaigStart( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ FILE * pOut, * pErr;
+ Abc_Ntk_t * pNtk;
+ int c;
+
+ pNtk = Abc_FrameReadNtk(pAbc);
+ pOut = Abc_FrameReadOut(pAbc);
+ pErr = Abc_FrameReadErr(pAbc);
+
+ // set defaults
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( !Abc_NtkIsStrash(pNtk) )
+ {
+ fprintf( pErr, "This command works only for AIGs; run strashing (\"st\").\n" );
+ return 0;
+ }
+ Abc_NtkHaigStart( pNtk );
+ return 0;
+
+usage:
+ fprintf( pErr, "usage: haig_start [-h]\n" );
+ fprintf( pErr, "\t starts constructive accumulation of combinational choices\n" );
+ fprintf( pErr, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandHaigStop( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ FILE * pOut, * pErr;
+ Abc_Ntk_t * pNtk;
+ int c;
+
+ pNtk = Abc_FrameReadNtk(pAbc);
+ pOut = Abc_FrameReadOut(pAbc);
+ pErr = Abc_FrameReadErr(pAbc);
+
+ // set defaults
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( !Abc_NtkIsStrash(pNtk) )
+ {
+ fprintf( pErr, "This command works only for AIGs; run strashing (\"st\").\n" );
+ return 0;
+ }
+ Abc_NtkHaigStop( pNtk );
+ return 0;
+
+usage:
+ fprintf( pErr, "usage: haig_stop [-h]\n" );
+ fprintf( pErr, "\t cleans the internal storage for combinational choices\n" );
+ fprintf( pErr, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandHaigUse( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ FILE * pOut, * pErr;
+ Abc_Ntk_t * pNtk, * pNtkRes;
+ int c;
+
+ pNtk = Abc_FrameReadNtk(pAbc);
+ pOut = Abc_FrameReadOut(pAbc);
+ pErr = Abc_FrameReadErr(pAbc);
+
+ // set defaults
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( !Abc_NtkIsStrash(pNtk) )
+ {
+ fprintf( pErr, "This command works only for AIGs; run strashing (\"st\").\n" );
+ return 0;
+ }
+ // get the new network
+ pNtkRes = Abc_NtkHaigUse( pNtk );
+ if ( pNtkRes == NULL )
+ {
+ fprintf( pErr, "Transforming internal storage into AIG with choices has failed.\n" );
+ return 1;
+ }
+ // replace the current network
+ Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+ return 0;
+
+usage:
+ fprintf( pErr, "usage: haig_use [-h]\n" );
+ fprintf( pErr, "\t transforms internal storage into an AIG with choices\n" );
+ fprintf( pErr, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv )
{
FILE * pOut, * pErr;
@@ -8242,7 +8439,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
// set defaults
memset( pPars, 0, sizeof(If_Par_t) );
// user-controlable paramters
- pPars->nLutSize = 4;
+ pPars->nLutSize = -1;
pPars->nCutsMax = 8;
pPars->nFlowIters = 1;
pPars->nAreaIters = 2;
@@ -8360,19 +8557,24 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
fprintf( pErr, "Empty network.\n" );
return 1;
}
-/*
- if ( pPars->fSeq )
- {
- fprintf( pErr, "Sequential mapping is currently being implemented.\n" );
- return 1;
- }
-*/
+
if ( pPars->fSeqMap && pPars->nLatches == 0 )
{
fprintf( pErr, "The network has no latches. Use combinational mapping instead of sequential.\n" );
return 1;
}
+ if ( pPars->nLutSize == -1 )
+ {
+ if ( pPars->pLutLib == NULL )
+ {
+ fprintf( pErr, "The LUT library is not given.\n" );
+ return 1;
+ }
+ // get LUT size from the library
+ pPars->nLutSize = pPars->pLutLib->LutMax;
+ }
+
if ( pPars->nLutSize < 3 || pPars->nLutSize > IF_MAX_LUTSIZE )
{
fprintf( pErr, "Incorrect LUT size (%d).\n", pPars->nLutSize );
diff --git a/src/base/abci/abcBalance.c b/src/base/abci/abcBalance.c
index 819974bf..f55dc435 100644
--- a/src/base/abci/abcBalance.c
+++ b/src/base/abci/abcBalance.c
@@ -49,6 +49,7 @@ static Vec_Ptr_t * Abc_NodeBalanceConeExor( Abc_Obj_t * pNode );
***********************************************************************/
Abc_Ntk_t * Abc_NtkBalance( Abc_Ntk_t * pNtk, bool fDuplicate, bool fSelective, bool fUpdateLevel )
{
+ extern void Abc_NtkHaigTranfer( Abc_Ntk_t * pNtkOld, Abc_Ntk_t * pNtkNew );
Abc_Ntk_t * pNtkAig;
assert( Abc_NtkIsStrash(pNtk) );
// compute the required times
@@ -59,6 +60,9 @@ Abc_Ntk_t * Abc_NtkBalance( Abc_Ntk_t * pNtk, bool fDuplicate, bool fSelective,
}
// perform balancing
pNtkAig = Abc_NtkStartFrom( pNtk, ABC_NTK_STRASH, ABC_FUNC_AIG );
+ // transfer HAIG
+ Abc_NtkHaigTranfer( pNtk, pNtkAig );
+ // perform balancing
Abc_NtkBalancePerform( pNtk, pNtkAig, fDuplicate, fSelective, fUpdateLevel );
Abc_NtkFinalize( pNtk, pNtkAig );
// undo the required times
@@ -267,6 +271,9 @@ Abc_Obj_t * Abc_NodeBalance_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNodeOld, Vec_
// if ( Abc_ObjRegular(pNodeOld->pCopy) == Abc_AigConst1(pNtkNew) )
// printf( "Constant node\n" );
// assert( pNodeOld->Level >= Abc_ObjRegular(pNodeOld->pCopy)->Level );
+ // update HAIG
+ if ( Abc_ObjRegular(pNodeOld->pCopy)->pNtk->pHaig )
+ Hop_ObjCreateChoice( pNodeOld->pEquiv, Abc_ObjRegular(pNodeOld->pCopy)->pEquiv );
return pNodeOld->pCopy;
}
diff --git a/src/base/abci/abcGen.c b/src/base/abci/abcGen.c
index 5d74bda5..bfb41374 100644
--- a/src/base/abci/abcGen.c
+++ b/src/base/abci/abcGen.c
@@ -360,6 +360,150 @@ void Abc_GenMesh( char * pFileName, int nVars )
}
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_WriteKLut( FILE * pFile, int nLutSize )
+{
+ int i, iVar, iNext, nPars = (1 << nLutSize);
+ fprintf( pFile, "\n" );
+ fprintf( pFile, ".model lut%d\n", nLutSize );
+ fprintf( pFile, ".inputs" );
+ for ( i = 0; i < nPars; i++ )
+ fprintf( pFile, " p%02d", i );
+ fprintf( pFile, "\n" );
+ fprintf( pFile, ".inputs" );
+ for ( i = 0; i < nLutSize; i++ )
+ fprintf( pFile, " i%d", i );
+ fprintf( pFile, "\n" );
+ fprintf( pFile, ".outputs o\n" );
+ fprintf( pFile, ".names n01 o\n" );
+ fprintf( pFile, "1 1\n" );
+ // write internal MUXes
+ iVar = 0;
+ iNext = 2;
+ for ( i = 1; i < nPars; i++ )
+ {
+ if ( i == iNext )
+ {
+ iNext *= 2;
+ iVar++;
+ }
+ if ( iVar == nLutSize - 1 )
+ fprintf( pFile, ".names i%d p%02d p%02d n%02d\n", iVar, 2*(i-nPars/2), 2*(i-nPars/2)+1, i );
+ else
+ fprintf( pFile, ".names i%d n%02d n%02d n%02d\n", iVar, 2*i, 2*i+1, i );
+ fprintf( pFile, "01- 1\n" );
+ fprintf( pFile, "1-1 1\n" );
+ }
+ fprintf( pFile, ".end\n" );
+ fprintf( pFile, "\n" );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Generates structure of L K-LUTs implementing an N-var function.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_GenFpga( char * pFileName, int nLutSize, int nLuts, int nVars )
+{
+ FILE * pFile;
+ int nVarsLut = (1 << nLutSize); // the number of LUT variables
+ int nVarsLog = Extra_Base2Log( nVars + nLuts - 1 ); // the number of encoding vars
+ int nVarsDeg = (1 << nVarsLog); // the number of LUT variables (total)
+ int nParsLut = nLuts * (1 << nLutSize); // the number of LUT params
+ int nParsVar = nLuts * nLutSize * nVarsLog; // the number of var params
+ int i, j, k;
+
+ assert( nVars > 0 );
+
+ pFile = fopen( pFileName, "w" );
+ fprintf( pFile, "# Structure with %d %d-LUTs for %d-var function generated by ABC on %s\n", nLuts, nLutSize, nVars, Extra_TimeStamp() );
+ fprintf( pFile, ".model struct%dx%d_%d\n", nLuts, nLutSize, nVars );
+
+ fprintf( pFile, ".inputs" );
+ for ( i = 0; i < nParsLut; i++ )
+ fprintf( pFile, " pl%02d", i );
+ fprintf( pFile, "\n" );
+
+ fprintf( pFile, ".inputs" );
+ for ( i = 0; i < nParsVar; i++ )
+ fprintf( pFile, " pv%02d", i );
+ fprintf( pFile, "\n" );
+
+ fprintf( pFile, ".inputs" );
+ for ( i = 0; i < nVars; i++ )
+ fprintf( pFile, " v%02d", i );
+ fprintf( pFile, "\n" );
+
+ fprintf( pFile, ".outputs" );
+ fprintf( pFile, " v%02d", nVars + nLuts - 1 );
+ fprintf( pFile, "\n" );
+ fprintf( pFile, ".names Gnd\n" );
+ fprintf( pFile, " 0\n" );
+
+ // generate LUTs
+ for ( i = 0; i < nLuts; i++ )
+ {
+ fprintf( pFile, ".subckt lut%d", nLutSize );
+ // generate config parameters
+ for ( k = 0; k < nVarsLut; k++ )
+ fprintf( pFile, " p%02d=pl%02d", k, i * nVarsLut + k );
+ // generate the inputs
+ for ( k = 0; k < nLutSize; k++ )
+ fprintf( pFile, " i%d=s%02d", k, i * nLutSize + k );
+ // generate the output
+ fprintf( pFile, " o=v%02d", nVars + i );
+ fprintf( pFile, "\n" );
+ }
+
+ // generate LUT inputs
+ for ( i = 0; i < nLuts; i++ )
+ {
+ for ( j = 0; j < nLutSize; j++ )
+ {
+ fprintf( pFile, ".subckt lut%d", nVarsLog );
+ // generate config parameters
+ for ( k = 0; k < nVarsDeg; k++ )
+ {
+ if ( k < nVars + nLuts - 1 && k < nVars + i )
+ fprintf( pFile, " p%02d=v%02d", k, k );
+ else
+ fprintf( pFile, " p%02d=Gnd", k );
+ }
+ // generate the inputs
+ for ( k = 0; k < nVarsLog; k++ )
+ fprintf( pFile, " i%d=pv%02d", k, (i * nLutSize + j) * nVarsLog + k );
+ // generate the output
+ fprintf( pFile, " o=s%02d", i * nLutSize + j );
+ fprintf( pFile, "\n" );
+ }
+ }
+
+ fprintf( pFile, ".end\n" );
+ fprintf( pFile, "\n" );
+
+ // generate LUTs
+ Abc_WriteKLut( pFile, nLutSize );
+ if ( nVarsLog != nLutSize )
+ Abc_WriteKLut( pFile, nVarsLog );
+ fclose( pFile );
+}
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
diff --git a/src/base/abci/abcHaig.c b/src/base/abci/abcHaig.c
new file mode 100644
index 00000000..87fada22
--- /dev/null
+++ b/src/base/abci/abcHaig.c
@@ -0,0 +1,506 @@
+/**CFile****************************************************************
+
+ FileName [abcHaig.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Network and node package.]
+
+ Synopsis [Implements history AIG for combinational rewriting.]
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - June 20, 2005.]
+
+ Revision [$Id: abcHaig.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "abc.h"
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis [Start history AIG.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_NtkHaigStart( Abc_Ntk_t * pNtk )
+{
+ Hop_Man_t * p;
+ Abc_Obj_t * pObj, * pTemp;
+ int i;
+ assert( Abc_NtkIsStrash(pNtk) );
+ // check if the package is already started
+ if ( pNtk->pHaig )
+ {
+ Abc_NtkHaigStop( pNtk );
+ assert( pNtk->pHaig == NULL );
+ printf( "Warning: Previous history AIG was removed.\n" );
+ }
+ // make sure the data is clean
+ Abc_NtkForEachObj( pNtk, pObj, i )
+ assert( pObj->pEquiv == NULL );
+ // start the HOP package
+ p = Hop_ManStart();
+ p->vNodes = Vec_PtrAlloc( 4096 );
+ Vec_PtrPush( p->vNodes, Hop_ManConst1(p) );
+ // map the constant node
+ Abc_AigConst1(pNtk)->pEquiv = Hop_ManConst1(p);
+ // map the CIs
+ Abc_NtkForEachCi( pNtk, pObj, i )
+ pObj->pEquiv = Hop_ObjCreatePi(p);
+ // map the internal nodes
+ Abc_NtkForEachNode( pNtk, pObj, i )
+ pObj->pEquiv = Hop_And( p, Abc_ObjChild0Equiv(pObj), Abc_ObjChild1Equiv(pObj) );
+ // map the choice nodes
+ if ( Abc_NtkGetChoiceNum( pNtk ) )
+ {
+ // print warning about choice nodes
+ printf( "Warning: The choice nodes in the original AIG are converted into HAIG.\n" );
+ Abc_NtkForEachNode( pNtk, pObj, i )
+ {
+ if ( !Abc_AigNodeIsChoice( pObj ) )
+ continue;
+ for ( pTemp = pObj->pData; pTemp; pTemp = pTemp->pData )
+ Hop_ObjCreateChoice( pObj->pEquiv, pTemp->pEquiv );
+ }
+ }
+ // make sure everything is okay
+ if ( !Hop_ManCheck(p) )
+ {
+ printf( "Abc_NtkHaigStart: Check for History AIG has failed.\n" );
+ Hop_ManStop(p);
+ return 0;
+ }
+ pNtk->pHaig = p;
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Stops history AIG.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_NtkHaigStop( Abc_Ntk_t * pNtk )
+{
+ Abc_Obj_t * pObj;
+ int i;
+ assert( Abc_NtkIsStrash(pNtk) );
+ if ( pNtk->pHaig == NULL )
+ {
+ printf( "Warning: History AIG is not allocated.\n" );
+ return 1;
+ }
+ Abc_NtkForEachObj( pNtk, pObj, i )
+ pObj->pEquiv = NULL;
+ Hop_ManStop( pNtk->pHaig );
+ pNtk->pHaig = NULL;
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Transfers the HAIG to the new network.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkHaigTranfer( Abc_Ntk_t * pNtkOld, Abc_Ntk_t * pNtkNew )
+{
+ Abc_Obj_t * pObj;
+ int i;
+ if ( pNtkOld->pHaig == NULL )
+ return;
+ // transfer the package
+ assert( pNtkNew->pHaig == NULL );
+ pNtkNew->pHaig = pNtkOld->pHaig;
+ pNtkOld->pHaig = NULL;
+ // transfer constant pointer
+ Abc_AigConst1(pNtkOld)->pCopy->pEquiv = Abc_AigConst1(pNtkOld)->pEquiv;
+ // transfer the CI pointers
+ Abc_NtkForEachCi( pNtkOld, pObj, i )
+ pObj->pCopy->pEquiv = pObj->pEquiv;
+}
+
+
+
+
+/**Function*************************************************************
+
+ Synopsis [Collects the nodes in the classes.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Vec_Ptr_t * Abc_NtkHaigCollectMembers( Hop_Man_t * p )
+{
+ Vec_Ptr_t * vNodes;
+ Hop_Obj_t * pObj;
+ int i;
+ vNodes = Vec_PtrAlloc( 4098 );
+ Vec_PtrForEachEntry( p->vNodes, pObj, i )
+ {
+ if ( pObj->pData == NULL )
+ continue;
+ pObj->pData = Hop_ObjRepr( pObj );
+ Vec_PtrPush( vNodes, pObj );
+ }
+ return vNodes;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Creates classes.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Vec_Ptr_t * Abc_NtkHaigCreateClasses( Vec_Ptr_t * vMembers )
+{
+ Vec_Ptr_t * vClasses;
+ Hop_Obj_t * pObj, * pRepr;
+ int i;
+
+ // count classes
+ vClasses = Vec_PtrAlloc( 4098 );
+ Vec_PtrForEachEntry( vMembers, pObj, i )
+ {
+ pRepr = pObj->pData;
+ assert( pRepr->pData == NULL );
+ if ( pRepr->fMarkA == 0 ) // new
+ {
+ pRepr->fMarkA = 1;
+ Vec_PtrPush( vClasses, pRepr );
+ }
+ }
+
+ // set representatives as representatives
+ Vec_PtrForEachEntry( vClasses, pObj, i )
+ {
+ pObj->fMarkA = 0;
+ pObj->pData = pObj;
+ }
+
+ // go through the members and update
+ Vec_PtrForEachEntry( vMembers, pObj, i )
+ {
+ pRepr = pObj->pData;
+ if ( ((Hop_Obj_t *)pRepr->pData)->Id > pObj->Id )
+ pRepr->pData = pObj;
+ }
+
+ // change representatives of the class
+ Vec_PtrForEachEntry( vMembers, pObj, i )
+ {
+ pRepr = pObj->pData;
+ pObj->pData = pRepr->pData;
+ assert( ((Hop_Obj_t *)pObj->pData)->Id <= pObj->Id );
+ }
+
+ // update classes
+ Vec_PtrForEachEntry( vClasses, pObj, i )
+ {
+ pRepr = pObj->pData;
+ assert( pRepr->pData == pRepr );
+ pRepr->pData = NULL;
+ Vec_PtrWriteEntry( vClasses, i, pRepr );
+ Vec_PtrPush( vMembers, pObj );
+ }
+/*
+ Vec_PtrForEachEntry( vMembers, pObj, i )
+ {
+ printf( "ObjId = %4d : ", pObj->Id );
+ if ( pObj->pData == NULL )
+ {
+ printf( "NULL" );
+ }
+ else
+ {
+ printf( "%4d", ((Hop_Obj_t *)pObj->pData)->Id );
+ assert( ((Hop_Obj_t *)pObj->pData)->Id <= pObj->Id );
+ }
+ printf( "\n" );
+ }
+*/
+ return vClasses;
+}
+
+
+/**Function*************************************************************
+
+ Synopsis [Returns 1 if pOld is in the TFI of pNew.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_NtkHaigCheckTfi_rec( Abc_Obj_t * pNode, Abc_Obj_t * pOld )
+{
+ if ( pNode == NULL )
+ return 0;
+ if ( pNode == pOld )
+ return 1;
+ // check the trivial cases
+ if ( Abc_ObjIsPi(pNode) )
+ return 0;
+ assert( Abc_ObjIsNode(pNode) );
+ // if this node is already visited, skip
+ if ( Abc_NodeIsTravIdCurrent( pNode ) )
+ return 0;
+ // mark the node as visited
+ Abc_NodeSetTravIdCurrent( pNode );
+ // check the children
+ if ( Abc_NtkHaigCheckTfi_rec( Abc_ObjFanin0(pNode), pOld ) )
+ return 1;
+ if ( Abc_NtkHaigCheckTfi_rec( Abc_ObjFanin1(pNode), pOld ) )
+ return 1;
+ // check equivalent nodes
+ return Abc_NtkHaigCheckTfi_rec( pNode->pData, pOld );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Returns 1 if pOld is in the TFI of pNew.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_NtkHaigCheckTfi( Abc_Ntk_t * pNtk, Abc_Obj_t * pOld, Abc_Obj_t * pNew )
+{
+ assert( !Abc_ObjIsComplement(pOld) );
+ assert( !Abc_ObjIsComplement(pNew) );
+ Abc_NtkIncrementTravId(pNtk);
+ return Abc_NtkHaigCheckTfi_rec( pNew, pOld );
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline Abc_Obj_t * Hop_ObjReprAbc( Hop_Obj_t * pObj )
+{
+ Hop_Obj_t * pRepr;
+ Abc_Obj_t * pObjAbcThis, * pObjAbcRepr;
+ assert( pObj->pNext != NULL );
+ if ( pObj->pData == NULL )
+ return (Abc_Obj_t *)pObj->pNext;
+ pRepr = pObj->pData;
+ assert( pRepr->pData == NULL );
+ pObjAbcThis = (Abc_Obj_t *)pObj->pNext;
+ pObjAbcRepr = (Abc_Obj_t *)pRepr->pNext;
+ assert( !Abc_ObjIsComplement(pObjAbcThis) );
+ assert( !Abc_ObjIsComplement(pObjAbcRepr) );
+ return Abc_ObjNotCond( pObjAbcRepr, pObjAbcRepr->fPhase ^ pObjAbcThis->fPhase );
+// return (Abc_Obj_t *)pObj->pNext;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline Abc_Obj_t * Hop_ObjChild0Abc( Hop_Obj_t * pObj ) { return Abc_ObjNotCond( Hop_ObjReprAbc(Hop_ObjFanin0(pObj)), Hop_ObjFaninC0(pObj) ); }
+static inline Abc_Obj_t * Hop_ObjChild1Abc( Hop_Obj_t * pObj ) { return Abc_ObjNotCond( Hop_ObjReprAbc(Hop_ObjFanin1(pObj)), Hop_ObjFaninC1(pObj) ); }
+
+/**Function*************************************************************
+
+ Synopsis [Stops history AIG.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Abc_Ntk_t * Abc_NtkHaigRecreateAig( Abc_Ntk_t * pNtk, Hop_Man_t * p )
+{
+ Abc_Ntk_t * pNtkAig;
+ Abc_Obj_t * pObjAbcThis, * pObjAbcRepr;
+ Abc_Obj_t * pObjOld, * pObjNew;
+ Hop_Obj_t * pObj;
+ int i;
+
+ assert( p->nCreated == Vec_PtrSize(p->vNodes) );
+ assert( Hop_ManPoNum(p) == 0 );
+
+ // start the new network
+ pNtkAig = Abc_NtkStartFrom( pNtk, ABC_NTK_STRASH, ABC_FUNC_AIG );
+
+ // transfer new nodes to the PIs of HOP
+ Hop_ManConst1(p)->pNext = (Hop_Obj_t *)Abc_AigConst1( pNtkAig );
+ Hop_ManForEachPi( p, pObj, i )
+ pObj->pNext = (Hop_Obj_t *)Abc_NtkPi( pNtkAig, i );
+
+ // construct new nodes
+ Vec_PtrForEachEntry( p->vNodes, pObj, i )
+ if ( Hop_ObjIsNode(pObj) )
+ pObj->pNext = (Hop_Obj_t *)Abc_AigAnd( pNtkAig->pManFunc, Hop_ObjChild0Abc(pObj), Hop_ObjChild1Abc(pObj) );
+
+ // set the COs
+ Abc_NtkForEachCo( pNtk, pObjOld, i )
+ {
+ pObjNew = Hop_ObjReprAbc( Abc_ObjFanin0(pObjOld)->pEquiv );
+ pObjNew = Abc_ObjNotCond( pObjNew, Abc_ObjFaninC0(pObjOld) );
+ Abc_ObjAddFanin( pObjOld->pCopy, pObjNew );
+ }
+
+ // create choice nodes
+ Vec_PtrForEachEntry( p->vNodes, pObj, i )
+ {
+ Abc_Obj_t * pTemp;
+ if ( pObj->pData == NULL )
+ continue;
+
+ pObjAbcThis = (Abc_Obj_t *)pObj->pNext;
+ pObjAbcRepr = (Abc_Obj_t *)((Hop_Obj_t *)pObj->pData)->pNext;
+ assert( !Abc_ObjIsComplement(pObjAbcThis) );
+ assert( !Abc_ObjIsComplement(pObjAbcRepr) );
+
+ // skip the case when the class is constant 1
+ if ( pObjAbcRepr == Abc_AigConst1(pNtkAig) )
+ continue;
+
+ // skip the case when pObjAbcThis is part of the class already
+ for ( pTemp = pObjAbcRepr; pTemp; pTemp = pTemp->pData )
+ if ( pTemp == pObjAbcThis )
+ break;
+ if ( pTemp )
+ continue;
+
+// assert( Abc_ObjFanoutNum(pObjAbcThis) == 0 );
+ if ( Abc_ObjFanoutNum(pObjAbcThis) > 0 )
+ continue;
+// assert( pObjAbcThis->pData == NULL );
+ if ( pObjAbcThis->pData )
+ continue;
+
+ // do not create choices if there is a path from pObjAbcThis to pObjAbcRepr
+ if ( !Abc_NtkHaigCheckTfi( pNtkAig, pObjAbcRepr, pObjAbcThis ) )
+ {
+ // find the last node in the class
+ while ( pObjAbcRepr->pData )
+ pObjAbcRepr = pObjAbcRepr->pData;
+ // add the new node at the end of the list
+ pObjAbcRepr->pData = pObjAbcThis;
+ }
+ }
+
+ // finish the new network
+// Abc_NtkFinalize( pNtk, pNtkAig );
+// Abc_AigCleanup( pNtkAig->pManFunc );
+ // check correctness of the network
+ if ( !Abc_NtkCheck( pNtkAig ) )
+ {
+ printf( "Abc_NtkHaigUse: The network check has failed.\n" );
+ Abc_NtkDelete( pNtkAig );
+ return NULL;
+ }
+ return pNtkAig;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Stops history AIG.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Abc_Ntk_t * Abc_NtkHaigUse( Abc_Ntk_t * pNtk )
+{
+ Abc_Ntk_t * pNtkAig;
+ Vec_Ptr_t * vMembers, * vClasses;
+
+ // check if HAIG is available
+ assert( Abc_NtkIsStrash(pNtk) );
+ if ( pNtk->pHaig == NULL )
+ {
+ printf( "Warning: History AIG is not available.\n" );
+ return NULL;
+ }
+ // convert HOP package into AIG with choices
+
+ // print HAIG stats
+// Hop_ManPrintStats( pNtk->pHaig ); // USES DATA!!!
+
+ // collect members of the classes and make them point to reprs
+ vMembers = Abc_NtkHaigCollectMembers( pNtk->pHaig );
+ printf( "Collected %6d class members.\n", Vec_PtrSize(vMembers) );
+
+ // create classes
+ vClasses = Abc_NtkHaigCreateClasses( vMembers );
+ printf( "Collected %6d classes. (Ave = %5.2f)\n", Vec_PtrSize(vClasses),
+ (float)(Vec_PtrSize(vMembers))/Vec_PtrSize(vClasses) );
+ Vec_PtrFree( vMembers );
+ Vec_PtrFree( vClasses );
+
+ // traverse in the topological order and create new AIG
+ pNtkAig = Abc_NtkHaigRecreateAig( pNtk, pNtk->pHaig );
+
+ // free HAIG
+ Abc_NtkHaigStop( pNtk );
+ return pNtkAig;
+}
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+
diff --git a/src/base/abci/abcOdc.c b/src/base/abci/abcOdc.c
index 42b8826c..d6e59328 100644
--- a/src/base/abci/abcOdc.c
+++ b/src/base/abci/abcOdc.c
@@ -24,7 +24,7 @@
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
-#define ABC_DC_MAX_NODES (1<<14)
+#define ABC_DC_MAX_NODES (1<<15)
typedef unsigned short Odc_Lit_t;
@@ -416,7 +416,7 @@ void Abc_NtkDontCareWinCollectRoots( Odc_Man_t * p )
SideEffects []
- SeeAlso []
+ SeeAlso []
***********************************************************************/
int Abc_NtkDontCareWinAddMissing_rec( Odc_Man_t * p, Abc_Obj_t * pObj )
diff --git a/src/base/abci/abcPrint.c b/src/base/abci/abcPrint.c
index 33f336de..ad8eec6a 100644
--- a/src/base/abci/abcPrint.c
+++ b/src/base/abci/abcPrint.c
@@ -33,6 +33,8 @@
int s_MappingTime = 0;
int s_MappingMem = 0;
+int s_ResubTime = 0;
+int s_ResynTime = 0;
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
@@ -147,20 +149,27 @@ void Abc_NtkPrintStats( FILE * pFile, Abc_Ntk_t * pNtk, int fFactored )
fprintf( pTable, "\n" );
fclose( pTable );
}
-*/
+*/
/*
// print the statistic into a file
{
FILE * pTable;
- pTable = fopen( "a/fpga_stats.txt", "a+" );
+ pTable = fopen( "x/stats_new.txt", "a+" );
fprintf( pTable, "%s ", pNtk->pName );
- fprintf( pTable, "%d ", Abc_NtkLevel(pNtk) );
- fprintf( pTable, "%d ", Abc_NtkNodeNum(pNtk) );
+// fprintf( pTable, "%d ", Abc_NtkPiNum(pNtk) );
+// fprintf( pTable, "%d ", Abc_NtkPoNum(pNtk) );
+// fprintf( pTable, "%d ", Abc_NtkLevel(pNtk) );
+// fprintf( pTable, "%d ", Abc_NtkNodeNum(pNtk) );
+// fprintf( pTable, "%d ", Abc_NtkGetTotalFanins(pNtk) );
+// fprintf( pTable, "%d ", Abc_NtkLatchNum(pNtk) );
// fprintf( pTable, "%.2f ", (float)(s_MappingMem)/(float)(1<<20) );
-// fprintf( pTable, "%.2f", (float)(s_MappingTime)/(float)(CLOCKS_PER_SEC) );
+ fprintf( pTable, "%.2f", (float)(s_MappingTime)/(float)(CLOCKS_PER_SEC) );
+// fprintf( pTable, "%.2f", (float)(s_ResynTime)/(float)(CLOCKS_PER_SEC) );
fprintf( pTable, "\n" );
fclose( pTable );
+
+ s_ResynTime = 0;
}
*/
diff --git a/src/base/abci/abcResub.c b/src/base/abci/abcResub.c
index 1938db7c..243548fa 100644
--- a/src/base/abci/abcResub.c
+++ b/src/base/abci/abcResub.c
@@ -118,6 +118,7 @@ extern void Abc_NtkDontCareClear( void * p );
extern void Abc_NtkDontCareFree( void * p );
extern int Abc_NtkDontCareCompute( void * p, Abc_Obj_t * pNode, Vec_Ptr_t * vLeaves, unsigned * puTruth );
+extern int s_ResubTime;
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
@@ -261,6 +262,7 @@ pManRes->timeTotal = clock() - clkStart;
printf( "Abc_NtkRefactor: The network check has failed.\n" );
return 0;
}
+s_ResubTime = clock() - clkStart;
return 1;
}
diff --git a/src/base/abci/abcStrash.c b/src/base/abci/abcStrash.c
index 45fc9089..00a94bec 100644
--- a/src/base/abci/abcStrash.c
+++ b/src/base/abci/abcStrash.c
@@ -60,7 +60,7 @@ Abc_Ntk_t * Abc_NtkRestrash( Abc_Ntk_t * pNtk, bool fCleanup )
// restrash the nodes (assuming a topological order of the old network)
Abc_NtkForEachNode( pNtk, pObj, i )
pObj->pCopy = Abc_AigAnd( pNtkAig->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
- //l finalize the network
+ // finalize the network
Abc_NtkFinalize( pNtk, pNtkAig );
// print warning about self-feed latches
// if ( Abc_NtkCountSelfFeedLatches(pNtkAig) )
diff --git a/src/base/abci/abcVerify.c b/src/base/abci/abcVerify.c
index 05bd021d..b7a7d4b9 100644
--- a/src/base/abci/abcVerify.c
+++ b/src/base/abci/abcVerify.c
@@ -603,10 +603,14 @@ void Abc_NtkVerifyReportError( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int * pMode
Abc_NtkForEachCi( pNtk1, pNode, i )
pNode->pCopy = (void*)i;
// print the model
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ pNode = Vec_PtrEntry( vNodes, 0 );
+ if ( Abc_ObjIsCi(pNode) )
{
- assert( Abc_ObjIsCi(pNode) );
- printf( " %s=%d", Abc_ObjName(pNode), pModel[(int)pNode->pCopy] );
+ Vec_PtrForEachEntry( vNodes, pNode, i )
+ {
+ assert( Abc_ObjIsCi(pNode) );
+ printf( " %s=%d", Abc_ObjName(pNode), pModel[(int)pNode->pCopy] );
+ }
}
printf( "\n" );
Vec_PtrFree( vNodes );
diff --git a/src/base/abci/module.make b/src/base/abci/module.make
index 3bec3840..71a47ec0 100644
--- a/src/base/abci/module.make
+++ b/src/base/abci/module.make
@@ -17,6 +17,7 @@ SRC += src/base/abci/abc.c \
src/base/abci/abcFraig.c \
src/base/abci/abcFxu.c \
src/base/abci/abcGen.c \
+ src/base/abci/abcHaig.c \
src/base/abci/abcIf.c \
src/base/abci/abcIvy.c \
src/base/abci/abcLut.c \