summaryrefslogtreecommitdiffstats
path: root/src/map/scl/sclUpsize.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-08-09 19:47:58 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-08-09 19:47:58 -0700
commitd4ad3b4156dd2d4fa6d56573e606b05c2d2d97f9 (patch)
tree790001997d041e6fa33da6b4b2bf08f431e111f4 /src/map/scl/sclUpsize.c
parent633db0f4ad4b4d2dc7a29d26eff752f1861eccdd (diff)
downloadabc-d4ad3b4156dd2d4fa6d56573e606b05c2d2d97f9.tar.gz
abc-d4ad3b4156dd2d4fa6d56573e606b05c2d2d97f9.tar.bz2
abc-d4ad3b4156dd2d4fa6d56573e606b05c2d2d97f9.zip
Improvements to buffering and sizing.
Diffstat (limited to 'src/map/scl/sclUpsize.c')
-rw-r--r--src/map/scl/sclUpsize.c39
1 files changed, 33 insertions, 6 deletions
diff --git a/src/map/scl/sclUpsize.c b/src/map/scl/sclUpsize.c
index a3294ebb..9f9b23ce 100644
--- a/src/map/scl/sclUpsize.c
+++ b/src/map/scl/sclUpsize.c
@@ -436,7 +436,24 @@ int Abc_SclFindBypasses( SC_Man * p, Vec_Int_t * vPathNodes, int Ratio, int Notc
pFanout = Abc_NtkObj( p->pNtk, Vec_IntEntry(p->vBestFans, iNode) );
pBuf = Abc_NtkObj( p->pNtk, iNode );
pFanin = Abc_ObjFanin0(pBuf);
- assert( p->pNtk->vPhases == NULL ); // problem!
+ if ( p->pNtk->vPhases == NULL )
+ {
+ // update fanin
+ if ( Abc_SclIsInv(pBuf) )
+ {
+ if ( !Abc_ObjIsNode(pFanin) || !Abc_SclIsInv(pFanin) )
+ {
+ assert( 0 );
+ continue;
+ }
+ pFanin = Abc_ObjFanin0(pFanin);
+ if ( !Abc_ObjIsNode(pFanin) )
+ {
+ assert( 0 );
+ continue;
+ }
+ }
+ }
if ( pFanout->fMarkB || pBuf->fMarkB || pFanin->fMarkB )
continue;
pFanout->fMarkB = 1;
@@ -451,21 +468,28 @@ int Abc_SclFindBypasses( SC_Man * p, Vec_Int_t * vPathNodes, int Ratio, int Notc
else if ( dGainBest2 > 2*Vec_FltEntry(p->vNode2Gain, iNode) )
break;
// redirect
+ Abc_SclUpdateLoadSplit( p, pBuf, pFanout );
+ Abc_SclAddWireLoad( p, pBuf, 1 );
+ Abc_SclAddWireLoad( p, pFanin, 1 );
Abc_ObjPatchFanin( pFanout, pBuf, pFanin );
+ Abc_SclAddWireLoad( p, pBuf, 0 );
+ Abc_SclAddWireLoad( p, pFanin, 0 );
+ Abc_SclTimeIncUpdateLevel( pFanout );
// remember
Vec_IntPush( p->vUpdates2, Abc_ObjId(pFanout) );
Vec_IntPush( p->vUpdates2, Abc_ObjId(pFanin) );
Vec_IntPush( p->vUpdates2, Abc_ObjId(pBuf) );
- // find old and new gates
+ // update cell
pCellOld = Abc_SclObjCell( pFanin );
pCellNew = SC_LibCell( p->pLib, Vec_IntEntry(p->vNode2Gate, iNode) );
- // update cell
p->SumArea += pCellNew->area - pCellOld->area;
Abc_SclObjSetCell( pFanin, pCellNew );
Abc_SclUpdateLoad( p, pFanin, pCellOld, pCellNew );
// record the update
Vec_IntPush( p->vUpdates, Abc_ObjId(pFanin) );
Vec_IntPush( p->vUpdates, pCellNew->Id );
+ Abc_SclTimeIncInsert( p, pFanout );
+ Abc_SclTimeIncInsert( p, pBuf );
Abc_SclTimeIncInsert( p, pFanin );
// remember when this node was upsized
Vec_IntWriteEntry( p->vNodeIter, Abc_ObjId(pFanout), -1 );
@@ -691,11 +715,11 @@ void Abc_SclUndoRecentChanges( Abc_Ntk_t * pNtk, Vec_Int_t * vTrans )
Abc_Obj_t * pFanout = Abc_NtkObj( pNtk, Vec_IntEntry(vTrans, 3*i+0) );
Abc_Obj_t * pFanin = Abc_NtkObj( pNtk, Vec_IntEntry(vTrans, 3*i+1) );
Abc_Obj_t * pObj = Abc_NtkObj( pNtk, Vec_IntEntry(vTrans, 3*i+2) );
+ // we do not update load here because times will be recomputed
Abc_ObjPatchFanin( pFanout, pFanin, pObj );
-
+ Abc_SclTimeIncUpdateLevel( pFanout );
// printf( "Node %6d Redir fanout %6d from fanin %6d. \n",
// Abc_ObjId(pObj), Abc_ObjId(pFanout), Abc_ObjId(pFanin) );
-
// update polarity
if ( pNtk->vPhases && Abc_SclIsInv(pObj) )
Abc_NodeInvUpdateObjFanoutPolarity( pObj, pFanout );
@@ -902,8 +926,11 @@ void Abc_SclUpsizePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, SC_SizePars * pPars
if ( pPars->fUseDept )
{
vTFO = Vec_IntAlloc( 0 );
- if ( p->nIncUpdates )
+ if ( Vec_IntSize(p->vChanged) )//&& pPars->BypassFreq == 0 )
+ {
+// Abc_SclComputeLoad( p );
Abc_SclTimeIncUpdate( p );
+ }
else
Abc_SclTimeNtkRecompute( p, NULL, NULL, pPars->fUseDept, 0 );
}