summaryrefslogtreecommitdiffstats
path: root/src/opt
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2017-01-02 19:18:55 +0700
committerAlan Mishchenko <alanmi@berkeley.edu>2017-01-02 19:18:55 +0700
commit378bb416462a0ce10ecb1964d8d9b424e762d7b5 (patch)
tree6effce6e947d2efa8a2de0e439ff719fd1d31ee8 /src/opt
parent51e3a7c2776e671738b5e6a679214df46fe205ee (diff)
downloadabc-378bb416462a0ce10ecb1964d8d9b424e762d7b5.tar.gz
abc-378bb416462a0ce10ecb1964d8d9b424e762d7b5.tar.bz2
abc-378bb416462a0ce10ecb1964d8d9b424e762d7b5.zip
Updates to delay optimization project.
Diffstat (limited to 'src/opt')
-rw-r--r--src/opt/sbd/sbdCore.c2
-rw-r--r--src/opt/sbd/sbdPath.c18
2 files changed, 10 insertions, 10 deletions
diff --git a/src/opt/sbd/sbdCore.c b/src/opt/sbd/sbdCore.c
index 63dc51ab..8b1de4aa 100644
--- a/src/opt/sbd/sbdCore.c
+++ b/src/opt/sbd/sbdCore.c
@@ -1992,7 +1992,7 @@ void Sbd_ManDeriveMapping( Sbd_Man_t * p, Gia_Man_t * pNew )
Vec_IntPushUniqueOrder( vLeaves, iObjNew );
}
assert( Vec_IntSize(vLeaves) <= p->pPars->nLutSize );
- assert( Vec_IntSize(vLeaves) > 1 );
+ //assert( Vec_IntSize(vLeaves) > 1 );
pCutNew[0] = Vec_IntSize(vLeaves);
memcpy( pCutNew+1, Vec_IntArray(vLeaves), sizeof(int) * Vec_IntSize(vLeaves) );
}
diff --git a/src/opt/sbd/sbdPath.c b/src/opt/sbd/sbdPath.c
index 7392516d..a2b1a9b0 100644
--- a/src/opt/sbd/sbdPath.c
+++ b/src/opt/sbd/sbdPath.c
@@ -52,7 +52,7 @@ int Sbc_ManAddInternalToPath_rec( Gia_Man_t * p, int iObj, Vec_Bit_t * vPath )
Gia_ObjSetTravIdCurrentId(p, iObj);
pObj = Gia_ManObj( p, iObj );
if ( Gia_ObjIsCi(pObj) )
- return 0;
+ return Vec_BitEntry(vPath, iObj);
assert( Gia_ObjIsAnd(pObj) );
Gia_LutForEachFanin( p, iObj, iFan, k )
Value |= Sbc_ManAddInternalToPath_rec( p, iFan, vPath );
@@ -85,13 +85,14 @@ void Sbc_ManAddInternalToPath( Gia_Man_t * p, Vec_Bit_t * vPath )
SeeAlso []
***********************************************************************/
-void Sbc_ManCriticalPath_rec( Gia_Man_t * p, int * pLevels, int iObj, int LevelFan, Vec_Bit_t * vPath )
+void Sbc_ManCriticalPath_rec( Gia_Man_t * p, int * pLevels, int iObj, int LevelFan, Vec_Bit_t * vPath, int Slack )
{
Gia_Obj_t * pObj; int k, iFan;
if ( Gia_ObjIsTravIdCurrentId(p, iObj) )
return;
Gia_ObjSetTravIdCurrentId(p, iObj);
pObj = Gia_ManObj( p, iObj );
+ Vec_BitWriteEntry( vPath, iObj, 1 );
if ( Gia_ObjIsCi(pObj) )
{
Tim_Man_t * pManTime = (Tim_Man_t *)p->pManTime;
@@ -104,21 +105,20 @@ void Sbc_ManCriticalPath_rec( Gia_Man_t * p, int * pLevels, int iObj, int LevelF
{
Gia_Obj_t * pCo = Gia_ManCo( p, curCo + k );
int iDriver = Gia_ObjFaninId0p( p, pCo );
- if ( (pLevels[iDriver] >= LevelFan-1) && iDriver )
- Sbc_ManCriticalPath_rec( p, pLevels, iDriver, pLevels[iDriver], vPath );
+ if ( (pLevels[iDriver]+Slack >= LevelFan-1) && iDriver )
+ Sbc_ManCriticalPath_rec( p, pLevels, iDriver, pLevels[iDriver], vPath, Abc_MaxInt(0, pLevels[iDriver]+Slack-(LevelFan-1)) );
}
}
return;
}
assert( Gia_ObjIsAnd(pObj) );
- Vec_BitWriteEntry( vPath, iObj, 1 );
Gia_LutForEachFanin( p, iObj, iFan, k )
- if ( pLevels[iFan] >= LevelFan-1 )
- Sbc_ManCriticalPath_rec( p, pLevels, iFan, pLevels[iFan], vPath );
+ if ( pLevels[iFan]+Slack >= LevelFan-1 )
+ Sbc_ManCriticalPath_rec( p, pLevels, iFan, pLevels[iFan], vPath, Abc_MaxInt(0, pLevels[iFan]+Slack-(LevelFan-1)) );
}
Vec_Bit_t * Sbc_ManCriticalPath( Gia_Man_t * p )
{
- int * pLevels = NULL, k, iDriver;
+ int * pLevels = NULL, k, iDriver, Slack = 1;
int nLevels = p->pManTime ? Gia_ManLutLevelWithBoxes(p) : Gia_ManLutLevel(p, &pLevels);
Vec_Bit_t * vPath = Vec_BitStart( Gia_ManObjNum(p) );
if ( p->pManTime )
@@ -126,7 +126,7 @@ Vec_Bit_t * Sbc_ManCriticalPath( Gia_Man_t * p )
Gia_ManIncrementTravId( p );
Gia_ManForEachCoDriverId( p, iDriver, k )
if ( (pLevels[iDriver] == nLevels) && iDriver )
- Sbc_ManCriticalPath_rec( p, pLevels, iDriver, pLevels[iDriver], vPath );
+ Sbc_ManCriticalPath_rec( p, pLevels, iDriver, pLevels[iDriver], vPath, Slack );
if ( !p->pManTime )
ABC_FREE( pLevels );
Sbc_ManAddInternalToPath( p, vPath );