summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-09-19 19:06:01 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2014-09-19 19:06:01 -0700
commita02b0203568f4c20f50c81e26603c3a5ee4083eb (patch)
treefe1bda9a7f1699798a9e56c22615c2749ff22069
parentf989aea224760cc35f5b3bf232e9dccac4f1baa4 (diff)
downloadabc-a02b0203568f4c20f50c81e26603c3a5ee4083eb.tar.gz
abc-a02b0203568f4c20f50c81e26603c3a5ee4083eb.tar.bz2
abc-a02b0203568f4c20f50c81e26603c3a5ee4083eb.zip
Updating DSD balance to handle XOR gate as having the same delay as AND gate.
-rw-r--r--src/map/if/ifCount.h4
-rw-r--r--src/map/if/ifDelay.c6
-rw-r--r--src/map/if/ifDsd.c9
-rw-r--r--src/map/if/ifTune.c2
4 files changed, 11 insertions, 10 deletions
diff --git a/src/map/if/ifCount.h b/src/map/if/ifCount.h
index dcd3b63a..9bfc36d4 100644
--- a/src/map/if/ifCount.h
+++ b/src/map/if/ifCount.h
@@ -85,7 +85,7 @@ static inline int If_LogCreateAndXorMulti( Vec_Int_t * vAig, int * pFaninLits, i
pFaninLits[i-1] = If_LogCreateAndXor( vAig, pFaninLits[i], pFaninLits[i-1], nSuppAll, fXor );
return pFaninLits[0];
}
-static inline int If_LogCounterAddAig( int * pTimes, int * pnTimes, int * pFaninLits, int Num, int iLit, Vec_Int_t * vAig, int nSuppAll, int fXor )
+static inline int If_LogCounterAddAig( int * pTimes, int * pnTimes, int * pFaninLits, int Num, int iLit, Vec_Int_t * vAig, int nSuppAll, int fXor, int fXorFunc )
{
int nTimes = *pnTimes;
if ( vAig )
@@ -107,7 +107,7 @@ static inline int If_LogCounterAddAig( int * pTimes, int * pnTimes, int * pFanin
}
pTimes[k-1] += 1 + fXor;
if ( vAig )
- pFaninLits[k-1] = If_LogCreateAndXor( vAig, pFaninLits[k], pFaninLits[k-1], nSuppAll, fXor );
+ pFaninLits[k-1] = If_LogCreateAndXor( vAig, pFaninLits[k], pFaninLits[k-1], nSuppAll, fXorFunc );
for ( nTimes--, i = k; i < nTimes; i++ )
{
pTimes[i] = pTimes[i+1];
diff --git a/src/map/if/ifDelay.c b/src/map/if/ifDelay.c
index da4801b4..5afb77eb 100644
--- a/src/map/if/ifDelay.c
+++ b/src/map/if/ifDelay.c
@@ -204,9 +204,9 @@ int If_CutSopBalanceEvalInt( Vec_Int_t * vCover, int * pTimes, int * pFaninLits,
{
Literal = 3 & (Entry >> (k << 1));
if ( Literal == 1 ) // neg literal
- nLits++, Delay = If_LogCounterAddAig( pCounterAnd, &nCounterAnd, pFaninLitsAnd, pTimes[k], Abc_LitNot(pFaninLits[k]), vAig, nSuppAll, 0 );
+ nLits++, Delay = If_LogCounterAddAig( pCounterAnd, &nCounterAnd, pFaninLitsAnd, pTimes[k], Abc_LitNot(pFaninLits[k]), vAig, nSuppAll, 0, 0 );
else if ( Literal == 2 ) // pos literal
- nLits++, Delay = If_LogCounterAddAig( pCounterAnd, &nCounterAnd, pFaninLitsAnd, pTimes[k], pFaninLits[k], vAig, nSuppAll, 0 );
+ nLits++, Delay = If_LogCounterAddAig( pCounterAnd, &nCounterAnd, pFaninLitsAnd, pTimes[k], pFaninLits[k], vAig, nSuppAll, 0, 0 );
else if ( Literal != 0 )
assert( 0 );
}
@@ -216,7 +216,7 @@ int If_CutSopBalanceEvalInt( Vec_Int_t * vCover, int * pTimes, int * pFaninLits,
iRes = If_LogCreateAndXorMulti( vAig, pFaninLitsAnd, nCounterAnd, nSuppAll, 0 );
else
*pArea += nLits == 1 ? 0 : nLits - 1;
- Delay = If_LogCounterAddAig( pCounterOr, &nCounterOr, pFaninLitsOr, Delay, Abc_LitNot(iRes), vAig, nSuppAll, 0 );
+ Delay = If_LogCounterAddAig( pCounterOr, &nCounterOr, pFaninLitsOr, Delay, Abc_LitNot(iRes), vAig, nSuppAll, 0, 0 );
}
assert( nCounterOr > 0 );
if ( vAig )
diff --git a/src/map/if/ifDsd.c b/src/map/if/ifDsd.c
index 8aea9bad..8afa9e03 100644
--- a/src/map/if/ifDsd.c
+++ b/src/map/if/ifDsd.c
@@ -2073,7 +2073,7 @@ int If_CutDsdBalancePinDelays_rec( If_DsdMan_t * p, int Id, int * pTimes, word *
{
word pFaninRes[IF_MAX_FUNC_LUTSIZE];
int i, iFanin, Delay, Result = 0;
- int fXor = (If_DsdObjType(pObj) == IF_DSD_XOR);
+ int fXor = 0;//(If_DsdObjType(pObj) == IF_DSD_XOR);
int nCounter = 0, pCounter[IF_MAX_FUNC_LUTSIZE];
If_DsdObjForEachFaninLit( &p->vObjs, pObj, iFanin, i )
{
@@ -2188,7 +2188,8 @@ int If_CutDsdBalanceEval_rec( If_DsdMan_t * p, int Id, int * pTimes, int * pnSup
assert( If_DsdObjType(pObj) == IF_DSD_AND || If_DsdObjType(pObj) == IF_DSD_XOR );
{
int i, iFanin, Delay, Result = 0;
- int fXor = (If_DsdObjType(pObj) == IF_DSD_XOR);
+ int fXor = 0;//(If_DsdObjType(pObj) == IF_DSD_XOR);
+ int fXorFunc = (If_DsdObjType(pObj) == IF_DSD_XOR);
int nCounter = 0, pCounter[IF_MAX_FUNC_LUTSIZE], pFaninLits[IF_MAX_FUNC_LUTSIZE];
If_DsdObjForEachFaninLit( &p->vObjs, pObj, iFanin, i )
{
@@ -2196,13 +2197,13 @@ int If_CutDsdBalanceEval_rec( If_DsdMan_t * p, int Id, int * pTimes, int * pnSup
if ( Delay == -1 )
return -1;
pFaninLits[i] = Abc_LitNotCond( pFaninLits[i], Abc_LitIsCompl(iFanin) );
- Result = If_LogCounterAddAig( pCounter, &nCounter, pFaninLits, Delay, pFaninLits[i], vAig, nSuppAll, fXor );
+ Result = If_LogCounterAddAig( pCounter, &nCounter, pFaninLits, Delay, pFaninLits[i], vAig, nSuppAll, fXor, fXorFunc );
}
assert( nCounter > 0 );
if ( fXor )
Result = If_LogCounterDelayXor( pCounter, nCounter ); // estimation
if ( vAig )
- *piLit = If_LogCreateAndXorMulti( vAig, pFaninLits, nCounter, nSuppAll, fXor );
+ *piLit = If_LogCreateAndXorMulti( vAig, pFaninLits, nCounter, nSuppAll, fXorFunc );
else
*pArea += (pObj->nFans - 1) * (1 + 2 * fXor);
return Result;
diff --git a/src/map/if/ifTune.c b/src/map/if/ifTune.c
index d17644b1..e7b1ad05 100644
--- a/src/map/if/ifTune.c
+++ b/src/map/if/ifTune.c
@@ -207,7 +207,7 @@ int Inf_ManOpenSymb( char * pStr )
}
int Ifn_ManStrCheck( char * pStr, int * pnInps, int * pnObjs )
{
- int i, nNodes = 0, Marks[32] = {0}, MaxVar = -1, RetValue = 1;
+ int i, nNodes = 0, Marks[32] = {0}, MaxVar = -1;
for ( i = 0; pStr[i]; i++ )
{
if ( Inf_ManOpenSymb(pStr+i) )