Commit d948f725 by Alan Mishchenko

Updates to delay optimization project.

parent 26eb3f36
......@@ -2009,6 +2009,7 @@ void Sbd_NtkPerformOne( Sbd_Man_t * p, int Pivot )
Vec_IntWriteEntry( p->vMirrors, Pivot, RetValue );
if ( p->pPars->fVerbose ) printf( "Node %5d: Detected constant %d.\n", Pivot, RetValue );
}
/*
else if ( p->pPars->nLutNum >= 1 && Sbd_ManExplore2( p, Pivot, &Truth ) )
{
int i;
......@@ -2020,6 +2021,7 @@ void Sbd_NtkPerformOne( Sbd_Man_t * p, int Pivot )
Sbd_ManImplement2( p, Pivot, 1, Strs );
if ( p->pPars->fVerbose ) printf( "Node %5d: Detected LUT%d\n", Pivot, p->pPars->nLutSize );
}
*/
else if ( p->pPars->nLutNum >= 2 && Sbd_ManExplore3( p, Pivot, &nStrs, Strs ) )
{
Sbd_ManImplement2( p, Pivot, nStrs, Strs );
......
......@@ -336,36 +336,6 @@ int Sbd_ManCutServerFirst( Sbd_Srv_t * p, int iObj, int * pLeaves )
return Vec_IntSize(p->vCut);
}
#if 0
// recompute the cut
Vec_IntClear( p->vCut );
Gia_ManIncrementTravId( p->pGia );
RetValue = Sbd_ManCutCollect_rec( p->pGia, p->vMirrors, iObj, LevStop-1, p->vLutLevs, p->vCut );
if ( RetValue == 0 ) // cannot build delay-improving cut
return -1;
// check if the current cut is good
Vec_IntSort( p->vCut, 0 );
/*
Sbd_ManCutReload( p->vMirrors, p->vLutLevs, LevStop, p->vCut, p->vCutTop, p->vCutBot );
if ( Vec_IntSize(p->vCut) <= p->nCutSize && Vec_IntSize(p->vCutTop) <= p->nLutSize-1 )
{
//printf( "%d ", Vec_IntSize(p->vCut) );
memcpy( pLeaves, Vec_IntArray(p->vCut), sizeof(int) * Vec_IntSize(p->vCut) );
return Vec_IntSize(p->vCut);
}
*/
// try to expand the cut
Sbd_ManCutExpand( p->pGia, p->vMirrors, p->vLutLevs, p->vCut );
Sbd_ManCutReload( p->vMirrors, p->vLutLevs, LevStop, p->vCut, p->vCutTop, p->vCutBot );
if ( Vec_IntSize(p->vCut) <= p->nCutSize && Vec_IntSize(p->vCutTop) <= p->nLutSize-1 )
{
//printf( "2=(%d,%d) ", Vec_IntSize(p->vCutTop), Vec_IntSize(p->vCutBot) );
//printf( "%d ", Vec_IntSize(p->vCut) );
memcpy( pLeaves, Vec_IntArray(p->vCut), sizeof(int) * Vec_IntSize(p->vCut) );
return Vec_IntSize(p->vCut);
}
#endif
// try to reduce the topmost
Vec_IntClear( p->vCut0 );
Vec_IntAppend( p->vCut0, p->vCut );
......@@ -420,6 +390,35 @@ int Sbd_ManCutServerFirst( Sbd_Srv_t * p, int iObj, int * pLeaves )
}
}
}
// recompute the cut
Vec_IntClear( p->vCut );
Gia_ManIncrementTravId( p->pGia );
RetValue = Sbd_ManCutCollect_rec( p->pGia, p->vMirrors, iObj, LevStop-1, p->vLutLevs, p->vCut );
if ( RetValue == 0 ) // cannot build delay-improving cut
return -1;
// check if the current cut is good
Vec_IntSort( p->vCut, 0 );
/*
Sbd_ManCutReload( p->vMirrors, p->vLutLevs, LevStop, p->vCut, p->vCutTop, p->vCutBot );
if ( Vec_IntSize(p->vCut) <= p->nCutSize && Vec_IntSize(p->vCutTop) <= p->nLutSize-1 )
{
//printf( "%d ", Vec_IntSize(p->vCut) );
memcpy( pLeaves, Vec_IntArray(p->vCut), sizeof(int) * Vec_IntSize(p->vCut) );
return Vec_IntSize(p->vCut);
}
*/
// try to expand the cut
Sbd_ManCutExpand( p->pGia, p->vMirrors, p->vLutLevs, p->vCut );
Sbd_ManCutReload( p->vMirrors, p->vLutLevs, LevStop, p->vCut, p->vCutTop, p->vCutBot );
if ( Vec_IntSize(p->vCut) <= p->nCutSize && Vec_IntSize(p->vCutTop) <= p->nLutSize-1 )
{
//printf( "2=(%d,%d) ", Vec_IntSize(p->vCutTop), Vec_IntSize(p->vCutBot) );
//printf( "%d ", Vec_IntSize(p->vCut) );
memcpy( pLeaves, Vec_IntArray(p->vCut), sizeof(int) * Vec_IntSize(p->vCut) );
return Vec_IntSize(p->vCut);
}
return -1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment