summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/aig/gia/gia.h1
-rw-r--r--src/aig/gia/giaFalse.c3
-rw-r--r--src/aig/gia/giaIf.c53
-rw-r--r--src/base/abci/abc.c2
4 files changed, 55 insertions, 4 deletions
diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h
index af35803a..f3a40ca1 100644
--- a/src/aig/gia/gia.h
+++ b/src/aig/gia/gia.h
@@ -280,6 +280,7 @@ struct Jf_Par_t_
word Area;
word Edge;
word Clause;
+ word Mux7;
float * pTimesArr;
float * pTimesReq;
};
diff --git a/src/aig/gia/giaFalse.c b/src/aig/gia/giaFalse.c
index c3f26455..a055b5bc 100644
--- a/src/aig/gia/giaFalse.c
+++ b/src/aig/gia/giaFalse.c
@@ -327,8 +327,7 @@ Gia_Man_t * Gia_ManFalseRebuildPath( Gia_Man_t * p, Vec_Int_t * vHooks, int fVer
{
Gia_Man_t * pNew, * pTemp;
Gia_Obj_t * pObj;
- int i, Counter = 0;
- int iPathEnd = Vec_IntEntryLast(vHooks);
+ int i, iPathEnd = Vec_IntEntryLast(vHooks);
pNew = Gia_ManStart( 4 * Gia_ManObjNum(p) / 3 );
pNew->pName = Abc_UtilStrsav( p->pName );
pNew->pSpec = Abc_UtilStrsav( p->pSpec );
diff --git a/src/aig/gia/giaIf.c b/src/aig/gia/giaIf.c
index 862e4c7e..e316a2ee 100644
--- a/src/aig/gia/giaIf.c
+++ b/src/aig/gia/giaIf.c
@@ -308,16 +308,63 @@ int Gia_ManComputeOverlap( Gia_Man_t * p )
SeeAlso []
***********************************************************************/
+void Gia_ManPrintGetMuxFanins( Gia_Man_t * p, Gia_Obj_t * pObj, int * pFanins )
+{
+ Gia_Obj_t * pData0, * pData1;
+ Gia_Obj_t * pCtrl = Gia_ObjRecognizeMux( pObj, &pData1, &pData0 );
+ pFanins[0] = Gia_ObjId(p, Gia_Regular(pCtrl));
+ pFanins[1] = Gia_ObjId(p, Gia_Regular(pData1));
+ pFanins[2] = Gia_ObjId(p, Gia_Regular(pData0));
+}
+int Gia_ManCountDupLut6( Gia_Man_t * p )
+{
+ int i, nCountDup = 0, nCountPis = 0;
+ Gia_ManCleanMark0( p );
+ Gia_ManForEachLut( p, i )
+ if ( Gia_ObjLutSize(p, i) == 3 && Gia_ObjLutFanins(p, i)[3] == -i )
+ {
+ Gia_Obj_t * pFanin;
+ int pFanins[3];
+ Gia_ManPrintGetMuxFanins( p, Gia_ManObj(p, i), pFanins );
+
+ pFanin = Gia_ManObj(p, pFanins[1]);
+ nCountPis += Gia_ObjIsCi(pFanin);
+ nCountDup += pFanin->fMark0;
+ pFanin->fMark0 = 1;
+
+ pFanin = Gia_ManObj(p, pFanins[2]);
+ nCountPis += Gia_ObjIsCi(pFanin);
+ nCountDup += pFanin->fMark0;
+ pFanin->fMark0 = 1;
+ }
+ Gia_ManCleanMark0( p );
+ if ( nCountDup + nCountDup )
+ printf( "Dup fanins = %d. CI fanins = %d. Total = %d. (%.2f %%)\n",
+ nCountDup, nCountPis, nCountDup + nCountPis, 100.0 * (nCountDup + nCountPis) / Gia_ManLutNum(p) );
+ return nCountDup + nCountPis;
+}
+
void Gia_ManPrintMappingStats( Gia_Man_t * p, char * pDumpFile )
{
Gia_Obj_t * pObj;
int * pLevels;
- int i, k, iFan, nLutSize = 0, nLuts = 0, nFanins = 0, LevelMax = 0, Ave = 0;
+ int i, k, iFan, nLutSize = 0, nLuts = 0, nFanins = 0, LevelMax = 0, Ave = 0, nMuxF7 = 0;
if ( !Gia_ManHasMapping(p) )
return;
pLevels = ABC_CALLOC( int, Gia_ManObjNum(p) );
Gia_ManForEachLut( p, i )
{
+ if ( Gia_ObjLutSize(p, i) == 3 && Gia_ObjLutFanins(p, i)[3] == -i )
+ {
+ int pFanins[3];
+ Gia_ManPrintGetMuxFanins( p, Gia_ManObj(p, i), pFanins );
+ pLevels[i] = Abc_MaxInt( pLevels[i], pLevels[pFanins[0]]+1 );
+ pLevels[i] = Abc_MaxInt( pLevels[i], pLevels[pFanins[1]] );
+ pLevels[i] = Abc_MaxInt( pLevels[i], pLevels[pFanins[2]] );
+ LevelMax = Abc_MaxInt( LevelMax, pLevels[i] );
+ nMuxF7++;
+ continue;
+ }
nLuts++;
nFanins += Gia_ObjLutSize(p, i);
nLutSize = Abc_MaxInt( nLutSize, Gia_ObjLutSize(p, i) );
@@ -336,6 +383,8 @@ void Gia_ManPrintMappingStats( Gia_Man_t * p, char * pDumpFile )
Abc_Print( 1, "Mapping (K=%d) : ", nLutSize );
SetConsoleTextAttribute( hConsole, 14 ); // yellow
Abc_Print( 1, "lut =%7d ", nLuts );
+ if ( nMuxF7 )
+ Abc_Print( 1, "mux =%7d ", nMuxF7 );
SetConsoleTextAttribute( hConsole, 10 ); // green
Abc_Print( 1, "edge =%8d ", nFanins );
SetConsoleTextAttribute( hConsole, 12 ); // red
@@ -357,6 +406,8 @@ void Gia_ManPrintMappingStats( Gia_Man_t * p, char * pDumpFile )
Abc_Print( 1, "\n" );
#endif
+ Gia_ManCountDupLut6( p );
+
if ( pDumpFile )
{
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index 0b183da9..8d00ca57 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -27845,7 +27845,7 @@ int Abc_CommandAbc9BalanceLut( Abc_Frame_t * pAbc, int argc, char ** argv )
int nCutNum = 8;
int fUseMuxes = 1;
int fRecursive = 1;
- int fOptArea = 0;
+ int fOptArea = 1;
int c, fVerbose = 0;
int fVeryVerbose = 0;
Extra_UtilGetoptReset();