summaryrefslogtreecommitdiffstats
path: root/src/map
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2007-01-21 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2007-01-21 08:01:00 -0800
commit2167d6c148191f7aa65381bb0618b64050bf4de3 (patch)
tree345f5cc859142b50f01d261073688e880e61b631 /src/map
parent76bcf6b25411e1b0d73e5dff6c8fd3e2f4bab9e1 (diff)
downloadabc-2167d6c148191f7aa65381bb0618b64050bf4de3.tar.gz
abc-2167d6c148191f7aa65381bb0618b64050bf4de3.tar.bz2
abc-2167d6c148191f7aa65381bb0618b64050bf4de3.zip
Version abc70121
Diffstat (limited to 'src/map')
-rw-r--r--src/map/if/if.h7
-rw-r--r--src/map/if/ifCore.c6
-rw-r--r--src/map/if/ifCut.c2
-rw-r--r--src/map/if/ifMap.c14
-rw-r--r--src/map/if/ifReduce.c22
-rw-r--r--src/map/mio/mioFunc.c2
6 files changed, 29 insertions, 24 deletions
diff --git a/src/map/if/if.h b/src/map/if/if.h
index 80678cbf..81d4007c 100644
--- a/src/map/if/if.h
+++ b/src/map/if/if.h
@@ -45,6 +45,8 @@ extern "C" {
#define IF_MAX_LUTSIZE 32
// the largest possible number of LUT inputs when funtionality of the LUTs are computed
#define IF_MAX_FUNC_LUTSIZE 15
+// a very large number
+#define IF_INFINITY 100000000
// object types
typedef enum {
@@ -75,6 +77,8 @@ struct If_Par_t_
// user-controlable paramters
int nLutSize; // the LUT size
int nCutsMax; // the max number of cuts
+ int nFlowIters; // the number of iterations of area recovery
+ int nAreaIters; // the number of iterations of area recovery
float DelayTarget; // delay target
int fPreprocess; // preprossing
int fArea; // area-oriented mapping
@@ -88,6 +92,7 @@ struct If_Par_t_
int fUsePerm; // use permutation (delay info)
int fUseBdds; // sets local BDDs at the nodes
int fUseSops; // sets local SOPs at the nodes
+ int fUseCnfs; // sets local CNFs at the nodes
int nLatches; // the number of latches in seq mapping
int fLiftLeaves; // shift the leaves for seq mapping
If_Lib_t * pLutLib; // the LUT library
@@ -276,6 +281,8 @@ static inline float If_CutLutArea( If_Man_t * p, If_Cut_t * pCut ) { r
// iterator over the leaves of the cut
#define If_CutForEachLeaf( p, pCut, pLeaf, i ) \
for ( i = 0; (i < (int)(pCut)->nLeaves) && ((pLeaf) = If_ManObj(p, (pCut)->pLeaves[i])); i++ )
+#define If_CutForEachLeafReverse( p, pCut, pLeaf, i ) \
+ for ( i = (int)(pCut)->nLeaves - 1; (i >= 0) && ((pLeaf) = If_ManObj(p, (pCut)->pLeaves[i])); i-- )
//#define If_CutForEachLeaf( p, pCut, pLeaf, i ) \
// for ( i = 0; (i < (int)(pCut)->nLeaves) && ((pLeaf) = If_ManObj(p, p->pPars->fLiftLeaves? (pCut)->pLeaves[i] >> 8 : (pCut)->pLeaves[i])); i++ )
// iterator over the leaves of the sequential cut
diff --git a/src/map/if/ifCore.c b/src/map/if/ifCore.c
index 38983832..be2c7e33 100644
--- a/src/map/if/ifCore.c
+++ b/src/map/if/ifCore.c
@@ -42,8 +42,6 @@
int If_ManPerformMapping( If_Man_t * p )
{
If_Obj_t * pObj;
- int nItersFlow = 1;
- int nItersArea = 2;
int clkTotal = clock();
int RetValue, i;
@@ -74,14 +72,14 @@ int If_ManPerformMapping( If_Man_t * p )
if ( p->pPars->fExpRed && !p->pPars->fTruth )
If_ManImproveMapping( p );
// area flow oriented mapping
- for ( i = 0; i < nItersFlow; i++ )
+ for ( i = 0; i < p->pPars->nFlowIters; i++ )
{
If_ManPerformMappingRound( p, p->pPars->nCutsMax, 1, 1, "Flow" );
if ( p->pPars->fExpRed && !p->pPars->fTruth )
If_ManImproveMapping( p );
}
// area oriented mapping
- for ( i = 0; i < nItersArea; i++ )
+ for ( i = 0; i < p->pPars->nAreaIters; i++ )
{
If_ManPerformMappingRound( p, p->pPars->nCutsMax, 2, 1, "Area" );
if ( p->pPars->fExpRed && !p->pPars->fTruth )
diff --git a/src/map/if/ifCut.c b/src/map/if/ifCut.c
index 8c092b99..f0663f7f 100644
--- a/src/map/if/ifCut.c
+++ b/src/map/if/ifCut.c
@@ -473,7 +473,7 @@ float If_CutAverageRefs( If_Man_t * p, If_Cut_t * pCut )
SideEffects []
SeeAlso []
-
+
***********************************************************************/
float If_CutDeref( If_Man_t * p, If_Cut_t * pCut, int nLevels )
{
diff --git a/src/map/if/ifMap.c b/src/map/if/ifMap.c
index 569f200b..2d04d780 100644
--- a/src/map/if/ifMap.c
+++ b/src/map/if/ifMap.c
@@ -86,7 +86,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode )
pObj->EstRefs = (float)((2.0 * pObj->EstRefs + pObj->nRefs) / 3.0);
}
if ( Mode && pObj->nRefs > 0 )
- If_CutDeref( p, If_ObjCutBest(pObj), 100 );
+ If_CutDeref( p, If_ObjCutBest(pObj), IF_INFINITY );
// save the best cut as one of the candidate cuts
p->nCuts = 0;
@@ -97,7 +97,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode )
pCut = If_ObjCutBest(pObj);
pCut->Delay = If_CutDelay( p, pCut );
assert( pCut->Delay <= pObj->Required + p->fEpsilon );
- pCut->Area = (Mode == 2)? If_CutAreaDerefed( p, pCut, 100 ) : If_CutFlow( p, pCut );
+ pCut->Area = (Mode == 2)? If_CutAreaDerefed( p, pCut, IF_INFINITY ) : If_CutFlow( p, pCut );
// save the best cut from the previous iteration
If_CutCopy( p->ppCuts[p->nCuts++], pCut );
p->nCutsMerged++;
@@ -135,7 +135,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode )
if ( Mode && pCut->Delay > pObj->Required + p->fEpsilon )
continue;
// compute area of the cut (this area may depend on the application specific cost)
- pCut->Area = (Mode == 2)? If_CutAreaDerefed( p, pCut, 100 ) : If_CutFlow( p, pCut );
+ pCut->Area = (Mode == 2)? If_CutAreaDerefed( p, pCut, IF_INFINITY ) : If_CutFlow( p, pCut );
pCut->AveRefs = (Mode == 0)? (float)0.0 : If_CutAverageRefs( p, pCut );
// make sure the cut is the last one (after filtering it may not be so)
assert( pCut == p->ppCuts[iCut] );
@@ -160,7 +160,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode )
assert( p->pPars->fSeqMap || If_ObjCutBest(pObj)->nLeaves > 1 );
// ref the selected cut
if ( Mode && pObj->nRefs > 0 )
- If_CutRef( p, If_ObjCutBest(pObj), 100 );
+ If_CutRef( p, If_ObjCutBest(pObj), IF_INFINITY );
}
/**Function*************************************************************
@@ -182,7 +182,7 @@ void If_ObjPerformMappingChoice( If_Man_t * p, If_Obj_t * pObj, int Mode )
assert( pObj->pEquiv != NULL );
// prepare
if ( Mode && pObj->nRefs > 0 )
- If_CutDeref( p, If_ObjCutBest(pObj), 100 );
+ If_CutDeref( p, If_ObjCutBest(pObj), IF_INFINITY );
// prepare room for the next cut
p->nCuts = 0;
iCut = p->nCuts;
@@ -207,7 +207,7 @@ void If_ObjPerformMappingChoice( If_Man_t * p, If_Obj_t * pObj, int Mode )
// set the phase attribute
pCut->fCompl ^= (pObj->fPhase ^ pTemp->fPhase);
// compute area of the cut (this area may depend on the application specific cost)
- pCut->Area = (Mode == 2)? If_CutAreaDerefed( p, pCut, 100 ) : If_CutFlow( p, pCut );
+ pCut->Area = (Mode == 2)? If_CutAreaDerefed( p, pCut, IF_INFINITY ) : If_CutFlow( p, pCut );
pCut->AveRefs = (Mode == 0)? (float)0.0 : If_CutAverageRefs( p, pCut );
// make sure the cut is the last one (after filtering it may not be so)
assert( pCut == p->ppCuts[iCut] );
@@ -237,7 +237,7 @@ void If_ObjPerformMappingChoice( If_Man_t * p, If_Obj_t * pObj, int Mode )
assert( p->pPars->fSeqMap || If_ObjCutBest(pObj)->nLeaves > 1 );
// ref the selected cut
if ( Mode && pObj->nRefs > 0 )
- If_CutRef( p, If_ObjCutBest(pObj), 100 );
+ If_CutRef( p, If_ObjCutBest(pObj), IF_INFINITY );
}
/**Function*************************************************************
diff --git a/src/map/if/ifReduce.c b/src/map/if/ifReduce.c
index 2e2a6d81..26989b8c 100644
--- a/src/map/if/ifReduce.c
+++ b/src/map/if/ifReduce.c
@@ -156,17 +156,17 @@ void If_ManImproveNodeExpand( If_Man_t * p, If_Obj_t * pObj, int nLimit, Vec_Ptr
// get the delay
DelayOld = pCut->Delay;
// get the area
- AreaBef = If_CutAreaRefed( p, pCut, 100000 );
+ AreaBef = If_CutAreaRefed( p, pCut, IF_INFINITY );
// if ( AreaBef == 1 )
// return;
// the cut is non-trivial
If_ManImproveNodePrepare( p, pObj, nLimit, vFront, vFrontOld, vVisited );
// iteratively modify the cut
- If_CutDeref( p, pCut, 100000 );
+ If_CutDeref( p, pCut, IF_INFINITY );
CostBef = If_ManImproveCutCost( p, vFront );
If_ManImproveNodeFaninCompact( p, pObj, nLimit, vFront, vVisited );
CostAft = If_ManImproveCutCost( p, vFront );
- If_CutRef( p, pCut, 100000 );
+ If_CutRef( p, pCut, IF_INFINITY );
assert( CostBef >= CostAft );
// clean up
Vec_PtrForEachEntry( vVisited, pFanin, i )
@@ -175,11 +175,11 @@ void If_ManImproveNodeExpand( If_Man_t * p, If_Obj_t * pObj, int nLimit, Vec_Ptr
If_ManImproveNodeUpdate( p, pObj, vFront );
pCut->Delay = If_CutDelay( p, pCut );
// get the new area
- AreaAft = If_CutAreaRefed( p, pCut, 100000 );
+ AreaAft = If_CutAreaRefed( p, pCut, IF_INFINITY );
if ( AreaAft > AreaBef || pCut->Delay > pObj->Required + p->fEpsilon )
{
If_ManImproveNodeUpdate( p, pObj, vFrontOld );
- AreaAft = If_CutAreaRefed( p, pCut, 100000 );
+ AreaAft = If_CutAreaRefed( p, pCut, IF_INFINITY );
assert( AreaAft == AreaBef );
pCut->Delay = DelayOld;
}
@@ -257,13 +257,13 @@ void If_ManImproveNodeUpdate( If_Man_t * p, If_Obj_t * pObj, Vec_Ptr_t * vFront
int i;
pCut = If_ObjCutBest(pObj);
// deref node's cut
- If_CutDeref( p, pCut, 10000 );
+ If_CutDeref( p, pCut, IF_INFINITY );
// update the node's cut
pCut->nLeaves = Vec_PtrSize(vFront);
Vec_PtrForEachEntry( vFront, pFanin, i )
pCut->pLeaves[i] = pFanin->Id;
// ref the new cut
- If_CutRef( p, pCut, 10000 );
+ If_CutRef( p, pCut, IF_INFINITY );
}
@@ -506,9 +506,9 @@ void If_ManImproveNodeReduce( If_Man_t * p, If_Obj_t * pObj, int nLimit )
// deref the cut if the node is refed
if ( pObj->nRefs > 0 )
- If_CutDeref( p, pCut, 100000 );
+ If_CutDeref( p, pCut, IF_INFINITY );
// get the area
- AreaBef = If_CutAreaDerefed( p, pCut, 100000 );
+ AreaBef = If_CutAreaDerefed( p, pCut, IF_INFINITY );
// get the fanin support
if ( pFanin0->nRefs > 2 && pCut0->Delay < pObj->Required + p->fEpsilon )
// if ( pSupp0->nRefs > 0 && pSupp0->Delay < pSupp->DelayR ) // this leads to 2% worse results
@@ -534,7 +534,7 @@ void If_ManImproveNodeReduce( If_Man_t * p, If_Obj_t * pObj, int nLimit )
if ( RetValue )
{
pCutR->Delay = If_CutDelay( p, pCutR );
- AreaAft = If_CutAreaDerefed( p, pCutR, 100000 );
+ AreaAft = If_CutAreaDerefed( p, pCutR, IF_INFINITY );
// update the best cut
if ( AreaAft < AreaBef - p->fEpsilon && pCutR->Delay < pObj->Required + p->fEpsilon )
If_CutCopy( pCut, pCutR );
@@ -543,7 +543,7 @@ void If_ManImproveNodeReduce( If_Man_t * p, If_Obj_t * pObj, int nLimit )
pCut->Delay = If_CutDelay( p, pCut );
// ref the cut if the node is refed
if ( pObj->nRefs > 0 )
- If_CutRef( p, pCut, 100000 );
+ If_CutRef( p, pCut, IF_INFINITY );
}
/**Function*************************************************************
diff --git a/src/map/mio/mioFunc.c b/src/map/mio/mioFunc.c
index 78c98fbe..21a078f9 100644
--- a/src/map/mio/mioFunc.c
+++ b/src/map/mio/mioFunc.c
@@ -213,7 +213,7 @@ int Mio_GateParseFormula( Mio_Gate_t * pGate )
Cudd_Ref( pGate->bFunc );
// derive the cover (SOP)
- pGate->pSop = Abc_ConvertBddToSop( pGate->pLib->pMmFlex, dd, pGate->bFunc, pGate->bFunc, nPins, pGate->pLib->vCube, -1 );
+ pGate->pSop = Abc_ConvertBddToSop( pGate->pLib->pMmFlex, dd, pGate->bFunc, pGate->bFunc, nPins, 0, pGate->pLib->vCube, -1 );
return 0;
}