summaryrefslogtreecommitdiffstats
path: root/src/map/if/ifMap.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2012-11-10 19:37:53 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2012-11-10 19:37:53 -0800
commitee789ba902b6f2c443717bdcb82506ecb6aed3b8 (patch)
treeee23f68dabc0316da2ea1e373e693ecea7c869c3 /src/map/if/ifMap.c
parente0f27f5ac3a8ff2c6d7cc3257cfafd76dcd99cfd (diff)
downloadabc-ee789ba902b6f2c443717bdcb82506ecb6aed3b8.tar.gz
abc-ee789ba902b6f2c443717bdcb82506ecb6aed3b8.tar.bz2
abc-ee789ba902b6f2c443717bdcb82506ecb6aed3b8.zip
Improved DSD.
Diffstat (limited to 'src/map/if/ifMap.c')
-rw-r--r--src/map/if/ifMap.c57
1 files changed, 56 insertions, 1 deletions
diff --git a/src/map/if/ifMap.c b/src/map/if/ifMap.c
index d4d0d1dd..cb3c6832 100644
--- a/src/map/if/ifMap.c
+++ b/src/map/if/ifMap.c
@@ -27,6 +27,8 @@ ABC_NAMESPACE_IMPL_START
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
+extern char * Dau_DsdMerge( char * pDsd0i, int * pPerm0, char * pDsd1i, int * pPerm1, int fCompl0, int fCompl1 );
+
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
@@ -80,6 +82,50 @@ float If_CutDelaySpecial( If_Man_t * p, If_Cut_t * pCut, int fCarry )
/**Function*************************************************************
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline int * If_CutPerm0( If_Cut_t * pCut, If_Cut_t * pCut0 )
+{
+ static int pPerm[IF_MAX_LUTSIZE];
+ int i, k;
+ for ( i = k = 0; i < (int)pCut->nLeaves; i++ )
+ {
+ if ( k == (int)pCut0->nLeaves )
+ break;
+ if ( pCut->pLeaves[i] < pCut0->pLeaves[k] )
+ continue;
+ assert( pCut->pLeaves[i] == pCut0->pLeaves[k] );
+ pPerm[k++] = i;
+ }
+ return pPerm;
+}
+static inline int * If_CutPerm1( If_Cut_t * pCut, If_Cut_t * pCut1 )
+{
+ static int pPerm[IF_MAX_LUTSIZE];
+ int i, k;
+ for ( i = k = 0; i < (int)pCut->nLeaves; i++ )
+ {
+ if ( k == (int)pCut1->nLeaves )
+ break;
+ if ( pCut->pLeaves[i] < pCut1->pLeaves[k] )
+ continue;
+ assert( pCut->pLeaves[i] == pCut1->pLeaves[k] );
+ pPerm[k++] = i;
+ }
+ return pPerm;
+}
+
+
+
+/**Function*************************************************************
+
Synopsis [Finds the best cut for the given node.]
Description [Mapping modes: delay (0), area flow (1), area (2).]
@@ -227,7 +273,16 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
p->nCutsCountAll++;
p->nCutsCount[pCut->nLeaves]++;
}
-
+ }
+ if ( p->pPars->fUseDsd )
+ {
+ char * pName = Dau_DsdMerge(
+ Abc_NamStr(p->pNamDsd, pCut0->iDsd),
+ If_CutPerm0(pCut, pCut0),
+ Abc_NamStr(p->pNamDsd, pCut1->iDsd),
+ If_CutPerm1(pCut, pCut1),
+ pObj->fCompl0, pObj->fCompl1 );
+ pCut->iDsd = Abc_NamStrFindOrAdd( p->pNamDsd, pName, NULL );
}
// compute the application-specific cost and depth