summaryrefslogtreecommitdiffstats
path: root/src/base/abci
diff options
context:
space:
mode:
authorMathias Soeken <mathias.soeken@epfl.ch>2016-07-30 15:01:59 +0200
committerMathias Soeken <mathias.soeken@epfl.ch>2016-07-30 15:01:59 +0200
commit59077dab9f099a08ed958cdcda6ddf8f22b7ed3e (patch)
tree46fa1704b36b0b1d895ceff2bb433db658be8848 /src/base/abci
parent3641a3f18b1a0797cb19d3d8122b6f8dd67daeeb (diff)
downloadabc-59077dab9f099a08ed958cdcda6ddf8f22b7ed3e.tar.gz
abc-59077dab9f099a08ed958cdcda6ddf8f22b7ed3e.tar.bz2
abc-59077dab9f099a08ed958cdcda6ddf8f22b7ed3e.zip
Implementation of Abc_ExactDelayCost.
Diffstat (limited to 'src/base/abci')
-rw-r--r--src/base/abci/abcExact.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/src/base/abci/abcExact.c b/src/base/abci/abcExact.c
index ee3a67f4..a8ad858f 100644
--- a/src/base/abci/abcExact.c
+++ b/src/base/abci/abcExact.c
@@ -1109,8 +1109,40 @@ int Abc_ExactInputNum()
// the area cost should not exceed 2048, if the cut is implementable; otherwise, it should be ABC_INFINITY
int Abc_ExactDelayCost( word * pTruth, int nVars, int * pArrTimeProfile, char * pPerm, int * Cost )
{
- *Cost = ABC_INFINITY;
- return ABC_INFINITY;
+ int l;
+ Ses_Man_t * pSes;
+ char * pSol, * p;
+ int Delay;
+ abctime timeStart;
+
+ /* some checks */
+ assert( nVars >= 2 && nVars <= 8 );
+
+ timeStart = Abc_Clock();
+
+ pSes = Ses_ManAlloc( pTruth, nVars, 1, nVars - 1, pArrTimeProfile, 1, 0 );
+
+ if ( Ses_ManFindMinimumSize( pSes ) )
+ {
+ pSol = Ses_ManExtractSolution( pSes );
+
+ *Cost = pSol[ABC_EXACT_SOL_NGATES];
+ p = pSol + 3 + 4 * ABC_EXACT_SOL_NGATES + 1;
+ Delay = *p++;
+ for ( l = 0; l < nVars; ++l )
+ pPerm[l] = *p++;
+
+ ABC_FREE( pSol );
+ }
+ else
+ *Cost = Delay = ABC_INFINITY;
+
+ pSes->timeTotal = Abc_Clock() - timeStart;
+
+ /* cleanup */
+ Ses_ManClean( pSes );
+
+ return Delay;
}
// this procedure returns a new node whose output in terms of the given fanins
// has the smallest possible arrival time (in agreement with the above Abc_ExactDelayCost)