ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
sclUpsize.c
Go to the documentation of this file.
1
20
21#include "sclSize.h"
22
24
25
29
33
45void Abc_SclFindTFO_rec( Abc_Obj_t * pObj, Vec_Int_t * vNodes, Vec_Int_t * vCos )
46{
47 Abc_Obj_t * pNext;
48 int i;
49 if ( Abc_NodeIsTravIdCurrent( pObj ) )
50 return;
51 Abc_NodeSetTravIdCurrent( pObj );
52 if ( Abc_ObjIsCo(pObj) )
53 {
54 Vec_IntPush( vCos, Abc_ObjId(pObj) );
55 return;
56 }
57 assert( Abc_ObjIsNode(pObj) );
58 Abc_ObjForEachFanout( pObj, pNext, i )
59 Abc_SclFindTFO_rec( pNext, vNodes, vCos );
60 if ( Abc_ObjFaninNum(pObj) > 0 )
61 Vec_IntPush( vNodes, Abc_ObjId(pObj) );
62}
64{
65 Vec_Int_t * vNodes, * vCos;
66 Abc_Obj_t * pObj, * pFanin;
67 int i, k;
68 assert( Vec_IntSize(vPath) > 0 );
69 vCos = Vec_IntAlloc( 100 );
70 vNodes = Vec_IntAlloc( 100 );
71 // collect nodes in the TFO
72 Abc_NtkIncrementTravId( p );
73 Abc_NtkForEachObjVec( vPath, p, pObj, i )
74 Abc_ObjForEachFanin( pObj, pFanin, k )
75 if ( Abc_ObjIsNode(pFanin) )
76 Abc_SclFindTFO_rec( pFanin, vNodes, vCos );
77 // reverse order
78 Vec_IntReverseOrder( vNodes );
79// Vec_IntSort( vNodes, 0 );
80//Vec_IntPrint( vNodes );
81//Vec_IntPrint( vCos );
82 Vec_IntAppend( vNodes, vCos );
83 Vec_IntFree( vCos );
84 return vNodes;
85}
86
99{
100 float fMaxArr = Abc_SclReadMaxDelay( p ) * (100.0 - Window) / 100.0;
101 Vec_Int_t * vPivots;
102 Abc_Obj_t * pObj;
103 int i;
104 vPivots = Vec_IntAlloc( 100 );
105 Abc_NtkForEachCo( p->pNtk, pObj, i )
106 if ( Abc_SclObjTimeMax(p, pObj) >= fMaxArr )
107 Vec_IntPush( vPivots, Abc_ObjId(pObj) );
108 assert( Vec_IntSize(vPivots) > 0 );
109 return vPivots;
110}
111
123void Abc_SclFindCriticalNodeWindow_rec( SC_Man * p, Abc_Obj_t * pObj, Vec_Int_t * vPath, float fSlack, int fDept )
124{
125 Abc_Obj_t * pNext;
126 float fArrMax, fSlackFan;
127 int i;
128 if ( Abc_ObjIsCi(pObj) )
129 return;
130 if ( Abc_NodeIsTravIdCurrent( pObj ) )
131 return;
132 Abc_NodeSetTravIdCurrent( pObj );
133 assert( Abc_ObjIsNode(pObj) );
134 // compute the max arrival time of the fanins
135 if ( fDept )
136// fArrMax = p->pSlack[Abc_ObjId(pObj)];
137 fArrMax = Abc_SclObjGetSlack(p, pObj, p->MaxDelay);
138 else
139 fArrMax = Abc_SclGetMaxDelayNodeFanins( p, pObj );
140// assert( fArrMax >= -1 );
141 fArrMax = Abc_MaxFloat( fArrMax, 0 );
142 // traverse all fanins whose arrival times are within a window
143 Abc_ObjForEachFanin( pObj, pNext, i )
144 {
145 if ( Abc_ObjIsCi(pNext) || Abc_ObjFaninNum(pNext) == 0 )
146 continue;
147 assert( Abc_ObjIsNode(pNext) );
148 if ( fDept )
149// fSlackFan = fSlack - (p->pSlack[Abc_ObjId(pNext)] - fArrMax);
150 fSlackFan = fSlack - (Abc_SclObjGetSlack(p, pNext, p->MaxDelay) - fArrMax);
151 else
152 fSlackFan = fSlack - (fArrMax - Abc_SclObjTimeMax(p, pNext));
153 if ( fSlackFan >= 0 )
154 Abc_SclFindCriticalNodeWindow_rec( p, pNext, vPath, fSlackFan, fDept );
155 }
156 if ( Abc_ObjFaninNum(pObj) > 0 )
157 Vec_IntPush( vPath, Abc_ObjId(pObj) );
158}
159Vec_Int_t * Abc_SclFindCriticalNodeWindow( SC_Man * p, Vec_Int_t * vPathCos, int Window, int fDept )
160{
161 float fMaxArr = Abc_SclReadMaxDelay( p );
162 float fSlackMax = fMaxArr * Window / 100.0;
163 Vec_Int_t * vPath = Vec_IntAlloc( 100 );
164 Abc_Obj_t * pObj;
165 int i;
166 Abc_NtkIncrementTravId( p->pNtk );
167 Abc_NtkForEachObjVec( vPathCos, p->pNtk, pObj, i )
168 {
169 float fSlackThis = fSlackMax - (fMaxArr - Abc_SclObjTimeMax(p, pObj));
170 if ( fSlackThis >= 0 )
171 Abc_SclFindCriticalNodeWindow_rec( p, Abc_ObjFanin0(pObj), vPath, fSlackThis, fDept );
172 }
173 // label critical nodes
174 Abc_NtkForEachObjVec( vPathCos, p->pNtk, pObj, i )
175 pObj->fMarkA = 1;
176 Abc_NtkForEachObjVec( vPath, p->pNtk, pObj, i )
177 pObj->fMarkA = 1;
178 return vPath;
179}
181{
182 Abc_Obj_t * pObj;
183 int i;
184 Abc_NtkForEachObjVec( vPath, p->pNtk, pObj, i )
185 pObj->fMarkA = 0;
186}
188{
189 int RetValue;
190 Vec_Int_t * vPathPos, * vPathNodes;
191 vPathPos = Abc_SclFindCriticalCoWindow( p, 5 );
192 vPathNodes = Abc_SclFindCriticalNodeWindow( p, vPathPos, 5, 0 );
193 RetValue = Vec_IntSize(vPathNodes);
194 Abc_SclUnmarkCriticalNodeWindow( p, vPathNodes );
196 Vec_IntFree( vPathPos );
197 Vec_IntFree( vPathNodes );
198 return RetValue;
199}
200
201
213void Abc_SclFindNodesToUpdate( Abc_Obj_t * pPivot, Vec_Int_t ** pvNodes, Vec_Int_t ** pvEvals, Abc_Obj_t * pExtra )
214{
215 Abc_Ntk_t * p = Abc_ObjNtk(pPivot);
216 Abc_Obj_t * pObj, * pNext, * pNext2;
217 Vec_Int_t * vNodes = *pvNodes;
218 Vec_Int_t * vEvals = *pvEvals;
219 int i, k;
220 assert( Abc_ObjIsNode(pPivot) );
221 assert( pPivot->fMarkA );
222 // collect fanins, node, and fanouts
223 Vec_IntClear( vNodes );
224 Abc_ObjForEachFanin( pPivot, pNext, i )
225// if ( Abc_ObjIsNode(pNext) && Abc_ObjFaninNum(pNext) > 0 )
226 if ( Abc_ObjIsCi(pNext) || Abc_ObjFaninNum(pNext) > 0 )
227 Vec_IntPush( vNodes, Abc_ObjId(pNext) );
228 Vec_IntPush( vNodes, Abc_ObjId(pPivot) );
229 if ( pExtra )
230 Vec_IntPush( vNodes, Abc_ObjId(pExtra) );
231 Abc_ObjForEachFanout( pPivot, pNext, i )
232 if ( Abc_ObjIsNode(pNext) && pNext->fMarkA )
233 {
234 Vec_IntPush( vNodes, Abc_ObjId(pNext) );
235 Abc_ObjForEachFanout( pNext, pNext2, k )
236 if ( Abc_ObjIsNode(pNext2) && pNext2->fMarkA )
237 Vec_IntPush( vNodes, Abc_ObjId(pNext2) );
238 }
239 Vec_IntUniqify( vNodes );
240 // label nodes
241 Abc_NtkForEachObjVec( vNodes, p, pObj, i )
242 {
243 assert( pObj->fMarkB == 0 );
244 pObj->fMarkB = 1;
245 }
246 // collect nodes visible from the critical paths
247 Vec_IntClear( vEvals );
248 Abc_NtkForEachObjVec( vNodes, p, pObj, i )
249 Abc_ObjForEachFanout( pObj, pNext, k )
250 if ( pNext->fMarkA && !pNext->fMarkB )
251// if ( !pNext->fMarkB )
252 {
253 assert( pObj->fMarkB );
254 Vec_IntPush( vEvals, Abc_ObjId(pObj) );
255 break;
256 }
257 assert( Vec_IntSize(vEvals) > 0 );
258 // label nodes
259 Abc_NtkForEachObjVec( vNodes, p, pObj, i )
260 pObj->fMarkB = 0;
261}
262
263
275int Abc_SclFindBestCell( SC_Man * p, Abc_Obj_t * pObj, Vec_Int_t * vRecalcs, Vec_Int_t * vEvals, int Notches, int DelayGap, float * pGainBest )
276{
277 SC_Cell * pCellOld, * pCellNew;
278 float dGain, dGainBest;
279 int k, gateBest, NoChange = 0;
280 // save old gate, timing, fanin load
281 pCellOld = Abc_SclObjCell( pObj );
282 Abc_SclConeStore( p, vRecalcs );
283 Abc_SclEvalStore( p, vEvals );
284 Abc_SclLoadStore( p, pObj );
285 // try different gate sizes for this node
286 gateBest = -1;
287 dGainBest = -DelayGap;
288 SC_RingForEachCell( pCellOld, pCellNew, k )
289 {
290 if ( pCellNew == pCellOld )
291 continue;
292 if ( k > Notches )
293 break;
294 // set new cell
295 Abc_SclObjSetCell( pObj, pCellNew );
296 Abc_SclUpdateLoad( p, pObj, pCellOld, pCellNew );
297 // recompute timing
298 Abc_SclTimeCone( p, vRecalcs );
299 // set old cell
300 Abc_SclObjSetCell( pObj, pCellOld );
301 Abc_SclLoadRestore( p, pObj );
302 // save best gain
303 dGain = Abc_SclEvalPerform( p, vEvals );
304 if ( dGainBest < dGain )
305 {
306 dGainBest = dGain;
307 gateBest = pCellNew->Id;
308 NoChange = 1;
309 }
310 else if ( NoChange )
311 NoChange++;
312 if ( NoChange == 4 )
313 break;
314// printf( "%.2f ", dGain );
315 }
316// printf( "Best = %.2f ", dGainBest );
317// printf( "\n" );
318 // put back old cell and timing
319 Abc_SclObjSetCell( pObj, pCellOld );
320 Abc_SclConeRestore( p, vRecalcs );
321 *pGainBest = dGainBest;
322 return gateBest;
323}
324
336int Abc_SclFindBypasses( SC_Man * p, Vec_Int_t * vPathNodes, int Ratio, int Notches, int iIter, int DelayGap, int fVeryVerbose )
337{
338 SC_Cell * pCellOld, * pCellNew;
339 Vec_Ptr_t * vFanouts;
340 Vec_Int_t * vRecalcs, * vEvals;
341 Abc_Obj_t * pBuf, * pFanin, * pFanout, * pExtra;
342 int i, j, iNode, gateBest, gateBest2, fanBest, Counter = 0;
343 float dGainBest, dGainBest2;
344
345 // compute savings due to bypassing buffers
346 vFanouts = Vec_PtrAlloc( 100 );
347 vRecalcs = Vec_IntAlloc( 100 );
348 vEvals = Vec_IntAlloc( 100 );
349 Vec_QueClear( p->vNodeByGain );
350 Abc_NtkForEachObjVec( vPathNodes, p->pNtk, pBuf, i )
351 {
352 assert( pBuf->fMarkB == 0 );
353 if ( Abc_ObjFaninNum(pBuf) != 1 )
354 continue;
355 pFanin = Abc_ObjFanin0(pBuf);
356 if ( !Abc_ObjIsNode(pFanin) )
357 continue;
358 pExtra = NULL;
359 if ( p->pNtk->vPhases == NULL )
360 {
361 if ( Abc_SclIsInv(pBuf) )
362 {
363 if ( !Abc_SclIsInv(pFanin) )
364 continue;
365 pFanin = Abc_ObjFanin0(pFanin);
366 if ( !Abc_ObjIsNode(pFanin) )
367 continue;
368 pExtra = pBuf;
369 // we make pBuf and pFanin are in the same phase and pFanin is a node
370 }
371 }
372 // here we have pBuf and its fanin pFanin, which is a logic node
373 // compute nodes to recalculate timing and nodes to evaluate afterwards
374 Abc_SclFindNodesToUpdate( pFanin, &vRecalcs, &vEvals, pExtra );
375 assert( Vec_IntSize(vEvals) > 0 );
376 // consider fanouts of this node
377 fanBest = -1;
378 gateBest2 = -1;
379 dGainBest2 = 0;
380 Abc_NodeCollectFanouts( pBuf, vFanouts );
381 Vec_PtrForEachEntry( Abc_Obj_t *, vFanouts, pFanout, j )
382 {
383 // skip COs
384 if ( Abc_ObjIsCo(pFanout) )
385 continue;
386 // skip non-critical fanouts
387 if ( !pFanout->fMarkA )
388 continue;
389 // skip if fanin already has fanout as a fanout
390 if ( Abc_NodeFindFanin(pFanout, pFanin) >= 0 )
391 continue;
392 // skip if fanin already has fanout as a fanout
393 if ( pExtra && Abc_NodeFindFanin(pFanout, pExtra) >= 0 )
394 continue;
395 // prepare
396 Abc_SclLoadStore3( p, pBuf );
397 Abc_SclUpdateLoadSplit( p, pBuf, pFanout );
398 Abc_ObjPatchFanin( pFanout, pBuf, pFanin );
399 // size the fanin
400 gateBest = Abc_SclFindBestCell( p, pFanin, vRecalcs, vEvals, Notches, DelayGap, &dGainBest );
401 // unprepare
402 Abc_SclLoadRestore3( p, pBuf );
403 Abc_ObjPatchFanin( pFanout, pFanin, pBuf );
404 if ( gateBest == -1 )
405 continue;
406 // compare gain
407 if ( dGainBest2 < dGainBest )
408 {
409 dGainBest2 = dGainBest;
410 gateBest2 = gateBest;
411 fanBest = Abc_ObjId(pFanout);
412 }
413 }
414 // remember savings
415 if ( gateBest2 >= 0 )
416 {
417 assert( dGainBest2 > 0.0 );
418 Vec_FltWriteEntry( p->vNode2Gain, Abc_ObjId(pBuf), dGainBest2 );
419 Vec_IntWriteEntry( p->vNode2Gate, Abc_ObjId(pBuf), gateBest2 );
420 Vec_QuePush( p->vNodeByGain, Abc_ObjId(pBuf) );
421 Vec_IntWriteEntry( p->vBestFans, Abc_ObjId(pBuf), fanBest );
422 }
423// if ( ++Counter == 17 )
424// break;
425 }
426 Vec_PtrFree( vFanouts );
427 Vec_IntFree( vRecalcs );
428 Vec_IntFree( vEvals );
429 if ( Vec_QueSize(p->vNodeByGain) == 0 )
430 return 0;
431 if ( fVeryVerbose )
432 printf( "\n" );
433
434 // accept changes for that are half above the average and do not overlap
435 Counter = 0;
436 dGainBest2 = -1;
437 vFanouts = Vec_PtrAlloc( 100 );
438 while ( Vec_QueSize(p->vNodeByGain) )
439 {
440 iNode = Vec_QuePop(p->vNodeByGain);
441 pFanout = Abc_NtkObj( p->pNtk, Vec_IntEntry(p->vBestFans, iNode) );
442 pBuf = Abc_NtkObj( p->pNtk, iNode );
443 pFanin = Abc_ObjFanin0(pBuf);
444 if ( pFanout->fMarkB || pBuf->fMarkB )
445 continue;
446 if ( p->pNtk->vPhases == NULL )
447 {
448 // update fanin
449 if ( Abc_SclIsInv(pBuf) )
450 {
451 if ( !Abc_SclIsInv(pFanin) )
452 {
453 assert( 0 );
454 continue;
455 }
456 pFanin = Abc_ObjFanin0(pFanin);
457 if ( !Abc_ObjIsNode(pFanin) )
458 {
459 assert( 0 );
460 continue;
461 }
462 }
463 }
464 if ( pFanin->fMarkB )
465 continue;
466 pFanout->fMarkB = 1;
467 pBuf->fMarkB = 1;
468 pFanin->fMarkB = 1;
469 Vec_PtrPush( vFanouts, pFanout );
470 Vec_PtrPush( vFanouts, pBuf );
471 Vec_PtrPush( vFanouts, pFanin );
472 // remember gain
473 if ( dGainBest2 == -1 )
474 dGainBest2 = Vec_FltEntry(p->vNode2Gain, iNode);
475// else if ( dGainBest2 > 2*Vec_FltEntry(p->vNode2Gain, iNode) )
476// break;
477 // redirect
478 Abc_SclUpdateLoadSplit( p, pBuf, pFanout );
479 Abc_SclAddWireLoad( p, pBuf, 1 );
480 Abc_SclAddWireLoad( p, pFanin, 1 );
481 Abc_ObjPatchFanin( pFanout, pBuf, pFanin );
482 Abc_SclAddWireLoad( p, pBuf, 0 );
483 Abc_SclAddWireLoad( p, pFanin, 0 );
484 Abc_SclTimeIncUpdateLevel( pFanout );
485 // remember
486 Vec_IntPush( p->vUpdates2, Abc_ObjId(pFanout) );
487 Vec_IntPush( p->vUpdates2, Abc_ObjId(pFanin) );
488 Vec_IntPush( p->vUpdates2, Abc_ObjId(pBuf) );
489 // update cell
490 pCellOld = Abc_SclObjCell( pFanin );
491 pCellNew = SC_LibCell( p->pLib, Vec_IntEntry(p->vNode2Gate, iNode) );
492 p->SumArea += pCellNew->area - pCellOld->area;
493 Abc_SclObjSetCell( pFanin, pCellNew );
494 Abc_SclUpdateLoad( p, pFanin, pCellOld, pCellNew );
495 // record the update
496 Vec_IntPush( p->vUpdates, Abc_ObjId(pFanin) );
497 Vec_IntPush( p->vUpdates, pCellNew->Id );
498 Abc_SclTimeIncInsert( p, pFanout );
499 Abc_SclTimeIncInsert( p, pBuf );
500 Abc_SclTimeIncInsert( p, pFanin );
501 // remember when this node was upsized
502 Vec_IntWriteEntry( p->vNodeIter, Abc_ObjId(pFanout), -1 );
503 Vec_IntWriteEntry( p->vNodeIter, Abc_ObjId(pBuf), -1 );
504 Vec_IntWriteEntry( p->vNodeIter, Abc_ObjId(pFanin), -1 );
505 // update polarity
506 if ( p->pNtk->vPhases && Abc_SclIsInv(pBuf) )
507 Abc_NodeInvUpdateObjFanoutPolarity( pFanin, pFanout );
508 // report
509 if ( fVeryVerbose )
510 {
511 printf( "Node %6d Redir fanout %6d to fanin %6d. Gain = %7.1f ps. ",
512 Abc_ObjId(pBuf), Abc_ObjId(pFanout), Abc_ObjId(pFanin), Vec_FltEntry(p->vNode2Gain, iNode) );
513 printf( "Gate %12s (%2d/%2d) -> %12s (%2d/%2d) \n",
514 pCellOld->pName, pCellOld->Order, pCellOld->nGates,
515 pCellNew->pName, pCellNew->Order, pCellNew->nGates );
516 }
517/*
518 // check if the node became useless
519 if ( Abc_ObjFanoutNum(pBuf) == 0 )
520 {
521 pCellOld = Abc_SclObjCell( pBuf );
522 p->SumArea -= pCellOld->area;
523 Abc_NtkDeleteObj_rec( pBuf, 1 );
524 printf( "Removed node %d.\n", iNode );
525 }
526*/
527 Counter++;
528 }
529 Vec_PtrForEachEntry( Abc_Obj_t *, vFanouts, pFanout, j )
530 pFanout->fMarkB = 0;
531 Vec_PtrFree( vFanouts );
532 return Counter;
533}
534
547{
548 Abc_Obj_t * pNext;
549 int i;
550 if ( pObj->fMarkB )
551 return 1;
552 Abc_ObjForEachFanin( pObj, pNext, i )
553 if ( pNext->fMarkB )
554 return 1;
555 Abc_ObjForEachFanout( pObj, pNext, i )
556 if ( pNext->fMarkB )
557 return 1;
558 return 0;
559}
561{
562// Abc_Obj_t * pNext;
563// int i;
564 if ( pObj->fMarkB == 0 )
565 {
566 Vec_PtrPush( vNodes, pObj );
567 pObj->fMarkB = 1;
568 }
569/*
570 Abc_ObjForEachFanin( pObj, pNext, i )
571 if ( pNext->fMarkB == 0 )
572 {
573 Vec_PtrPush( vNodes, pNext );
574 pNext->fMarkB = 1;
575 }
576 Abc_ObjForEachFanout( pObj, pNext, i )
577 if ( pNext->fMarkB == 0 )
578 {
579 Vec_PtrPush( vNodes, pNext );
580 pNext->fMarkB = 1;
581 }
582*/
583}
584
596int Abc_SclFindUpsizes( SC_Man * p, Vec_Int_t * vPathNodes, int Ratio, int Notches, int iIter, int DelayGap, int fMoreConserf )
597{
598 SC_Cell * pCellOld, * pCellNew;
599 Vec_Int_t * vRecalcs, * vEvals;
600 Vec_Ptr_t * vFanouts;
601 Abc_Obj_t * pObj;
602 float dGainBest, dGainBest2;
603 int i, gateBest, Limit, Counter, iIterLast;
604
605 // compute savings due to upsizing each node
606 vRecalcs = Vec_IntAlloc( 100 );
607 vEvals = Vec_IntAlloc( 100 );
608 Vec_QueClear( p->vNodeByGain );
609 Abc_NtkForEachObjVec( vPathNodes, p->pNtk, pObj, i )
610 {
611 assert( pObj->fMarkB == 0 );
612 iIterLast = Vec_IntEntry(p->vNodeIter, Abc_ObjId(pObj));
613 if ( iIterLast >= 0 && iIterLast + 5 > iIter )
614 continue;
615 // compute nodes to recalculate timing and nodes to evaluate afterwards
616 Abc_SclFindNodesToUpdate( pObj, &vRecalcs, &vEvals, NULL );
617 assert( Vec_IntSize(vEvals) > 0 );
618 //printf( "%d -> %d\n", Vec_IntSize(vRecalcs), Vec_IntSize(vEvals) );
619 gateBest = Abc_SclFindBestCell( p, pObj, vRecalcs, vEvals, Notches, DelayGap, &dGainBest );
620 // remember savings
621 if ( gateBest >= 0 )
622 {
623 assert( dGainBest > 0.0 );
624 Vec_FltWriteEntry( p->vNode2Gain, Abc_ObjId(pObj), dGainBest );
625 Vec_IntWriteEntry( p->vNode2Gate, Abc_ObjId(pObj), gateBest );
626 Vec_QuePush( p->vNodeByGain, Abc_ObjId(pObj) );
627 }
628 }
629 Vec_IntFree( vRecalcs );
630 Vec_IntFree( vEvals );
631 if ( Vec_QueSize(p->vNodeByGain) == 0 )
632 return 0;
633/*
634 Limit = Abc_MinInt( Vec_QueSize(p->vNodeByGain), Abc_MaxInt((int)(0.01 * Ratio * Vec_IntSize(vPathNodes)), 1) );
635 //printf( "\nSelecting %d out of %d\n", Limit, Vec_QueSize(p->vNodeByGain) );
636 for ( i = 0; i < Limit; i++ )
637 {
638 // get the object
639 pObj = Abc_NtkObj( p->pNtk, Vec_QuePop(p->vNodeByGain) );
640 assert( pObj->fMarkA );
641 // find old and new gates
642 pCellOld = Abc_SclObjCell( pObj );
643 pCellNew = SC_LibCell( p->pLib, Vec_IntEntry(p->vNode2Gate, Abc_ObjId(pObj)) );
644 assert( pCellNew != NULL );
645 //printf( "%6d %20s -> %20s ", Abc_ObjId(pObj), pCellOld->pName, pCellNew->pName );
646 //printf( "gain is %f\n", Vec_FltEntry(p->vNode2Gain, Abc_ObjId(pObj)) );
647 // update gate
648 Abc_SclUpdateLoad( p, pObj, pCellOld, pCellNew );
649 p->SumArea += pCellNew->area - pCellOld->area;
650 Abc_SclObjSetCell( pObj, pCellNew );
651 // record the update
652 Vec_IntPush( p->vUpdates, Abc_ObjId(pObj) );
653 Vec_IntPush( p->vUpdates, pCellNew->Id );
654 Abc_SclTimeIncInsert( p, pObj );
655 // remember when this node was upsized
656 Vec_IntWriteEntry( p->vNodeIter, Abc_ObjId(pObj), iIter );
657 }
658return Limit;
659*/
660
661 Limit = Abc_MinInt( Vec_QueSize(p->vNodeByGain), Abc_MaxInt((int)(0.01 * Ratio * Vec_IntSize(vPathNodes)), 1) );
662 dGainBest2 = -1;
663 Counter = 0;
664 vFanouts = Vec_PtrAlloc( 100 );
665 while ( Vec_QueSize(p->vNodeByGain) )
666 {
667 int iNode = Vec_QuePop(p->vNodeByGain);
668 Abc_Obj_t * pObj = Abc_NtkObj( p->pNtk, iNode );
669 assert( pObj->fMarkA );
670 if ( Abc_SclObjCheckMarkedFanFans( pObj ) )
671 continue;
672 Abc_SclObjMarkFanFans( pObj, vFanouts );
673 // remember gain
674 if ( dGainBest2 == -1 )
675 dGainBest2 = Vec_FltEntry(p->vNode2Gain, iNode);
676// else if ( dGainBest2 > 3*Vec_FltEntry(p->vNode2Gain, iNode) )
677// break;
678// printf( "%.1f ", Vec_FltEntry(p->vNode2Gain, iNode) );
679
680 // find old and new gates
681 pCellOld = Abc_SclObjCell( pObj );
682 pCellNew = SC_LibCell( p->pLib, Vec_IntEntry(p->vNode2Gate, Abc_ObjId(pObj)) );
683 assert( pCellNew != NULL );
684 //printf( "%6d %20s -> %20s ", Abc_ObjId(pObj), pCellOld->pName, pCellNew->pName );
685 //printf( "gain is %f\n", Vec_FltEntry(p->vNode2Gain, Abc_ObjId(pObj)) );
686// if ( pCellOld->Order > 0 )
687// printf( "%.2f %d -> %d(%d) ", Vec_FltEntry(p->vNode2Gain, iNode), pCellOld->Order, pCellNew->Order, pCellNew->nGates );
688 // update gate
689 p->SumArea += pCellNew->area - pCellOld->area;
690 Abc_SclObjSetCell( pObj, pCellNew );
691 Abc_SclUpdateLoad( p, pObj, pCellOld, pCellNew );
692 // record the update
693 Vec_IntPush( p->vUpdates, Abc_ObjId(pObj) );
694 Vec_IntPush( p->vUpdates, pCellNew->Id );
695 Abc_SclTimeIncInsert( p, pObj );
696 // remember when this node was upsized
697 Vec_IntWriteEntry( p->vNodeIter, Abc_ObjId(pObj), iIter );
698 Counter++;
699 if ( Counter == Limit )
700 break;
701 }
702// printf( "\n" );
703
704 Vec_PtrForEachEntry( Abc_Obj_t *, vFanouts, pObj, i )
705 pObj->fMarkB = 0;
706 Vec_PtrFree( vFanouts );
707 return Counter;
708}
709void Abc_SclApplyUpdateToBest( Vec_Int_t * vGatesBest, Vec_Int_t * vGates, Vec_Int_t * vUpdate )
710{
711 int i, ObjId, GateId, GateId2;
712 Vec_IntForEachEntryDouble( vUpdate, ObjId, GateId, i )
713 Vec_IntWriteEntry( vGatesBest, ObjId, GateId );
714 Vec_IntClear( vUpdate );
715 Vec_IntForEachEntryTwo( vGatesBest, vGates, GateId, GateId2, i )
716 assert( GateId == GateId2 );
717// Vec_IntClear( vGatesBest );
718// Vec_IntAppend( vGatesBest, vGates );
719}
721{
722 int i;
723 assert( Vec_IntSize(vTrans) % 3 == 0 );
724 for ( i = Vec_IntSize(vTrans)/3 - 1; i >= 0; i-- )
725 {
726 Abc_Obj_t * pFanout = Abc_NtkObj( pNtk, Vec_IntEntry(vTrans, 3*i+0) );
727 Abc_Obj_t * pFanin = Abc_NtkObj( pNtk, Vec_IntEntry(vTrans, 3*i+1) );
728 Abc_Obj_t * pObj = Abc_NtkObj( pNtk, Vec_IntEntry(vTrans, 3*i+2) );
729 // we do not update load here because times will be recomputed
730 Abc_ObjPatchFanin( pFanout, pFanin, pObj );
731 Abc_SclTimeIncUpdateLevel( pFanout );
732// printf( "Node %6d Redir fanout %6d from fanin %6d. \n",
733// Abc_ObjId(pObj), Abc_ObjId(pFanout), Abc_ObjId(pFanin) );
734 // update polarity
735 if ( pNtk->vPhases && Abc_SclIsInv(pObj) )
736 Abc_NodeInvUpdateObjFanoutPolarity( pObj, pFanout );
737 }
738}
739
752{
753 float fDiff = (float)0.001;
754 int k;
755 Abc_Obj_t * pObj;
756
757 SC_Pair * pTimes = ABC_ALLOC( SC_Pair, p->nObjs );
758 SC_Pair * pSlews = ABC_ALLOC( SC_Pair, p->nObjs );
759 SC_Pair * pLoads = ABC_ALLOC( SC_Pair, p->nObjs );
760
761 memcpy( pTimes, p->pTimes, sizeof(SC_Pair) * p->nObjs );
762 memcpy( pSlews, p->pSlews, sizeof(SC_Pair) * p->nObjs );
763 memcpy( pLoads, p->pLoads, sizeof(SC_Pair) * p->nObjs );
764
765 Abc_SclTimeNtkRecompute( p, NULL, NULL, 0, 0 );
766
767 Abc_NtkForEachNode( pNtk, pObj, k )
768 {
769 if ( Abc_AbsFloat(p->pLoads[k].rise - pLoads[k].rise) > fDiff )
770 printf( "%6d : load rise differs %12.6f %f %f\n", k, p->pLoads[k].rise-pLoads[k].rise, p->pLoads[k].rise, pLoads[k].rise );
771 if ( Abc_AbsFloat(p->pLoads[k].fall - pLoads[k].fall) > fDiff )
772 printf( "%6d : load fall differs %12.6f %f %f\n", k, p->pLoads[k].fall-pLoads[k].fall, p->pLoads[k].fall, pLoads[k].fall );
773
774 if ( Abc_AbsFloat(p->pSlews[k].rise - pSlews[k].rise) > fDiff )
775 printf( "%6d : slew rise differs %12.6f %f %f\n", k, p->pSlews[k].rise-pSlews[k].rise, p->pSlews[k].rise, pSlews[k].rise );
776 if ( Abc_AbsFloat(p->pSlews[k].fall - pSlews[k].fall) > fDiff )
777 printf( "%6d : slew fall differs %12.6f %f %f\n", k, p->pSlews[k].fall-pSlews[k].fall, p->pSlews[k].fall, pSlews[k].fall );
778
779 if ( Abc_AbsFloat(p->pTimes[k].rise - pTimes[k].rise) > fDiff )
780 printf( "%6d : time rise differs %12.6f %f %f\n", k, p->pTimes[k].rise-pTimes[k].rise, p->pTimes[k].rise, pTimes[k].rise );
781 if ( Abc_AbsFloat(p->pTimes[k].fall - pTimes[k].fall) > fDiff )
782 printf( "%6d : time fall differs %12.6f %f %f\n", k, p->pTimes[k].fall-pTimes[k].fall, p->pTimes[k].fall, pTimes[k].fall );
783 }
784
785/*
786if ( memcmp( pTimes, p->pTimes, sizeof(SC_Pair) * p->nObjs ) )
787 printf( "Times differ!\n" );
788if ( memcmp( pSlews, p->pSlews, sizeof(SC_Pair) * p->nObjs ) )
789 printf( "Slews differ!\n" );
790if ( memcmp( pLoads, p->pLoads, sizeof(SC_Pair) * p->nObjs ) )
791 printf( "Loads differ!\n" );
792*/
793
794 ABC_FREE( pTimes );
795 ABC_FREE( pSlews );
796 ABC_FREE( pLoads );
797}
798
810void Abc_SclUpsizePrint( SC_Man * p, int Iter, int win, int nPathPos, int nPathNodes, int nUpsizes, int nTFOs, int fVerbose )
811{
812 printf( "%4d ", Iter );
813 printf( "Win:%3d. ", win );
814 printf( "PO:%6d. ", nPathPos );
815 printf( "Path:%7d. ", nPathNodes );
816 printf( "Gate:%5d. ", nUpsizes );
817 printf( "TFO:%7d. ", nTFOs );
818 printf( "A: " );
819 printf( "%.2f ", p->SumArea );
820 printf( "(%+5.1f %%) ", 100.0 * (p->SumArea - p->SumArea0)/ p->SumArea0 );
821 printf( "D: " );
822 printf( "%.2f ps ", p->MaxDelay );
823 printf( "(%+5.1f %%) ", 100.0 * (p->MaxDelay - p->MaxDelay0)/ p->MaxDelay0 );
824 printf( "B: " );
825 printf( "%.2f ps ", p->BestDelay );
826 printf( "(%+5.1f %%)", 100.0 * (p->BestDelay - p->MaxDelay0)/ p->MaxDelay0 );
827 printf( "%8.2f sec ", 1.0*(Abc_Clock() - p->timeTotal)/(CLOCKS_PER_SEC) );
828 printf( "%c", fVerbose ? '\n' : '\r' );
829}
830
843{
844 SC_Cell * pCell;
845 Abc_Obj_t * pObj;
846 int i;
847 Abc_NtkForEachNodeNotBarBuf( pNtk, pObj, i )
848 if ( Abc_ObjFanoutNum(pObj) == 0 )
849 {
850 pCell = Abc_SclObjCell( pObj );
851 p->SumArea -= pCell->area;
852 Abc_NtkDeleteObj_rec( pObj, 1 );
853// printf( "Removed node %d.\n", i );
854 }
855}
856
868void Abc_SclUpsizePerformInt( SC_Lib * pLib, Abc_Ntk_t * pNtk, SC_SizePars * pPars, void * pFuncFanin )
869{
870 SC_Man * p;
871 Vec_Int_t * vPathPos = NULL; // critical POs
872 Vec_Int_t * vPathNodes = NULL; // critical nodes and PIs
873 abctime clk, nRuntimeLimit = pPars->TimeOut ? pPars->TimeOut * CLOCKS_PER_SEC + Abc_Clock() : 0;
874 int i = 0, win, nUpsizes = -1, nFramesNoChange = 0, nConeSize = 0;
875 int nAllPos, nAllNodes, nAllTfos, nAllUpsizes;
876 if ( pPars->fVerbose )
877 {
878 printf( "Parameters: " );
879 printf( "Iters =%5d. ", pPars->nIters );
880 printf( "Time win =%3d %%. ", pPars->Window );
881 printf( "Update ratio =%3d %%. ", pPars->Ratio );
882 printf( "UseDept =%2d. ", pPars->fUseDept );
883 printf( "UseWL =%2d. ", pPars->fUseWireLoads );
884 printf( "Target =%5d ps. ", pPars->DelayUser );
885 printf( "DelayGap =%3d ps. ", pPars->DelayGap );
886 printf( "Timeout =%4d sec", pPars->TimeOut );
887 printf( "\n" );
888 }
889 // increase window for larger networks
890 if ( pPars->Window == 1 )
891 pPars->Window += (Abc_NtkNodeNum(pNtk) > 40000);
892 // prepare the manager; collect init stats
893 p = Abc_SclManStart( pLib, pNtk, pPars->fUseWireLoads, pPars->fUseDept, 0, pPars->BuffTreeEst );
894 p->pFuncFanin = (float (*)(void *, Abc_Obj_t *, Abc_Obj_t *, int, int))pFuncFanin;
895 p->timeTotal = Abc_Clock();
896 assert( p->vGatesBest == NULL );
897 p->vGatesBest = Vec_IntDup( p->pNtk->vGates );
898 p->BestDelay = p->MaxDelay0;
899 // perform upsizing
900 nAllPos = nAllNodes = nAllTfos = nAllUpsizes = 0;
901 if ( p->BestDelay <= pPars->DelayUser )
902 printf( "Current delay (%.2f ps) does not exceed the target delay (%.2f ps). Upsizing is not performed.\n", p->BestDelay, (float)pPars->DelayUser );
903 else
904 for ( i = 0; i < pPars->nIters; i++ )
905 {
906 for ( win = pPars->Window + ((i % 7) == 6); win <= 100; win *= 2 )
907 {
908 // detect critical path
909 clk = Abc_Clock();
910 vPathPos = Abc_SclFindCriticalCoWindow( p, win );
911 vPathNodes = Abc_SclFindCriticalNodeWindow( p, vPathPos, win, pPars->fUseDept );
912 p->timeCone += Abc_Clock() - clk;
913
914 // selectively upsize the nodes
915 clk = Abc_Clock();
916 if ( pPars->BypassFreq && i && (i % pPars->BypassFreq) == 0 )
917 nUpsizes = Abc_SclFindBypasses( p, vPathNodes, pPars->Ratio, pPars->Notches, i, pPars->DelayGap, pPars->fVeryVerbose );
918 else
919 nUpsizes = Abc_SclFindUpsizes( p, vPathNodes, pPars->Ratio, pPars->Notches, i, pPars->DelayGap, (pPars->BypassFreq > 0) );
920 p->timeSize += Abc_Clock() - clk;
921
922 // unmark critical path
923 clk = Abc_Clock();
924 Abc_SclUnmarkCriticalNodeWindow( p, vPathNodes );
926 p->timeCone += Abc_Clock() - clk;
927 if ( nUpsizes > 0 )
928 break;
929 Vec_IntFree( vPathPos );
930 Vec_IntFree( vPathNodes );
931 }
932 if ( nUpsizes == 0 )
933 break;
934
935 // update timing information
936 clk = Abc_Clock();
937 if ( pPars->fUseDept )
938 {
939 if ( Vec_IntSize(p->vChanged) && !(pPars->BypassFreq && i && (i % pPars->BypassFreq) == 0) )
940 nConeSize = Abc_SclTimeIncUpdate( p );
941 else
942 Abc_SclTimeNtkRecompute( p, NULL, NULL, pPars->fUseDept, 0 );
943 }
944 else
945 {
946 Vec_Int_t * vTFO = Abc_SclFindTFO( p->pNtk, vPathNodes );
947 Abc_SclTimeCone( p, vTFO );
948 nConeSize = Vec_IntSize( vTFO );
949 Vec_IntFree( vTFO );
950 }
951 p->timeTime += Abc_Clock() - clk;
952// Abc_SclUpsizePrintDiffs( p, pLib, pNtk );
953
954 // save the best network
955 p->MaxDelay = Abc_SclReadMaxDelay( p );
956 if ( p->BestDelay > p->MaxDelay )
957 {
958 p->BestDelay = p->MaxDelay;
959 Abc_SclApplyUpdateToBest( p->vGatesBest, p->pNtk->vGates, p->vUpdates );
960 Vec_IntClear( p->vUpdates2 );
961 nFramesNoChange = 0;
962 }
963 else
964 nFramesNoChange++;
965
966 // report and cleanup
967 Abc_SclUpsizePrint( p, i, win, Vec_IntSize(vPathPos), Vec_IntSize(vPathNodes), nUpsizes, nConeSize, pPars->fVeryVerbose || (pPars->fVerbose && nFramesNoChange == 0) ); //|| (i == nIters-1) );
968 nAllPos += Vec_IntSize(vPathPos);
969 nAllNodes += Vec_IntSize(vPathNodes);
970 nAllTfos += nConeSize;
971 nAllUpsizes += nUpsizes;
972 Vec_IntFree( vPathPos );
973 Vec_IntFree( vPathNodes );
974 // check timeout
975 if ( nRuntimeLimit && Abc_Clock() > nRuntimeLimit )
976 break;
977 // check no change
978 if ( nFramesNoChange > pPars->nIterNoChange )
979 break;
980 // check best delay
981 if ( p->BestDelay <= pPars->DelayUser )
982 break;
983 }
984 // update for best gates and recompute timing
985 ABC_SWAP( Vec_Int_t *, p->vGatesBest, p->pNtk->vGates );
986 if ( pPars->BypassFreq != 0 )
987 Abc_SclUndoRecentChanges( p->pNtk, p->vUpdates2 );
988 if ( pPars->BypassFreq != 0 )
990 Abc_SclTimeNtkRecompute( p, &p->SumArea, &p->MaxDelay, 0, 0 );
991 if ( pPars->fVerbose )
992 Abc_SclUpsizePrint( p, i, pPars->Window, nAllPos/(i?i:1), nAllNodes/(i?i:1), nAllUpsizes/(i?i:1), nAllTfos/(i?i:1), 1 );
993 else
994 printf( " \r" );
995 // report runtime
996 p->timeTotal = Abc_Clock() - p->timeTotal;
997 if ( pPars->fVerbose )
998 {
999 p->timeOther = p->timeTotal - p->timeCone - p->timeSize - p->timeTime;
1000 ABC_PRTP( "Runtime: Critical path", p->timeCone, p->timeTotal );
1001 ABC_PRTP( "Runtime: Sizing eval ", p->timeSize, p->timeTotal );
1002 ABC_PRTP( "Runtime: Timing update", p->timeTime, p->timeTotal );
1003 ABC_PRTP( "Runtime: Other ", p->timeOther, p->timeTotal );
1004 ABC_PRTP( "Runtime: TOTAL ", p->timeTotal, p->timeTotal );
1005 }
1006 if ( pPars->fDumpStats )
1007 Abc_SclDumpStats( p, "stats2.txt", p->timeTotal );
1008 if ( nRuntimeLimit && Abc_Clock() > nRuntimeLimit )
1009 printf( "Gate sizing timed out at %d seconds.\n", pPars->TimeOut );
1010
1011 // save the result and quit
1012 Abc_SclSclGates2MioGates( pLib, pNtk ); // updates gate pointers
1013 Abc_SclManFree( p );
1014// Abc_NtkCleanMarkAB( pNtk );
1015}
1016
1028void Abc_SclUpsizePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, SC_SizePars * pPars, void * pFuncFanin )
1029{
1030 Abc_Ntk_t * pNtkNew = pNtk;
1031 if ( pNtk->nBarBufs2 > 0 )
1032 pNtkNew = Abc_NtkDupDfsNoBarBufs( pNtk );
1033 Abc_SclUpsizePerformInt( pLib, pNtkNew, pPars, pFuncFanin );
1034 if ( pNtk->nBarBufs2 > 0 )
1035 Abc_SclTransferGates( pNtk, pNtkNew );
1036 if ( pNtk->nBarBufs2 > 0 )
1037 Abc_NtkDelete( pNtkNew );
1038}
1039
1043
1044
1046
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition abc.h:522
#define Abc_NtkForEachNodeNotBarBuf(pNtk, pNode, i)
Definition abc.h:467
ABC_DLL Abc_Ntk_t * Abc_NtkDupDfsNoBarBufs(Abc_Ntk_t *pNtk)
Definition abcNtk.c:578
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition abc.h:527
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition abc.h:529
ABC_DLL void Abc_NtkDeleteObj_rec(Abc_Obj_t *pObj, int fOnlyNodes)
Definition abcObj.c:278
ABC_DLL void Abc_NodeCollectFanouts(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition abcUtil.c:1647
struct Abc_Ntk_t_ Abc_Ntk_t
Definition abc.h:115
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition abcNtk.c:1421
ABC_DLL void Abc_ObjPatchFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFaninOld, Abc_Obj_t *pFaninNew)
Definition abcFanio.c:172
#define Abc_NtkForEachObjVec(vIds, pNtk, pObj, i)
Definition abc.h:455
ABC_DLL int Abc_NodeFindFanin(Abc_Obj_t *pNode, Abc_Obj_t *pFanin)
Definition abcUtil.c:791
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition abc.h:464
#define ABC_SWAP(Type, a, b)
Definition abc_global.h:253
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#define ABC_PRTP(a, t, T)
Definition abc_global.h:258
#define ABC_FREE(obj)
Definition abc_global.h:267
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Cube * p
Definition exorList.c:222
void Abc_NodeInvUpdateObjFanoutPolarity(Abc_Obj_t *pObj, Abc_Obj_t *pFanout)
Definition sclBuffer.c:336
int Abc_SclIsInv(Abc_Obj_t *pObj)
Definition sclBuffer.c:116
struct SC_SizePars_ SC_SizePars
Definition sclLib.h:82
struct SC_Lib_ SC_Lib
Definition sclLib.h:128
struct SC_Pair_ SC_Pair
Definition sclLib.h:69
#define SC_RingForEachCell(pRing, pCell, i)
Definition sclLib.h:277
struct SC_Cell_ SC_Cell
Definition sclLib.h:127
void Abc_SclUpdateLoad(SC_Man *p, Abc_Obj_t *pObj, SC_Cell *pOld, SC_Cell *pNew)
Definition sclLoad.c:201
void Abc_SclAddWireLoad(SC_Man *p, Abc_Obj_t *pObj, int fSubtr)
Definition sclLoad.c:102
void Abc_SclUpdateLoadSplit(SC_Man *p, Abc_Obj_t *pBuffer, Abc_Obj_t *pFanout)
Definition sclLoad.c:214
int Abc_SclTimeIncUpdate(SC_Man *p)
Definition sclSize.c:555
void Abc_SclTimeCone(SC_Man *p, Vec_Int_t *vCone)
Definition sclSize.c:398
void Abc_SclTimeIncInsert(SC_Man *p, Abc_Obj_t *pObj)
Definition sclSize.c:577
void Abc_SclTimeIncUpdateLevel(Abc_Obj_t *pObj)
Definition sclSize.c:591
SC_Man * Abc_SclManStart(SC_Lib *pLib, Abc_Ntk_t *pNtk, int fUseWireLoads, int fDept, float DUser, int nTreeCRatio)
Definition sclSize.c:648
void Abc_SclTimeNtkRecompute(SC_Man *p, float *pArea, float *pDelay, int fReverse, float DUser)
Definition sclSize.c:415
void Abc_SclSclGates2MioGates(SC_Lib *pLib, Abc_Ntk_t *p)
Definition sclUtil.c:70
void Abc_SclTransferGates(Abc_Ntk_t *pOld, Abc_Ntk_t *pNew)
Definition sclUtil.c:102
typedefABC_NAMESPACE_HEADER_START struct SC_Man_ SC_Man
INCLUDES ///.
Definition sclSize.h:44
void Abc_SclUpsizePerform(SC_Lib *pLib, Abc_Ntk_t *pNtk, SC_SizePars *pPars, void *pFuncFanin)
Definition sclUpsize.c:1028
void Abc_SclFindNodesToUpdate(Abc_Obj_t *pPivot, Vec_Int_t **pvNodes, Vec_Int_t **pvEvals, Abc_Obj_t *pExtra)
Definition sclUpsize.c:213
void Abc_SclUpsizePerformInt(SC_Lib *pLib, Abc_Ntk_t *pNtk, SC_SizePars *pPars, void *pFuncFanin)
Definition sclUpsize.c:868
Vec_Int_t * Abc_SclFindCriticalCoWindow(SC_Man *p, int Window)
Definition sclUpsize.c:98
void Abc_SclApplyUpdateToBest(Vec_Int_t *vGatesBest, Vec_Int_t *vGates, Vec_Int_t *vUpdate)
Definition sclUpsize.c:709
Vec_Int_t * Abc_SclFindCriticalNodeWindow(SC_Man *p, Vec_Int_t *vPathCos, int Window, int fDept)
Definition sclUpsize.c:159
int Abc_SclFindUpsizes(SC_Man *p, Vec_Int_t *vPathNodes, int Ratio, int Notches, int iIter, int DelayGap, int fMoreConserf)
Definition sclUpsize.c:596
int Abc_SclObjCheckMarkedFanFans(Abc_Obj_t *pObj)
Definition sclUpsize.c:546
int Abc_SclFindBypasses(SC_Man *p, Vec_Int_t *vPathNodes, int Ratio, int Notches, int iIter, int DelayGap, int fVeryVerbose)
Definition sclUpsize.c:336
int Abc_SclFindBestCell(SC_Man *p, Abc_Obj_t *pObj, Vec_Int_t *vRecalcs, Vec_Int_t *vEvals, int Notches, int DelayGap, float *pGainBest)
Definition sclUpsize.c:275
void Abc_SclUpsizeRemoveDangling(SC_Man *p, Abc_Ntk_t *pNtk)
Definition sclUpsize.c:842
void Abc_SclUndoRecentChanges(Abc_Ntk_t *pNtk, Vec_Int_t *vTrans)
Definition sclUpsize.c:720
void Abc_SclUpsizePrintDiffs(SC_Man *p, SC_Lib *pLib, Abc_Ntk_t *pNtk)
Definition sclUpsize.c:751
int Abc_SclCountNearCriticalNodes(SC_Man *p)
Definition sclUpsize.c:187
void Abc_SclUnmarkCriticalNodeWindow(SC_Man *p, Vec_Int_t *vPath)
Definition sclUpsize.c:180
void Abc_SclUpsizePrint(SC_Man *p, int Iter, int win, int nPathPos, int nPathNodes, int nUpsizes, int nTFOs, int fVerbose)
Definition sclUpsize.c:810
void Abc_SclFindCriticalNodeWindow_rec(SC_Man *p, Abc_Obj_t *pObj, Vec_Int_t *vPath, float fSlack, int fDept)
Definition sclUpsize.c:123
void Abc_SclObjMarkFanFans(Abc_Obj_t *pObj, Vec_Ptr_t *vNodes)
Definition sclUpsize.c:560
ABC_NAMESPACE_IMPL_START void Abc_SclFindTFO_rec(Abc_Obj_t *pObj, Vec_Int_t *vNodes, Vec_Int_t *vCos)
DECLARATIONS ///.
Definition sclUpsize.c:45
Vec_Int_t * Abc_SclFindTFO(Abc_Ntk_t *p, Vec_Int_t *vPath)
Definition sclUpsize.c:63
int nBarBufs2
Definition abc.h:175
Vec_Int_t * vPhases
Definition abc.h:208
unsigned fMarkB
Definition abc.h:135
unsigned fMarkA
Definition abc.h:134
float area
Definition sclLib.h:207
char * pName
Definition sclLib.h:202
int Id
Definition sclLib.h:203
int nGates
Definition sclLib.h:220
int Order
Definition sclLib.h:219
float fall
Definition sclLib.h:73
float rise
Definition sclLib.h:72
int BypassFreq
Definition sclLib.h:94
int DelayUser
Definition sclLib.h:90
int fDumpStats
Definition sclLib.h:96
int Notches
Definition sclLib.h:89
int nIterNoChange
Definition sclLib.h:86
int fUseDept
Definition sclLib.h:95
int nIters
Definition sclLib.h:85
int fVerbose
Definition sclLib.h:98
int fVeryVerbose
Definition sclLib.h:99
int DelayGap
Definition sclLib.h:91
int BuffTreeEst
Definition sclLib.h:93
int Ratio
Definition sclLib.h:88
int Window
Definition sclLib.h:87
int TimeOut
Definition sclLib.h:92
int fUseWireLoads
Definition sclLib.h:97
#define assert(ex)
Definition util_old.h:213
char * memcpy()
#define Vec_IntForEachEntryDouble(vVec, Entry1, Entry2, i)
Definition vecInt.h:72
#define Vec_IntForEachEntryTwo(vVec1, vVec2, Entry1, Entry2, i)
Definition vecInt.h:66
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55