summaryrefslogtreecommitdiffstats
path: root/src/map
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2012-05-20 17:27:53 +0700
committerAlan Mishchenko <alanmi@berkeley.edu>2012-05-20 17:27:53 +0700
commitc6af9094c092170b14d735097cdf805b90105287 (patch)
tree7cad398e7cc88aa2e07fd8a0856a3e25b1333c0f /src/map
parent38214f01c20227cfca6617c4b2ac55e090ec47fa (diff)
downloadabc-c6af9094c092170b14d735097cdf805b90105287.tar.gz
abc-c6af9094c092170b14d735097cdf805b90105287.tar.bz2
abc-c6af9094c092170b14d735097cdf805b90105287.zip
Changing 'if' to allow for delay optimization on sequential paths only.
Diffstat (limited to 'src/map')
-rw-r--r--src/map/if/if.h15
-rw-r--r--src/map/if/ifSeq.c6
-rw-r--r--src/map/if/ifUtil.c4
3 files changed, 13 insertions, 12 deletions
diff --git a/src/map/if/if.h b/src/map/if/if.h
index 8c1ab975..4c933a96 100644
--- a/src/map/if/if.h
+++ b/src/map/if/if.h
@@ -129,7 +129,8 @@ struct If_Par_t_
int fUseCnfs; // use local CNFs as a cost function
int fUseMv; // use local MV-SOPs as a cost function
int fUseAdders; // timing model for adders
- int nLatches; // the number of latches in seq mapping
+ int nLatchesCi; // the number of latches in seq mapping
+ int nLatchesCo; // the number of latches in seq mapping
int fLiftLeaves; // shift the leaves for seq mapping
int fUseCoAttrs; // use CO attributes
If_Lib_t * pLutLib; // the LUT library
@@ -307,8 +308,8 @@ static inline int If_ManObjNum( If_Man_t * p ) { r
static inline If_Obj_t * If_ManConst1( If_Man_t * p ) { return p->pConst1; }
static inline If_Obj_t * If_ManCi( If_Man_t * p, int i ) { return (If_Obj_t *)Vec_PtrEntry( p->vCis, i ); }
static inline If_Obj_t * If_ManCo( If_Man_t * p, int i ) { return (If_Obj_t *)Vec_PtrEntry( p->vCos, i ); }
-static inline If_Obj_t * If_ManLi( If_Man_t * p, int i ) { return (If_Obj_t *)Vec_PtrEntry( p->vCos, If_ManCoNum(p) - p->pPars->nLatches + i ); }
-static inline If_Obj_t * If_ManLo( If_Man_t * p, int i ) { return (If_Obj_t *)Vec_PtrEntry( p->vCis, If_ManCiNum(p) - p->pPars->nLatches + i ); }
+static inline If_Obj_t * If_ManLi( If_Man_t * p, int i ) { return (If_Obj_t *)Vec_PtrEntry( p->vCos, If_ManCoNum(p) - p->pPars->nLatchesCo + i ); }
+static inline If_Obj_t * If_ManLo( If_Man_t * p, int i ) { return (If_Obj_t *)Vec_PtrEntry( p->vCis, If_ManCiNum(p) - p->pPars->nLatchesCi + i ); }
static inline If_Obj_t * If_ManObj( If_Man_t * p, int i ) { return (If_Obj_t *)Vec_PtrEntry( p->vObjs, i ); }
static inline int If_ObjIsConst1( If_Obj_t * pObj ) { return pObj->Type == IF_CONST1; }
@@ -380,15 +381,15 @@ static inline void If_AndClear( If_And_t * pNode ) { *
Vec_PtrForEachEntry( If_Obj_t *, p->vCos, pObj, i )
// iterator over the primary inputs
#define If_ManForEachPi( p, pObj, i ) \
- Vec_PtrForEachEntryStop( If_Obj_t *, p->vCis, pObj, i, If_ManCiNum(p) - p->pPars->nLatches )
+ Vec_PtrForEachEntryStop( If_Obj_t *, p->vCis, pObj, i, If_ManCiNum(p) - p->pPars->nLatchesCi )
// iterator over the primary outputs
#define If_ManForEachPo( p, pObj, i ) \
- Vec_PtrForEachEntryStop( If_Obj_t *, p->vCos, pObj, i, If_ManCoNum(p) - p->pPars->nLatches )
+ Vec_PtrForEachEntryStop( If_Obj_t *, p->vCos, pObj, i, If_ManCoNum(p) - p->pPars->nLatchesCo )
// iterator over the latches
#define If_ManForEachLatchInput( p, pObj, i ) \
- Vec_PtrForEachEntryStart( If_Obj_t *, p->vCos, pObj, i, If_ManCoNum(p) - p->pPars->nLatches )
+ Vec_PtrForEachEntryStart( If_Obj_t *, p->vCos, pObj, i, If_ManCoNum(p) - p->pPars->nLatchesCo )
#define If_ManForEachLatchOutput( p, pObj, i ) \
- Vec_PtrForEachEntryStart( If_Obj_t *, p->vCis, pObj, i, If_ManCiNum(p) - p->pPars->nLatches )
+ Vec_PtrForEachEntryStart( If_Obj_t *, p->vCis, pObj, i, If_ManCiNum(p) - p->pPars->nLatchesCi )
// iterator over all objects in topological order
#define If_ManForEachObj( p, pObj, i ) \
Vec_PtrForEachEntry( If_Obj_t *, p->vObjs, pObj, i )
diff --git a/src/map/if/ifSeq.c b/src/map/if/ifSeq.c
index eaa33e92..6cfb5131 100644
--- a/src/map/if/ifSeq.c
+++ b/src/map/if/ifSeq.c
@@ -50,7 +50,7 @@ void If_ManPrepareMappingSeq( If_Man_t * p )
int i;
// link the latch outputs (CIs) directly to the drivers of latch inputs (COs)
- for ( i = 0; i < p->pPars->nLatches; i++ )
+ for ( i = 0; i < p->pPars->nLatchesCi; i++ )
{
pObjLi = If_ManLi( p, i );
pObjLo = If_ManLo( p, i );
@@ -98,13 +98,13 @@ Vec_Ptr_t * If_ManCollectLatches( If_Man_t * p )
If_Obj_t * pObj;
int i;
// collect latches
- vLatches = Vec_PtrAlloc( p->pPars->nLatches );
+ vLatches = Vec_PtrAlloc( p->pPars->nLatchesCi );
If_ManForEachLatchOutput( p, pObj, i )
If_ManCollectLatches_rec( pObj, vLatches );
// clean marks
Vec_PtrForEachEntry( If_Obj_t *, vLatches, pObj, i )
pObj->fMark = 0;
- assert( Vec_PtrSize(vLatches) == p->pPars->nLatches );
+ assert( Vec_PtrSize(vLatches) == p->pPars->nLatchesCi );
return vLatches;
}
diff --git a/src/map/if/ifUtil.c b/src/map/if/ifUtil.c
index b1ec7169..dee7ec3c 100644
--- a/src/map/if/ifUtil.c
+++ b/src/map/if/ifUtil.c
@@ -104,7 +104,7 @@ float If_ManDelayMax( If_Man_t * p, int fSeq )
If_Obj_t * pObj;
float DelayBest;
int i;
- if ( p->pPars->fLatchPaths && p->pPars->nLatches == 0 )
+ if ( p->pPars->fLatchPaths && (p->pPars->nLatchesCi == 0 || p->pPars->nLatchesCo == 0) )
{
Abc_Print( 0, "Delay optimization of latch path is not performed because there is no latches.\n" );
p->pPars->fLatchPaths = 0;
@@ -112,7 +112,7 @@ float If_ManDelayMax( If_Man_t * p, int fSeq )
DelayBest = -IF_FLOAT_LARGE;
if ( fSeq )
{
- assert( p->pPars->nLatches > 0 );
+ assert( p->pPars->nLatchesCi > 0 );
If_ManForEachPo( p, pObj, i )
if ( DelayBest < If_ObjArrTime(If_ObjFanin0(pObj)) )
DelayBest = If_ObjArrTime(If_ObjFanin0(pObj));