ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
fretInit.c
Go to the documentation of this file.
1
20
21#include "fretime.h"
22
23#include "base/io/ioAbc.h"
24#include "map/mio/mio.h"
25#include "aig/hop/hop.h"
26
27#ifdef ABC_USE_CUDD
28#include "bdd/cudd/cuddInt.h"
29#endif
30
32
33
34#undef DEBUG_PRINT_INIT_NTK
35
36
40
41static void Abc_FlowRetime_UpdateForwardInit_rec( Abc_Obj_t * pObj );
42static void Abc_FlowRetime_VerifyBackwardInit( Abc_Ntk_t * pNtk );
43static void Abc_FlowRetime_VerifyBackwardInit_rec( Abc_Obj_t * pObj );
44static Abc_Obj_t* Abc_FlowRetime_UpdateBackwardInit_rec( Abc_Obj_t *pOrigObj );
45
46static void Abc_FlowRetime_SimulateNode( Abc_Obj_t * pObj );
47static void Abc_FlowRetime_SimulateSop( Abc_Obj_t * pObj, char *pSop );
48
49static void Abc_FlowRetime_SetInitToOrig( Abc_Obj_t *pInit, Abc_Obj_t *pOrig );
50static void Abc_FlowRetime_GetInitToOrig( Abc_Obj_t *pInit, Abc_Obj_t **pOrig, int *lag );
51static void Abc_FlowRetime_ClearInitToOrig( Abc_Obj_t *pInit );
52
53extern void * Abc_FrameReadLibGen();
54
55extern void Abc_NtkMarkCone_rec( Abc_Obj_t * pObj, int fForward );
56
60
61
74void
76
77 if (!pManMR->fComputeInitState) return;
78
79 if (pManMR->fIsForward)
81 else {
83 }
84}
85
97static inline int
98Abc_FlowRetime_ObjFirstNonLatchBox( Abc_Obj_t * pOrigObj, Abc_Obj_t ** pResult ) {
99 int lag = 0;
100 Abc_Ntk_t *pNtk;
101 *pResult = pOrigObj;
102 pNtk = Abc_ObjNtk( pOrigObj );
103
104 Abc_NtkIncrementTravId( pNtk );
105
106 while( Abc_ObjIsBo(*pResult) || Abc_ObjIsLatch(*pResult) || Abc_ObjIsBi(*pResult) ) {
107 assert(Abc_ObjFaninNum(*pResult));
108 *pResult = Abc_ObjFanin0(*pResult);
109
110 if (Abc_NodeIsTravIdCurrent(*pResult))
111 return -1;
112 Abc_NodeSetTravIdCurrent(*pResult);
113
114 if (Abc_ObjIsLatch(*pResult)) ++lag;
115 }
116
117 return lag;
118}
119
120
132void
134 int i, n0=0, n1=0, nDC=0, nOther=0;
135 Abc_Obj_t *pLatch;
136
137 Abc_NtkForEachLatch( pNtk, pLatch, i ) {
138 if (Abc_LatchIsInit0(pLatch)) n0++;
139 else if (Abc_LatchIsInit1(pLatch)) n1++;
140 else if (Abc_LatchIsInitDc(pLatch)) nDC++;
141 else nOther++;
142 }
143
144 printf("\tinitial states {0,1,x} = {%d, %d, %d}", n0, n1, nDC);
145 if (nOther)
146 printf(" + %d UNKNOWN", nOther);
147 printf("\n");
148}
149
150
164 Abc_Obj_t *pObj, *pFanin;
165 int i;
166
167 vprintf("\t\tupdating init state\n");
168
169 Abc_NtkIncrementTravId( pNtk );
170
171 Abc_NtkForEachLatch( pNtk, pObj, i ) {
172 pFanin = Abc_ObjFanin0(pObj);
173 Abc_FlowRetime_UpdateForwardInit_rec( pFanin );
174
175 if (FTEST(pFanin, INIT_0))
176 Abc_LatchSetInit0( pObj );
177 else if (FTEST(pFanin, INIT_1))
178 Abc_LatchSetInit1( pObj );
179 else
180 Abc_LatchSetInitDc( pObj );
181 }
182}
183
184void Abc_FlowRetime_UpdateForwardInit_rec( Abc_Obj_t * pObj ) {
185 Abc_Obj_t *pNext;
186 int i;
187
188 assert(!Abc_ObjIsPi(pObj)); // should never reach the inputs
189
190 if (Abc_ObjIsBo(pObj)) return;
191
192 // visited?
193 if (Abc_NodeIsTravIdCurrent(pObj)) return;
194 Abc_NodeSetTravIdCurrent(pObj);
195
196 Abc_ObjForEachFanin( pObj, pNext, i ) {
197 Abc_FlowRetime_UpdateForwardInit_rec( pNext );
198 }
199
200 Abc_FlowRetime_SimulateNode( pObj );
201}
202
214static void Abc_FlowRetime_EvalHop_rec( Hop_Man_t *pHop, Hop_Obj_t *pObj, int *f, int *dc ) {
215 int f1, dc1, f2, dc2;
216 Hop_Obj_t *pReg = Hop_Regular(pObj);
217
218 // const 0
219 if (Hop_ObjIsConst1(pReg)) {
220 *f = 1;
221 *f ^= (pReg == pObj ? 1 : 0);
222 *dc = 0;
223 return;
224 }
225
226 // PI
227 if (Hop_ObjIsPi(pReg)) {
228 *f = pReg->fMarkA;
229 *f ^= (pReg == pObj ? 1 : 0);
230 *dc = pReg->fMarkB;
231 return;
232 }
233
234 // PO
235 if (Hop_ObjIsPo(pReg)) {
236 assert( pReg == pObj );
237 Abc_FlowRetime_EvalHop_rec(pHop, Hop_ObjChild0(pReg), f, dc);
238 return;
239 }
240
241 // AND
242 if (Hop_ObjIsAnd(pReg)) {
243 Abc_FlowRetime_EvalHop_rec(pHop, Hop_ObjChild0(pReg), &f1, &dc1);
244 Abc_FlowRetime_EvalHop_rec(pHop, Hop_ObjChild1(pReg), &f2, &dc2);
245
246 *dc = (dc1 & f2) | (dc2 & f1) | (dc1 & dc2);
247 *f = f1 & f2;
248 *f ^= (pReg == pObj ? 1 : 0);
249 return;
250 }
251
252 assert(0);
253}
254
255
267static inline void Abc_FlowRetime_SetInitValue( Abc_Obj_t * pObj,
268 int val, int dc ) {
269
270 // store init value
271 FUNSET(pObj, INIT_CARE);
272 if (!dc){
273 if (val) {
274 FSET(pObj, INIT_1);
275 } else {
276 FSET(pObj, INIT_0);
277 }
278 }
279}
280
281
293void Abc_FlowRetime_SimulateNode( Abc_Obj_t * pObj ) {
294 Abc_Ntk_t *pNtk = Abc_ObjNtk(pObj);
295 Abc_Obj_t * pFanin;
296 int i, rAnd, rVar, dcAnd, dcVar;
297#ifdef ABC_USE_CUDD
298 DdManager * dd = (DdManager*)pNtk->pManFunc;
299 DdNode *pBdd = (DdNode*)pObj->pData, *pVar;
300#endif
301 Hop_Man_t *pHop = (Hop_Man_t*)pNtk->pManFunc;
302
303 assert(!Abc_ObjIsLatch(pObj));
304 assert(Abc_ObjRegular(pObj));
305
306 // (i) constant nodes
307 if (Abc_NtkIsStrash(pNtk) && Abc_AigNodeIsConst(pObj)) {
308 Abc_FlowRetime_SetInitValue(pObj, 1, 0);
309 return;
310 }
311 if (!Abc_NtkIsStrash( pNtk ) && Abc_ObjIsNode(pObj)) {
312 if (Abc_NodeIsConst0(pObj)) {
313 Abc_FlowRetime_SetInitValue(pObj, 0, 0);
314 return;
315 } else if (Abc_NodeIsConst1(pObj)) {
316 Abc_FlowRetime_SetInitValue(pObj, 1, 0);
317 return;
318 }
319 }
320
321 // (ii) terminal nodes
322 if (!Abc_ObjIsNode(pObj)) {
323 pFanin = Abc_ObjFanin0(pObj);
324
325 Abc_FlowRetime_SetInitValue(pObj,
326 (FTEST(pFanin, INIT_1) ? 1 : 0) ^ pObj->fCompl0,
327 !FTEST(pFanin, INIT_CARE));
328 return;
329 }
330
331 // (iii) logic nodes
332
333 // ------ SOP network
334 if ( Abc_NtkHasSop( pNtk )) {
335 Abc_FlowRetime_SimulateSop( pObj, (char *)Abc_ObjData(pObj) );
336 return;
337 }
338#ifdef ABC_USE_CUDD
339 // ------ BDD network
340 else if ( Abc_NtkHasBdd( pNtk )) {
341 assert(dd);
342 assert(pBdd);
343
344 // cofactor for 0,1 inputs
345 // do nothing for X values
346 Abc_ObjForEachFanin(pObj, pFanin, i) {
347 pVar = Cudd_bddIthVar( dd, i );
348 if (FTEST(pFanin, INIT_CARE)) {
349 if (FTEST(pFanin, INIT_0))
350 pBdd = Cudd_Cofactor( dd, pBdd, Cudd_Not(pVar) );
351 else
352 pBdd = Cudd_Cofactor( dd, pBdd, pVar );
353 }
354 }
355
356 // if function has not been reduced to
357 // a constant, propagate an X
358 rVar = (pBdd == Cudd_ReadOne(dd));
359 dcVar = !Cudd_IsConstant(pBdd);
360
361 Abc_FlowRetime_SetInitValue(pObj, rVar, dcVar);
362 return;
363 }
364#endif // #ifdef ABC_USE_CUDD
365
366 // ------ AIG logic network
367 else if ( Abc_NtkHasAig( pNtk ) && !Abc_NtkIsStrash( pNtk )) {
368
369 assert(Abc_ObjIsNode(pObj));
370 assert(pObj->pData);
371 assert(Abc_ObjFaninNum(pObj) <= Hop_ManPiNum(pHop) );
372
373 // set vals at inputs
374 Abc_ObjForEachFanin(pObj, pFanin, i) {
375 Hop_ManPi(pHop, i)->fMarkA = FTEST(pFanin, INIT_1)?1:0;
376 Hop_ManPi(pHop, i)->fMarkB = FTEST(pFanin, INIT_CARE)?1:0;
377 }
378
379 Abc_FlowRetime_EvalHop_rec( pHop, (Hop_Obj_t*)pObj->pData, &rVar, &dcVar );
380
381 Abc_FlowRetime_SetInitValue(pObj, rVar, dcVar);
382
383 // clear flags
384 Abc_ObjForEachFanin(pObj, pFanin, i) {
385 Hop_ManPi(pHop, i)->fMarkA = 0;
386 Hop_ManPi(pHop, i)->fMarkB = 0;
387 }
388
389 return;
390 }
391
392 // ------ strashed network
393 else if ( Abc_NtkIsStrash( pNtk )) {
394
395 assert(Abc_ObjType(pObj) == ABC_OBJ_NODE);
396 dcAnd = 0, rAnd = 1;
397
398 pFanin = Abc_ObjFanin0(pObj);
399 dcAnd |= FTEST(pFanin, INIT_CARE) ? 0 : 1;
400 rVar = FTEST(pFanin, INIT_0) ? 0 : 1;
401 if (pObj->fCompl0) rVar ^= 1; // complimented?
402 rAnd &= rVar;
403
404 pFanin = Abc_ObjFanin1(pObj);
405 dcAnd |= FTEST(pFanin, INIT_CARE) ? 0 : 1;
406 rVar = FTEST(pFanin, INIT_0) ? 0 : 1;
407 if (pObj->fCompl1) rVar ^= 1; // complimented?
408 rAnd &= rVar;
409
410 if (!rAnd) dcAnd = 0; /* controlling value */
411
412 Abc_FlowRetime_SetInitValue(pObj, rAnd, dcAnd);
413 return;
414 }
415
416 // ------ MAPPED network
417 else if ( Abc_NtkHasMapping( pNtk )) {
418 Abc_FlowRetime_SimulateSop( pObj, (char *)Mio_GateReadSop((Mio_Gate_t*)pObj->pData) );
419 return;
420 }
421
422 assert(0);
423}
424
425
437void Abc_FlowRetime_SimulateSop( Abc_Obj_t * pObj, char *pSop ) {
438 Abc_Obj_t * pFanin;
439 char *pCube;
440 int i, j, rAnd, rOr, rVar, dcAnd, dcOr, v;
441
442 assert( pSop && !Abc_SopIsExorType(pSop) );
443
444 rOr = 0, dcOr = 0;
445
446 i = Abc_SopGetVarNum(pSop);
447 Abc_SopForEachCube( pSop, i, pCube ) {
448 rAnd = 1, dcAnd = 0;
449 Abc_CubeForEachVar( pCube, v, j ) {
450 pFanin = Abc_ObjFanin(pObj, j);
451 if ( v == '0' )
452 rVar = FTEST(pFanin, INIT_0) ? 1 : 0;
453 else if ( v == '1' )
454 rVar = FTEST(pFanin, INIT_1) ? 1 : 0;
455 else
456 continue;
457
458 if (FTEST(pFanin, INIT_CARE))
459 rAnd &= rVar;
460 else
461 dcAnd = 1;
462 }
463 if (!rAnd) dcAnd = 0; /* controlling value */
464 if (dcAnd)
465 dcOr = 1;
466 else
467 rOr |= rAnd;
468 }
469 if (rOr) dcOr = 0; /* controlling value */
470
471 // complement the result if necessary
472 if ( !Abc_SopGetPhase(pSop) )
473 rOr ^= 1;
474
475 Abc_FlowRetime_SetInitValue(pObj, rOr, dcOr);
476}
477
490 Abc_Obj_t *pLatch, *pObj, *pPi;
491 int i;
492 Vec_Ptr_t *vObj = Vec_PtrAlloc(100);
493
494 // create the network used for the initial state computation
495 if (Abc_NtkIsStrash(pNtk)) {
497 } else if (Abc_NtkHasMapping(pNtk))
498 pManMR->pInitNtk = Abc_NtkAlloc( pNtk->ntkType, ABC_FUNC_SOP, 1 );
499 else
500 pManMR->pInitNtk = Abc_NtkAlloc( pNtk->ntkType, pNtk->ntkFunc, 1 );
501
502 // mitre inputs
503 Abc_NtkForEachLatch( pNtk, pLatch, i ) {
504 // map latch to initial state network
505 pPi = Abc_NtkCreatePi( pManMR->pInitNtk );
506
507 // DEBUG
508 // printf("setup : mapping latch %d to PI %d\n", pLatch->Id, pPi->Id);
509
510 // has initial state requirement?
511 if (Abc_LatchIsInit0(pLatch)) {
512 pObj = Abc_NtkCreateNodeInv( pManMR->pInitNtk, pPi );
513 Vec_PtrPush(vObj, pObj);
514 }
515 else if (Abc_LatchIsInit1(pLatch)) {
516 Vec_PtrPush(vObj, pPi);
517 }
518
519 Abc_ObjSetData( pLatch, pPi ); // if not verifying init state
520 // FDATA(pLatch)->pInitObj = pPi; // if verifying init state
521 }
522
523 // are there any nodes not DC?
524 if (!Vec_PtrSize(vObj)) {
525 pManMR->fSolutionIsDc = 1;
526 return;
527 } else
528 pManMR->fSolutionIsDc = 0;
529
530 // mitre output
531
532 // create n-input AND gate
533 pObj = Abc_NtkCreateNodeAnd( pManMR->pInitNtk, vObj );
534
535 Abc_ObjAddFanin( Abc_NtkCreatePo( pManMR->pInitNtk ), pObj );
536
537 Vec_PtrFree( vObj );
538}
539
540
553 int i;
554 Abc_Obj_t *pObj, *pInitObj;
555 Vec_Ptr_t *vDelete = Vec_PtrAlloc(0);
556 Abc_Ntk_t *pSatNtk;
557 int result;
558
559 assert(pManMR->pInitNtk);
560
561 // is the solution entirely DC's?
562 if (pManMR->fSolutionIsDc) {
563 Vec_PtrFree(vDelete);
564 Abc_NtkForEachLatch( pNtk, pObj, i ) Abc_LatchSetInitDc( pObj );
565 vprintf("\tno init state computation: all-don't-care solution\n");
566 return 1;
567 }
568
569 // check that network is combinational
570 Abc_NtkForEachObj( pManMR->pInitNtk, pObj, i ) {
571 assert(!Abc_ObjIsLatch(pObj));
572 assert(!Abc_ObjIsBo(pObj));
573 assert(!Abc_ObjIsBi(pObj));
574 }
575
576 // delete superfluous nodes
577 while(Vec_PtrSize( vDelete )) {
578 pObj = (Abc_Obj_t *)Vec_PtrPop( vDelete );
579 Abc_NtkDeleteObj( pObj );
580 }
581 Vec_PtrFree(vDelete);
582
583 // do some final cleanup on the network
586 if (Abc_NtkIsLogic(pManMR->pInitNtk))
587 Abc_NtkCleanup(pManMR->pInitNtk, 0);
588
589#if defined(DEBUG_PRINT_INIT_NTK)
590 Abc_NtkLevelReverse( pManMR->pInitNtk );
591 Abc_NtkForEachObj( pManMR->pInitNtk, pObj, i )
592 if (Abc_ObjLevel( pObj ) < 2)
593 Abc_ObjPrint(stdout, pObj);
594#endif
595
596 vprintf("\tsolving for init state (%d nodes)... ", Abc_NtkObjNum(pManMR->pInitNtk));
597 fflush(stdout);
598#ifdef ABC_USE_CUDD
599 // convert SOPs to BDD
600 if (Abc_NtkHasSop(pManMR->pInitNtk))
601 Abc_NtkSopToBdd( pManMR->pInitNtk );
602 // convert AIGs to BDD
603 if (Abc_NtkHasAig(pManMR->pInitNtk))
604 Abc_NtkAigToBdd( pManMR->pInitNtk );
605#else
606 // convert SOPs to AIG
607 if (Abc_NtkHasSop(pManMR->pInitNtk))
608 Abc_NtkSopToAig( pManMR->pInitNtk );
609#endif
610 pSatNtk = pManMR->pInitNtk;
611
612 // solve
613 result = Abc_NtkMiterSat( pSatNtk, (ABC_INT64_T)500000, (ABC_INT64_T)50000000, 0, NULL, NULL );
614
615 if (!result) {
616 vprintf("SUCCESS\n");
617 } else {
618 vprintf("FAILURE\n");
619 return 0;
620 }
621
622 // clear initial values, associate PIs to latches
623 Abc_NtkForEachPi( pManMR->pInitNtk, pInitObj, i ) Abc_ObjSetCopy( pInitObj, NULL );
624 Abc_NtkForEachLatch( pNtk, pObj, i ) {
625 pInitObj = (Abc_Obj_t*)Abc_ObjData( pObj );
626 assert( Abc_ObjIsPi( pInitObj ));
627 Abc_ObjSetCopy( pInitObj, pObj );
628 Abc_LatchSetInitNone( pObj );
629
630 // DEBUG
631 // printf("solve : getting latch %d from PI %d\n", pObj->Id, pInitObj->Id);
632 }
633
634 // copy solution from PIs to latches
635 assert(pManMR->pInitNtk->pModel);
636 Abc_NtkForEachPi( pManMR->pInitNtk, pInitObj, i ) {
637 if ((pObj = Abc_ObjCopy( pInitObj ))) {
638 if ( pManMR->pInitNtk->pModel[i] )
639 Abc_LatchSetInit1( pObj );
640 else
641 Abc_LatchSetInit0( pObj );
642 }
643 }
644
645#if defined(DEBUG_CHECK)
646 // check that all latches have initial state
647 Abc_NtkForEachLatch( pNtk, pObj, i ) assert( !Abc_LatchIsInitNone( pObj ) );
648#endif
649
650 return 1;
651}
652
653
666 Abc_Obj_t *pOrigObj, *pInitObj;
667 Vec_Ptr_t *vBo = Vec_PtrAlloc(100);
668 Vec_Ptr_t *vPi = Vec_PtrAlloc(100);
669 Abc_Ntk_t *pInitNtk = pManMR-> pInitNtk;
670 Abc_Obj_t *pBuf;
671 int i;
672
673 // remove PIs from network (from BOs)
674 Abc_NtkForEachObj( pNtk, pOrigObj, i )
675 if (Abc_ObjIsBo(pOrigObj)) {
676 pInitObj = FDATA(pOrigObj)->pInitObj;
677 assert(Abc_ObjIsPi(pInitObj));
678
679 // DEBUG
680 // printf("update : freeing PI %d\n", pInitObj->Id);
681
682 // create a buffer instead
683 pBuf = Abc_NtkCreateNodeBuf( pInitNtk, NULL );
684 Abc_FlowRetime_ClearInitToOrig( pBuf );
685
686 Abc_ObjBetterTransferFanout( pInitObj, pBuf, 0 );
687 FDATA(pOrigObj)->pInitObj = pBuf;
688 pOrigObj->fMarkA = 1;
689
690 Vec_PtrPush(vBo, pOrigObj);
691 Vec_PtrPush(vPi, pInitObj);
692 }
693
694 // check that PIs are all free
695 Abc_NtkForEachPi( pInitNtk, pInitObj, i) {
696 assert( Abc_ObjFanoutNum( pInitObj ) == 0);
697 }
698
699 // add PIs to to latches
700 Abc_NtkForEachLatch( pNtk, pOrigObj, i ) {
701 assert(Vec_PtrSize(vPi) > 0);
702 pInitObj = (Abc_Obj_t*)Vec_PtrPop(vPi);
703
704 // DEBUG
705 // printf("update : mapping latch %d to PI %d\n", pOrigObj->Id, pInitObj->Id);
706
707 pOrigObj->fMarkA = pOrigObj->fMarkB = 1;
708 FDATA(pOrigObj)->pInitObj = pInitObj;
709 Abc_ObjSetData(pOrigObj, pInitObj);
710 }
711
712 // recursively build init network
713 Vec_PtrForEachEntry( Abc_Obj_t *, vBo, pOrigObj, i )
714 Abc_FlowRetime_UpdateBackwardInit_rec( pOrigObj );
715
716 // clear flags
717 Abc_NtkForEachObj( pNtk, pOrigObj, i )
718 pOrigObj->fMarkA = pOrigObj->fMarkB = 0;
719
720 // deallocate
721 Vec_PtrFree( vBo );
722 Vec_PtrFree( vPi );
723}
724
725
738 Abc_Ntk_t *pNtk = pManMR->pNtk;
739 Abc_Ntk_t *pInitNtk = pManMR->pInitNtk;
740 Abc_Obj_t *pInitObj;
741 void *pData;
742 int fCompl[2];
743
744 assert(pOrigObj);
745
746 // what we do depends on the ntk types of original / init networks...
747
748 // (0) convert BI/BO nodes to buffers
749 if (Abc_ObjIsBi( pOrigObj ) || Abc_ObjIsBo( pOrigObj ) ) {
750 pInitObj = Abc_NtkCreateNodeBuf( pInitNtk, NULL );
751 Abc_FlowRetime_ClearInitToOrig( pInitObj );
752 return pInitObj;
753 }
754
755 // (i) strash node -> SOP node
756 if (Abc_NtkIsStrash( pNtk )) {
757
758 if (Abc_AigNodeIsConst( pOrigObj )) {
759 return Abc_NtkCreateNodeConst1( pInitNtk );
760 }
761 if (!Abc_ObjIsNode( pOrigObj )) {
762 assert(Abc_ObjFaninNum(pOrigObj) == 1);
763 pInitObj = Abc_NtkCreateNodeBuf( pInitNtk, NULL );
764 Abc_FlowRetime_ClearInitToOrig( pInitObj );
765 return pInitObj;
766 }
767
768 assert( Abc_ObjIsNode(pOrigObj) );
769 pInitObj = Abc_NtkCreateObj( pInitNtk, ABC_OBJ_NODE );
770
771 fCompl[0] = pOrigObj->fCompl0 ? 1 : 0;
772 fCompl[1] = pOrigObj->fCompl1 ? 1 : 0;
773
774 pData = Abc_SopCreateAnd( (Mem_Flex_t *)pInitNtk->pManFunc, 2, fCompl );
775 assert(pData);
776 pInitObj->pData = Abc_SopRegister( (Mem_Flex_t *)pInitNtk->pManFunc, (const char*)pData );
777 }
778
779 // (ii) mapped node -> SOP node
780 else if (Abc_NtkHasMapping( pNtk )) {
781 if (!pOrigObj->pData) {
782 // assume terminal...
783 assert(Abc_ObjFaninNum(pOrigObj) == 1);
784
785 pInitObj = Abc_NtkCreateNodeBuf( pInitNtk, NULL );
786 Abc_FlowRetime_ClearInitToOrig( pInitObj );
787 return pInitObj;
788 }
789
790 pInitObj = Abc_NtkCreateObj( pInitNtk, (Abc_ObjType_t)Abc_ObjType(pOrigObj) );
791 pData = Mio_GateReadSop((Mio_Gate_t*)pOrigObj->pData);
792 assert( Abc_SopGetVarNum((char*)pData) == Abc_ObjFaninNum(pOrigObj) );
793
794 pInitObj->pData = Abc_SopRegister( (Mem_Flex_t *)pInitNtk->pManFunc, (const char*)pData );
795 }
796
797 // (iii) otherwise, duplicate obj
798 else {
799 pInitObj = Abc_NtkDupObj( pInitNtk, pOrigObj, 0 );
800
801 // copy phase
802 pInitObj->fPhase = pOrigObj->fPhase;
803 }
804
805 assert(pInitObj);
806 return pInitObj;
807}
808
831Abc_Obj_t* Abc_FlowRetime_UpdateBackwardInit_rec( Abc_Obj_t *pOrigObj) {
832 Abc_Obj_t *pOrigFanin, *pInitFanin, *pInitObj;
833 int i;
834
835 assert(pOrigObj);
836
837 // should never reach primary IOs
838 assert(!Abc_ObjIsPi(pOrigObj));
839 assert(!Abc_ObjIsPo(pOrigObj));
840
841 // skip bias nodes
842 if (FTEST(pOrigObj, BIAS_NODE))
843 return NULL;
844
845 // does an init node already exist?
846 if(!pOrigObj->fMarkA) {
847
848 pInitObj = Abc_FlowRetime_CopyNodeToInitNtk( pOrigObj );
849
850 Abc_FlowRetime_SetInitToOrig( pInitObj, pOrigObj );
851 FDATA(pOrigObj)->pInitObj = pInitObj;
852
853 pOrigObj->fMarkA = 1;
854 } else {
855 pInitObj = FDATA(pOrigObj)->pInitObj;
856 }
857 assert(pInitObj);
858
859 // have we already connected this object?
860 if (!pOrigObj->fMarkB) {
861
862 // create and/or connect fanins
863 Abc_ObjForEachFanin( pOrigObj, pOrigFanin, i ) {
864 // should not reach BOs (i.e. the start of the next frame)
865 // the new latch bounday should lie before it
866 assert(!Abc_ObjIsBo( pOrigFanin ));
867 pInitFanin = Abc_FlowRetime_UpdateBackwardInit_rec( pOrigFanin );
868 Abc_ObjAddFanin( pInitObj, pInitFanin );
869 }
870
871 pOrigObj->fMarkB = 1;
872 }
873
874 return pInitObj;
875}
876
877
894void Abc_FlowRetime_VerifyBackwardInit( Abc_Ntk_t * pNtk ) {
895 Abc_Obj_t *pObj, *pFanin;
896 int i;
897
898 vprintf("\t\tupdating init state\n");
899
900 Abc_NtkIncrementTravId( pNtk );
901
902 Abc_NtkForEachObj( pNtk, pObj, i )
903 if (Abc_ObjIsBo( pObj )) {
904 pFanin = Abc_ObjFanin0(pObj);
905 Abc_FlowRetime_VerifyBackwardInit_rec( pFanin );
906
907 if (FTEST(pObj, INIT_CARE)) {
908 if(FTEST(pObj, INIT_CARE) != FTEST(pFanin, INIT_CARE)) {
909 printf("ERROR: expected val=%d care=%d and got val=%d care=%d\n",
910 FTEST(pObj, INIT_1)?1:0, FTEST(pObj, INIT_CARE)?1:0,
911 FTEST(pFanin, INIT_1)?1:0, FTEST(pFanin, INIT_CARE)?1:0 );
912
913 }
914 }
915 }
916}
917
918void Abc_FlowRetime_VerifyBackwardInit_rec( Abc_Obj_t * pObj ) {
919 Abc_Obj_t *pNext;
920 int i;
921
922 assert(!Abc_ObjIsBo(pObj)); // should never reach the inputs
923 assert(!Abc_ObjIsPi(pObj)); // should never reach the inputs
924
925 // visited?
926 if (Abc_NodeIsTravIdCurrent(pObj)) return;
927 Abc_NodeSetTravIdCurrent(pObj);
928
929 if (Abc_ObjIsLatch(pObj)) {
930 FUNSET(pObj, INIT_CARE);
931 if (Abc_LatchIsInit0(pObj))
932 FSET(pObj, INIT_0);
933 else if (Abc_LatchIsInit1(pObj))
934 FSET(pObj, INIT_1);
935 return;
936 }
937
938 Abc_ObjForEachFanin( pObj, pNext, i ) {
939 Abc_FlowRetime_VerifyBackwardInit_rec( pNext );
940 }
941
942 Abc_FlowRetime_SimulateNode( pObj );
943}
944
957 Abc_Ntk_t *pPartNtk, *pInitNtk = pManMR->pInitNtk;
958 Abc_Obj_t *pObj, *pNext, *pPartObj, *pPartNext, *pPo;
959 int i, j, result;
960
961 assert( Abc_NtkPoNum( pInitNtk ) == 1 );
962
963 pPartNtk = Abc_NtkAlloc( pInitNtk->ntkType, pInitNtk->ntkFunc, 0 );
964
965 // copy network
966 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i ) {
967 pObj->Level = i;
968 assert(!Abc_ObjIsPo( pObj ));
969
970 if (i < cut && !pObj->fMarkA) {
971 pPartObj = Abc_NtkCreatePi( pPartNtk );
972 Abc_ObjSetCopy( pObj, pPartObj );
973 } else {
974 // copy node
975 pPartObj = Abc_NtkDupObj( pPartNtk, pObj, 0 );
976 // copy complementation
977 pPartObj->fPhase = pObj->fPhase;
978
979 // connect fanins
980 Abc_ObjForEachFanin( pObj, pNext, j ) {
981 pPartNext = Abc_ObjCopy( pNext );
982 assert(pPartNext);
983 Abc_ObjAddFanin( pPartObj, pPartNext );
984 }
985 }
986
987 assert(pObj->pCopy == pPartObj);
988 }
989
990 // create PO
991 pPo = Abc_NtkCreatePo( pPartNtk );
992 pNext = Abc_ObjFanin0( Abc_NtkPo( pInitNtk, 0 ) );
993 pPartNext = Abc_ObjCopy( pNext );
994 assert( pPartNext );
995 Abc_ObjAddFanin( pPo, pPartNext );
996
997 // check network
998#if defined(DEBUG_CHECK)
999 Abc_NtkAddDummyPoNames(pPartNtk);
1000 Abc_NtkAddDummyPiNames(pPartNtk);
1001 Abc_NtkCheck( pPartNtk );
1002#endif
1003
1004 result = Abc_NtkMiterSat( pPartNtk, (ABC_INT64_T)500000, (ABC_INT64_T)50000000, 0, NULL, NULL );
1005
1006 Abc_NtkDelete( pPartNtk );
1007
1008 return !result;
1009}
1010
1011
1024 Vec_Ptr_t *vNodes;
1025 int low, high, mid;
1026 int i, n, lag;
1027 Abc_Obj_t *pObj = NULL, *pOrigObj;
1028 InitConstraint_t *pConstraint = ABC_ALLOC( InitConstraint_t, 1 );
1029
1030 memset( pConstraint, 0, sizeof(InitConstraint_t) );
1031
1032 assert(pManMR->pInitNtk);
1033
1034 vprintf("\tsearch for initial state conflict...\n");
1035
1036 vNodes = Abc_NtkDfs(pManMR->pInitNtk, 0);
1037 n = Vec_PtrSize(vNodes);
1038 // also add PIs to vNodes
1039 Abc_NtkForEachPi(pManMR->pInitNtk, pObj, i)
1040 Vec_PtrPush(vNodes, pObj);
1041 Vec_PtrReorder(vNodes, n);
1042
1043#if defined(DEBUG_CHECK)
1044 assert(!Abc_FlowRetime_PartialSat( vNodes, 0 ));
1045#endif
1046
1047 // grow initialization constraint
1048 do {
1049 vprintf("\t\t");
1050
1051 // find element to add to set...
1052 low = 0, high = Vec_PtrSize(vNodes);
1053 while (low != high-1) {
1054 mid = (low + high) >> 1;
1055
1056 if (!Abc_FlowRetime_PartialSat( vNodes, mid )) {
1057 low = mid;
1058 vprintf("-");
1059 } else {
1060 high = mid;
1061 vprintf("*");
1062 }
1063 fflush(stdout);
1064 }
1065
1066#if defined(DEBUG_CHECK)
1067 assert(Abc_FlowRetime_PartialSat( vNodes, high ));
1068 assert(!Abc_FlowRetime_PartialSat( vNodes, low ));
1069#endif
1070
1071 // mark its TFO
1072 pObj = (Abc_Obj_t*)Vec_PtrEntry( vNodes, low );
1073 Abc_NtkMarkCone_rec( pObj, 1 );
1074 vprintf(" conflict term = %d ", low);
1075
1076#if 0
1077 printf("init ------\n");
1078 Abc_ObjPrint(stdout, pObj);
1079 printf("\n");
1080 Abc_ObjPrintNeighborhood( pObj, 1 );
1081 printf("------\n");
1082#endif
1083
1084 // add node to constraint
1085 Abc_FlowRetime_GetInitToOrig( pObj, &pOrigObj, &lag );
1086 assert(pOrigObj);
1087 vprintf(" <=> %d/%d\n", Abc_ObjId(pOrigObj), lag);
1088
1089#if 0
1090 printf("orig ------\n");
1091 Abc_ObjPrint(stdout, pOrigObj);
1092 printf("\n");
1093 Abc_ObjPrintNeighborhood( pOrigObj, 1 );
1094 printf("------\n");
1095#endif
1096 Vec_IntPush( &pConstraint->vNodes, Abc_ObjId(pOrigObj) );
1097 Vec_IntPush( &pConstraint->vLags, lag );
1098
1099 } while (Abc_FlowRetime_PartialSat( vNodes, Vec_PtrSize(vNodes) ));
1100
1101 pConstraint->pBiasNode = NULL;
1102
1103 // add constraint
1104 Vec_PtrPush( pManMR->vInitConstraints, pConstraint );
1105
1106 // clear marks
1107 Abc_NtkForEachObj( pManMR->pInitNtk, pObj, i)
1108 pObj->fMarkA = 0;
1109
1110 // free
1111 Vec_PtrFree( vNodes );
1112}
1113
1114
1127 // Abc_Ntk_t *pNtk = pManMR->pNtk;
1128 Abc_Obj_t *pBiasNode;
1129 InitConstraint_t *pConstraint;
1130 int i;
1131
1132 Vec_PtrForEachEntry( InitConstraint_t *, pManMR->vInitConstraints, pConstraint, i ) {
1133 pBiasNode = pConstraint->pBiasNode;
1134 pConstraint->pBiasNode = NULL;
1135
1136 if (pBiasNode)
1137 Abc_NtkDeleteObj(pBiasNode);
1138 }
1139}
1140
1141
1159static void Abc_FlowRetime_ConnectBiasNode(Abc_Obj_t *pBiasNode, Abc_Obj_t *pObj, int biasLag) {
1160 Abc_Obj_t *pCur, *pNext;
1161 int i;
1162 int lag;
1163 Vec_Ptr_t *vNodes = Vec_PtrAlloc(1);
1164 Vec_Int_t *vLags = Vec_IntAlloc(1);
1165 Abc_Ntk_t *pNtk = Abc_ObjNtk( pObj );
1166
1167 Vec_PtrPush( vNodes, pObj );
1168 Vec_IntPush( vLags, 0 );
1169
1170 Abc_NtkIncrementTravId( pNtk );
1171
1172 while (Vec_PtrSize( vNodes )) {
1173 pCur = (Abc_Obj_t*)Vec_PtrPop( vNodes );
1174 lag = Vec_IntPop( vLags );
1175
1176 if (Abc_NodeIsTravIdCurrent( pCur )) continue;
1177 Abc_NodeSetTravIdCurrent( pCur );
1178
1179 if (!Abc_ObjIsLatch(pCur) &&
1180 !Abc_ObjIsBo(pCur) &&
1181 Abc_FlowRetime_GetLag(pObj)+lag == biasLag ) {
1182
1183 // printf("biasing : ");
1184 // Abc_ObjPrint(stdout, pCur );
1185#if 1
1186 FSET( pCur, BLOCK );
1187#else
1188 Abc_ObjAddFanin( pCur, pBiasNode );
1189#endif
1190 }
1191
1192 Abc_ObjForEachFanout( pCur, pNext, i ) {
1193 if (Abc_ObjIsBi(pNext) ||
1194 Abc_ObjIsLatch(pNext) ||
1195 Abc_ObjIsBo(pNext) ||
1196 Abc_ObjIsBo(pCur)) {
1197 Vec_PtrPush( vNodes, pNext );
1198 Vec_IntPush( vLags, lag - Abc_ObjIsLatch(pNext) ? 1 : 0 );
1199 }
1200 }
1201 }
1202
1203 Vec_PtrFree( vNodes );
1204 Vec_IntFree( vLags );
1205}
1206
1219 Abc_Ntk_t *pNtk = pManMR->pNtk;
1220 Abc_Obj_t *pBiasNode, *pObj;
1221 InitConstraint_t *pConstraint;
1222 int i, j, id;
1223 const int nConstraints = Vec_PtrSize( pManMR->vInitConstraints );
1224
1225 pManMR->pDataArray = ABC_REALLOC( Flow_Data_t, pManMR->pDataArray, pManMR->nNodes + (nConstraints*(pManMR->iteration+1)) );
1226 memset(pManMR->pDataArray + pManMR->nNodes, 0, sizeof(Flow_Data_t)*(nConstraints*(pManMR->iteration+1)));
1227
1228 vprintf("\t\tcreating %d bias structures\n", nConstraints);
1229
1230 Vec_PtrForEachEntry(InitConstraint_t*, pManMR->vInitConstraints, pConstraint, i ) {
1231 if (pConstraint->pBiasNode) continue;
1232
1233 // printf("\t\t\tbias %d...\n", i);
1234 pBiasNode = Abc_NtkCreateBlackbox( pNtk );
1235
1236 Vec_IntForEachEntry( &pConstraint->vNodes, id, j ) {
1237 pObj = Abc_NtkObj(pNtk, id);
1238 Abc_FlowRetime_ConnectBiasNode(pBiasNode, pObj, Vec_IntEntry(&pConstraint->vLags, j));
1239 }
1240
1241 // pConstraint->pBiasNode = pBiasNode;
1242 }
1243}
1244
1245
1257void Abc_FlowRetime_ClearInitToOrig( Abc_Obj_t *pInit )
1258{
1259 int id = Abc_ObjId( pInit );
1260
1261 // grow data structure if necessary
1262 if (id >= pManMR->sizeInitToOrig) {
1263 int oldSize = pManMR->sizeInitToOrig;
1264 pManMR->sizeInitToOrig = 1.5*id + 10;
1265 pManMR->pInitToOrig = (NodeLag_t*)realloc(pManMR->pInitToOrig, sizeof(NodeLag_t)*pManMR->sizeInitToOrig);
1266 memset( &(pManMR->pInitToOrig[oldSize]), 0, sizeof(NodeLag_t)*(pManMR->sizeInitToOrig-oldSize) );
1267 }
1268 assert( pManMR->pInitToOrig );
1269
1270 pManMR->pInitToOrig[id].id = -1;
1271}
1272
1273
1285void Abc_FlowRetime_SetInitToOrig( Abc_Obj_t *pInit, Abc_Obj_t *pOrig)
1286{
1287 int lag;
1288 int id = Abc_ObjId( pInit );
1289
1290 // grow data structure if necessary
1291 if (id >= pManMR->sizeInitToOrig) {
1292 int oldSize = pManMR->sizeInitToOrig;
1293 pManMR->sizeInitToOrig = 1.5*id + 10;
1294 pManMR->pInitToOrig = (NodeLag_t*)realloc(pManMR->pInitToOrig, sizeof(NodeLag_t)*pManMR->sizeInitToOrig);
1295 memset( &(pManMR->pInitToOrig[oldSize]), 0, sizeof(NodeLag_t)*(pManMR->sizeInitToOrig-oldSize) );
1296 }
1297 assert( pManMR->pInitToOrig );
1298
1299 // ignore BI, BO, and latch nodes
1300 if (Abc_ObjIsBo(pOrig) || Abc_ObjIsBi(pOrig) || Abc_ObjIsLatch(pOrig)) {
1301 Abc_FlowRetime_ClearInitToOrig(pInit);
1302 return;
1303 }
1304
1305 // move out of latch boxes
1306 lag = Abc_FlowRetime_ObjFirstNonLatchBox(pOrig, &pOrig);
1307
1308 pManMR->pInitToOrig[id].id = Abc_ObjId(pOrig);
1309 pManMR->pInitToOrig[id].lag = Abc_FlowRetime_GetLag(pOrig) + lag;
1310}
1311
1312
1324void Abc_FlowRetime_GetInitToOrig( Abc_Obj_t *pInit, Abc_Obj_t **pOrig, int *lag ) {
1325
1326 int id = Abc_ObjId( pInit );
1327 int origId;
1328
1329 assert(id < pManMR->sizeInitToOrig);
1330
1331 origId = pManMR->pInitToOrig[id].id;
1332
1333 if (origId < 0) {
1334 assert(Abc_ObjFaninNum(pInit));
1335 Abc_FlowRetime_GetInitToOrig( Abc_ObjFanin0(pInit), pOrig, lag);
1336 return;
1337 }
1338
1339 *pOrig = Abc_NtkObj(pManMR->pNtk, origId);
1340 *lag = pManMR->pInitToOrig[id].lag;
1341}
1343
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
ABC_DLL Abc_Ntk_t * Abc_NtkAlloc(Abc_NtkType_t Type, Abc_NtkFunc_t Func, int fUseMemMan)
DECLARATIONS ///.
Definition abcNtk.c:53
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition abcFanio.c:84
ABC_DLL void Abc_NtkDeleteObj(Abc_Obj_t *pObj)
Definition abcObj.c:170
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst1(Abc_Ntk_t *pNtk)
Definition abcObj.c:643
ABC_DLL Abc_Obj_t * Abc_NtkDupObj(Abc_Ntk_t *pNtkNew, Abc_Obj_t *pObj, int fCopyName)
Definition abcObj.c:342
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeBuf(Abc_Ntk_t *pNtk, Abc_Obj_t *pFanin)
Definition abcObj.c:706
ABC_DLL int Abc_NtkCleanup(Abc_Ntk_t *pNtk, int fVerbose)
Definition abcSweep.c:478
#define Abc_NtkForEachLatch(pNtk, pObj, i)
Definition abc.h:500
ABC_DLL int Abc_NtkSopToBdd(Abc_Ntk_t *pNtk)
Definition abcFunc.c:865
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
Definition abcDfs.c:82
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition abcCheck.c:64
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
Definition abc.h:449
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition abc.h:527
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition abc.h:529
Abc_ObjType_t
Definition abc.h:86
@ ABC_OBJ_NODE
Definition abc.h:94
ABC_DLL void Abc_ObjPrint(FILE *pFile, Abc_Obj_t *pObj)
Definition abcPrint.c:1674
ABC_DLL int Abc_NtkLevelReverse(Abc_Ntk_t *pNtk)
Definition abcDfs.c:1499
ABC_DLL int Abc_SopGetPhase(char *pSop)
Definition abcSop.c:604
#define Abc_CubeForEachVar(pCube, Value, i)
Definition abc.h:536
ABC_DLL int Abc_NtkSopToAig(Abc_Ntk_t *pNtk)
Definition abcFunc.c:884
struct Abc_Ntk_t_ Abc_Ntk_t
Definition abc.h:115
ABC_DLL int Abc_NodeIsConst0(Abc_Obj_t *pNode)
Definition abcObj.c:884
ABC_DLL int Abc_NtkMiterSat(Abc_Ntk_t *pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int fVerbose, ABC_INT64_T *pNumConfs, ABC_INT64_T *pNumInspects)
FUNCTION DEFINITIONS ///.
Definition abcSat.c:58
@ ABC_NTK_LOGIC
Definition abc.h:57
ABC_DLL int Abc_NtkAigToBdd(Abc_Ntk_t *pNtk)
Definition abcFunc.c:869
ABC_DLL char * Abc_SopCreateAnd(Mem_Flex_t *pMan, int nVars, int *pfCompl)
Definition abcSop.c:168
ABC_DLL void Abc_NtkAddDummyPoNames(Abc_Ntk_t *pNtk)
Definition abcNames.c:521
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeAnd(Abc_Ntk_t *pNtk, Vec_Ptr_t *vFanins)
Definition abcObj.c:738
#define Abc_SopForEachCube(pSop, nFanins, pCube)
Definition abc.h:538
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeInv(Abc_Ntk_t *pNtk, Abc_Obj_t *pFanin)
Definition abcObj.c:674
#define Abc_NtkForEachPi(pNtk, pPi, i)
Definition abc.h:516
ABC_DLL int Abc_SopGetVarNum(char *pSop)
Definition abcSop.c:584
ABC_DLL int Abc_SopIsExorType(char *pSop)
Definition abcSop.c:850
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition abcNtk.c:1421
ABC_DLL Abc_Obj_t * Abc_NtkCreateObj(Abc_Ntk_t *pNtk, Abc_ObjType_t Type)
Definition abcObj.c:109
@ ABC_FUNC_SOP
Definition abc.h:65
ABC_DLL char * Abc_SopRegister(Mem_Flex_t *pMan, const char *pName)
DECLARATIONS ///.
Definition abcSop.c:62
ABC_DLL int Abc_NodeIsConst1(Abc_Obj_t *pNode)
Definition abcObj.c:916
ABC_DLL void Abc_NtkAddDummyPiNames(Abc_Ntk_t *pNtk)
Definition abcNames.c:495
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#define ABC_REALLOC(type, obj, num)
Definition abc_global.h:268
#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
void * Abc_FrameReadLibGen()
Definition mainFrame.c:59
int Abc_FlowRetime_SolveBackwardInit(Abc_Ntk_t *pNtk)
Definition fretInit.c:552
Abc_Obj_t * Abc_FlowRetime_CopyNodeToInitNtk(Abc_Obj_t *pOrigObj)
Definition fretInit.c:737
void Abc_FlowRetime_AddInitBias()
Definition fretInit.c:1218
int Abc_FlowRetime_PartialSat(Vec_Ptr_t *vNodes, int cut)
Definition fretInit.c:956
void Abc_FlowRetime_PrintInitStateInfo(Abc_Ntk_t *pNtk)
Definition fretInit.c:133
void Abc_FlowRetime_RemoveInitBias()
Definition fretInit.c:1126
void Abc_FlowRetime_UpdateForwardInit(Abc_Ntk_t *pNtk)
Definition fretInit.c:163
void Abc_NtkMarkCone_rec(Abc_Obj_t *pObj, int fForward)
Definition retArea.c:147
void Abc_FlowRetime_InitState(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition fretInit.c:75
void Abc_FlowRetime_UpdateBackwardInit(Abc_Ntk_t *pNtk)
Definition fretInit.c:665
void Abc_FlowRetime_ConstrainInit()
Definition fretInit.c:1023
void Abc_FlowRetime_SetupBackwardInit(Abc_Ntk_t *pNtk)
Definition fretInit.c:489
#define FSET(x, y)
Definition fretime.h:81
#define vprintf
Definition fretime.h:138
void Abc_ObjPrintNeighborhood(Abc_Obj_t *pObj, int depth)
Definition fretMain.c:1369
#define INIT_1
Definition fretime.h:53
#define FDATA(x)
Definition fretime.h:80
#define INIT_CARE
Definition fretime.h:54
void Abc_ObjBetterTransferFanout(Abc_Obj_t *pFrom, Abc_Obj_t *pTo, int complement)
Definition fretMain.c:1032
int Abc_FlowRetime_GetLag(Abc_Obj_t *pObj)
Definition fretMain.c:1323
struct NodeLag_T_ NodeLag_t
#define BLOCK
Definition fretime.h:51
MinRegMan_t * pManMR
Definition fretMain.c:52
#define INIT_0
Definition fretime.h:52
#define BIAS_NODE
Definition fretime.h:57
#define FUNSET(x, y)
Definition fretime.h:82
struct Flow_Data_t_ Flow_Data_t
struct InitConstraint_t_ InitConstraint_t
#define FTEST(x, y)
Definition fretime.h:83
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Definition hop.h:49
struct Hop_Obj_t_ Hop_Obj_t
Definition hop.h:50
char * Mio_GateReadSop(Mio_Gate_t *pGate)
Definition mioApi.c:179
struct Mio_GateStruct_t_ Mio_Gate_t
Definition mio.h:43
struct Mem_Flex_t_ Mem_Flex_t
Definition mem.h:34
Abc_NtkType_t ntkType
Definition abc.h:156
void * pManFunc
Definition abc.h:191
Abc_NtkFunc_t ntkFunc
Definition abc.h:157
void * pData
Definition abc.h:145
unsigned fMarkB
Definition abc.h:135
unsigned fCompl1
Definition abc.h:141
Abc_Obj_t * pCopy
Definition abc.h:148
unsigned fMarkA
Definition abc.h:134
unsigned fPhase
Definition abc.h:137
unsigned Level
Definition abc.h:142
unsigned fCompl0
Definition abc.h:140
unsigned int fMarkA
Definition hop.h:77
unsigned int fMarkB
Definition hop.h:78
void * pData
Definition hop.h:68
Vec_Int_t vNodes
Definition fretime.h:94
Abc_Obj_t * pBiasNode
Definition fretime.h:92
Vec_Int_t vLags
Definition fretime.h:95
#define assert(ex)
Definition util_old.h:213
char * memset()
char * realloc()
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
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