ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
absRef.c File Reference
#include "sat/bsat/satSolver2.h"
#include "abs.h"
#include "absRef.h"
Include dependency graph for absRef.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void Ga2_ManCnfAddStatic (sat_solver2 *pSat, Vec_Int_t *vCnf0, Vec_Int_t *vCnf1, int *pLits, int iLitOut, int ProofId)
 DECLARATIONS ///.
 
Vec_Int_tGa2_ManCnfCompute (unsigned uTruth, int nVars, Vec_Int_t *vCover)
 
Rnm_Man_tRnm_ManStart (Gia_Man_t *pGia)
 FUNCTION DEFINITIONS ///.
 
void Rnm_ManStop (Rnm_Man_t *p, int fProfile)
 
double Rnm_ManMemoryUsage (Rnm_Man_t *p)
 
void Rnm_ManCollect_rec (Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vObjs, int nAddOn)
 
void Rnm_ManCollect (Rnm_Man_t *p)
 
void Rnm_ManCleanValues (Rnm_Man_t *p)
 
int Rnm_ManSensitize (Rnm_Man_t *p)
 
void Rnm_ManJustifyPropFanout_rec (Rnm_Man_t *p, Gia_Obj_t *pObj, int f, Vec_Int_t *vSelect)
 
void Rnm_ManJustify_rec (Rnm_Man_t *p, Gia_Obj_t *pObj, int f, Vec_Int_t *vSelect)
 
void Rnm_ManVerifyUsingTerSim (Gia_Man_t *p, Abc_Cex_t *pCex, Vec_Int_t *vMap, Vec_Int_t *vObjs, Vec_Int_t *vRes)
 
Vec_Int_tRnm_ManRefine (Rnm_Man_t *p, Abc_Cex_t *pCex, Vec_Int_t *vMap, int fPropFanout, int fNewRefinement, int fVerbose)
 

Function Documentation

◆ Ga2_ManCnfAddStatic()

ABC_NAMESPACE_IMPL_START void Ga2_ManCnfAddStatic ( sat_solver2 * pSat,
Vec_Int_t * vCnf0,
Vec_Int_t * vCnf1,
int * pLits,
int iLitOut,
int ProofId )
extern

DECLARATIONS ///.

CFile****************************************************************

FileName [absRef.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Abstraction package.]

Synopsis [Refinement manager.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id
absRef.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]

◆ Ga2_ManCnfCompute()

Vec_Int_t * Ga2_ManCnfCompute ( unsigned uTruth,
int nVars,
Vec_Int_t * vCover )
extern

Function*************************************************************

Synopsis [Returns CNF of the function.]

Description []

SideEffects []

SeeAlso []

Definition at line 630 of file absGla.c.

631{
632 int RetValue;
633 assert( nVars <= 5 );
634 // transform truth table into the SOP
635 RetValue = Kit_TruthIsop( &uTruth, nVars, vCover, 0 );
636 assert( RetValue == 0 );
637 // check the case of constant cover
638 return Vec_IntDup( vCover );
639}
int Kit_TruthIsop(unsigned *puTruth, int nVars, Vec_Int_t *vMemory, int fTryBoth)
Definition kitIsop.c:134
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:

◆ Rnm_ManCleanValues()

void Rnm_ManCleanValues ( Rnm_Man_t * p)

Definition at line 375 of file absRef.c.

376{
377 Gia_Obj_t * pObj;
378 int i;
379 Gia_ManForEachObjVec( p->vMap, p->pGia, pObj, i )
380 pObj->Value = 0;
381 Gia_ManForEachObjVec( p->vObjs, p->pGia, pObj, i )
382 pObj->Value = 0;
383}
Cube * p
Definition exorList.c:222
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
Definition gia.h:1194
unsigned Value
Definition gia.h:89
Here is the caller graph for this function:

◆ Rnm_ManCollect()

void Rnm_ManCollect ( Rnm_Man_t * p)

Definition at line 351 of file absRef.c.

352{
353 Gia_Obj_t * pObj = NULL;
354 int i;
355 // mark const/PIs/PPIs
356 Gia_ManIncrementTravId( p->pGia );
357 Gia_ObjSetTravIdCurrent( p->pGia, Gia_ManConst0(p->pGia) );
358 Gia_ManConst0(p->pGia)->Value = 0;
359 Gia_ManForEachObjVec( p->vMap, p->pGia, pObj, i )
360 {
361 assert( Gia_ObjIsCi(pObj) || Gia_ObjIsAnd(pObj) );
362 Gia_ObjSetTravIdCurrent( p->pGia, pObj );
363 pObj->Value = 1 + i;
364 }
365 // collect objects
366 Vec_IntClear( p->vObjs );
367 Rnm_ManCollect_rec( p->pGia, Gia_ManPo(p->pGia, 0), p->vObjs, 1 + Vec_IntSize(p->vMap) );
368 Gia_ManForEachObjVec( p->vObjs, p->pGia, pObj, i )
369 if ( Gia_ObjIsRo(p->pGia, pObj) )
370 Rnm_ManCollect_rec( p->pGia, Gia_ObjRoToRi(p->pGia, pObj), p->vObjs, 1 + Vec_IntSize(p->vMap) );
371 // the last object should be a CO
372 assert( Gia_ObjIsCo(pObj) );
373 assert( (int)pObj->Value == Vec_IntSize(p->vMap) + Vec_IntSize(p->vObjs) );
374}
void Rnm_ManCollect_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vObjs, int nAddOn)
Definition absRef.c:334
void Gia_ManIncrementTravId(Gia_Man_t *p)
Definition giaUtil.c:190
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Rnm_ManCollect_rec()

void Rnm_ManCollect_rec ( Gia_Man_t * p,
Gia_Obj_t * pObj,
Vec_Int_t * vObjs,
int nAddOn )

Function*************************************************************

Synopsis [Collect internal objects to be used in value propagation.]

Description [Resulting array vObjs contains RO, AND, PO/RI in a topo order.]

SideEffects []

SeeAlso []

Definition at line 334 of file absRef.c.

335{
336 if ( Gia_ObjIsTravIdCurrent(p, pObj) )
337 return;
338 Gia_ObjSetTravIdCurrent(p, pObj);
339 if ( Gia_ObjIsCo(pObj) )
340 Rnm_ManCollect_rec( p, Gia_ObjFanin0(pObj), vObjs, nAddOn );
341 else if ( Gia_ObjIsAnd(pObj) )
342 {
343 Rnm_ManCollect_rec( p, Gia_ObjFanin0(pObj), vObjs, nAddOn );
344 Rnm_ManCollect_rec( p, Gia_ObjFanin1(pObj), vObjs, nAddOn );
345 }
346 else if ( !Gia_ObjIsRo(p, pObj) )
347 assert( 0 );
348 pObj->Value = Vec_IntSize(vObjs) + nAddOn;
349 Vec_IntPush( vObjs, Gia_ObjId(p, pObj) );
350}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Rnm_ManJustify_rec()

void Rnm_ManJustify_rec ( Rnm_Man_t * p,
Gia_Obj_t * pObj,
int f,
Vec_Int_t * vSelect )

Definition at line 524 of file absRef.c.

525{
526 Rnm_Obj_t * pRnm = Rnm_ManObj( p, pObj, f );
527 int i;//, Id = Gia_ObjId(p->pGia, pObj);
528 if ( pRnm->fVisit )
529 return;
530 if ( p->fPropFanout )
531 Rnm_ManJustifyPropFanout_rec( p, pObj, f, vSelect );
532 else
533 {
534 pRnm->fVisit = 1;
535 if ( Rnm_ManObj( p, pObj, 0 )->fVisitJ == 0 )
536 {
537 Rnm_ManObj( p, pObj, 0 )->fVisitJ = 1;
538 p->nVisited++;
539 }
540 }
541 if ( pRnm->fPPi )
542 {
543 assert( (int)pRnm->Prio > 0 );
544 if ( p->fPropFanout )
545 {
546 for ( i = p->pCex->iFrame; i >= 0; i-- )
547 if ( !Rnm_ManObj(p, pObj, i)->fVisit )
548 Rnm_ManJustifyPropFanout_rec( p, pObj, i, vSelect );
549 }
550 else
551 {
552 Vec_IntPush( vSelect, Gia_ObjId(p->pGia, pObj) );
553// for ( i = p->pCex->iFrame; i >= 0; i-- )
554// Rnm_ManObj(p, pObj, i)->fVisit = 1;
555 }
556 return;
557 }
558 if ( Gia_ObjIsPi(p->pGia, pObj) || Gia_ObjIsConst0(pObj) )
559 return;
560 if ( Gia_ObjIsRo(p->pGia, pObj) )
561 {
562 if ( f > 0 )
563 Rnm_ManJustify_rec( p, Gia_ObjFanin0(Gia_ObjRoToRi(p->pGia, pObj)), f-1, vSelect );
564 return;
565 }
566 if ( Gia_ObjIsAnd(pObj) )
567 {
568 Rnm_Obj_t * pRnm0 = Rnm_ManObj( p, Gia_ObjFanin0(pObj), f );
569 Rnm_Obj_t * pRnm1 = Rnm_ManObj( p, Gia_ObjFanin1(pObj), f );
570 if ( pRnm->Value == 1 )
571 {
572 if ( pRnm0->Prio > 0 )
573 Rnm_ManJustify_rec( p, Gia_ObjFanin0(pObj), f, vSelect );
574 if ( pRnm1->Prio > 0 )
575 Rnm_ManJustify_rec( p, Gia_ObjFanin1(pObj), f, vSelect );
576 }
577 else // select one value
578 {
579 if ( (pRnm0->Value ^ Gia_ObjFaninC0(pObj)) == 0 && (pRnm1->Value ^ Gia_ObjFaninC1(pObj)) == 0 )
580 {
581 if ( pRnm0->Prio <= pRnm1->Prio ) // choice
582 {
583 if ( pRnm0->Prio > 0 )
584 Rnm_ManJustify_rec( p, Gia_ObjFanin0(pObj), f, vSelect );
585 }
586 else
587 {
588 if ( pRnm1->Prio > 0 )
589 Rnm_ManJustify_rec( p, Gia_ObjFanin1(pObj), f, vSelect );
590 }
591 }
592 else if ( (pRnm0->Value ^ Gia_ObjFaninC0(pObj)) == 0 )
593 {
594 if ( pRnm0->Prio > 0 )
595 Rnm_ManJustify_rec( p, Gia_ObjFanin0(pObj), f, vSelect );
596 }
597 else if ( (pRnm1->Value ^ Gia_ObjFaninC1(pObj)) == 0 )
598 {
599 if ( pRnm1->Prio > 0 )
600 Rnm_ManJustify_rec( p, Gia_ObjFanin1(pObj), f, vSelect );
601 }
602 else assert( 0 );
603 }
604 }
605 else assert( 0 );
606}
void Rnm_ManJustify_rec(Rnm_Man_t *p, Gia_Obj_t *pObj, int f, Vec_Int_t *vSelect)
Definition absRef.c:524
void Rnm_ManJustifyPropFanout_rec(Rnm_Man_t *p, Gia_Obj_t *pObj, int f, Vec_Int_t *vSelect)
Definition absRef.c:470
typedefABC_NAMESPACE_HEADER_START struct Rnm_Obj_t_ Rnm_Obj_t
INCLUDES ///.
Definition absRef.h:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Rnm_ManJustifyPropFanout_rec()

void Rnm_ManJustifyPropFanout_rec ( Rnm_Man_t * p,
Gia_Obj_t * pObj,
int f,
Vec_Int_t * vSelect )

Function*************************************************************

Synopsis [Drive implications of the given node towards primary outputs.]

Description []

SideEffects []

SeeAlso []

Definition at line 470 of file absRef.c.

471{
472 Rnm_Obj_t * pRnm0, * pRnm1, * pRnm = Rnm_ManObj( p, pObj, f );
473 Gia_Obj_t * pFanout = NULL;
474 int i, k;//, Id = Gia_ObjId(p->pGia, pObj);
475 assert( pRnm->fVisit == 0 );
476 pRnm->fVisit = 1;
477 if ( Rnm_ManObj( p, pObj, 0 )->fVisitJ == 0 )
478 {
479 Rnm_ManObj( p, pObj, 0 )->fVisitJ = 1;
480 p->nVisited++;
481 }
482 if ( pRnm->fPPi )
483 {
484 assert( (int)pRnm->Prio > 0 );
485 for ( i = p->pCex->iFrame; i >= 0; i-- )
486 if ( !Rnm_ManObj(p, pObj, i)->fVisit )
487 Rnm_ManJustifyPropFanout_rec( p, pObj, i, vSelect );
488 Vec_IntPush( vSelect, Gia_ObjId(p->pGia, pObj) );
489 return;
490 }
491 if ( (Gia_ObjIsCo(pObj) && f == p->pCex->iFrame) || Gia_ObjIsPo(p->pGia, pObj) )
492 return;
493 if ( Gia_ObjIsRi(p->pGia, pObj) )
494 {
495 pFanout = Gia_ObjRiToRo(p->pGia, pObj);
496 if ( !Rnm_ManObj(p, pFanout, f+1)->fVisit )
497 Rnm_ManJustifyPropFanout_rec( p, pFanout, f+1, vSelect );
498 return;
499 }
500 assert( Gia_ObjIsRo(p->pGia, pObj) || Gia_ObjIsAnd(pObj) );
501 Gia_ObjForEachFanoutStatic( p->pGia, pObj, pFanout, k )
502 {
503 Rnm_Obj_t * pRnmF;
504 if ( pFanout->Value == 0 )
505 continue;
506 pRnmF = Rnm_ManObj(p, pFanout, f);
507 if ( pRnmF->fPPi || pRnmF->fVisit )
508 continue;
509 if ( Gia_ObjIsCo(pFanout) )
510 {
511 Rnm_ManJustifyPropFanout_rec( p, pFanout, f, vSelect );
512 continue;
513 }
514 assert( Gia_ObjIsAnd(pFanout) );
515 pRnm0 = Rnm_ManObj( p, Gia_ObjFanin0(pFanout), f );
516 pRnm1 = Rnm_ManObj( p, Gia_ObjFanin1(pFanout), f );
517 if ( ((pRnm0->Value ^ Gia_ObjFaninC0(pFanout)) == 0 && pRnm0->fVisit) ||
518 ((pRnm1->Value ^ Gia_ObjFaninC1(pFanout)) == 0 && pRnm1->fVisit) ||
519 ( ((pRnm0->Value ^ Gia_ObjFaninC0(pFanout)) == 1 && pRnm0->fVisit) &&
520 ((pRnm1->Value ^ Gia_ObjFaninC1(pFanout)) == 1 && pRnm1->fVisit) ) )
521 Rnm_ManJustifyPropFanout_rec( p, pFanout, f, vSelect );
522 }
523}
#define Gia_ObjForEachFanoutStatic(p, pObj, pFanout, i)
Definition gia.h:1125
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Rnm_ManMemoryUsage()

double Rnm_ManMemoryUsage ( Rnm_Man_t * p)

Definition at line 317 of file absRef.c.

318{
319 return (double)(sizeof(Rnm_Man_t) + sizeof(Rnm_Obj_t) * p->nObjsAlloc + sizeof(int) * Vec_IntCap(p->vObjs));
320}
struct Rnm_Man_t_ Rnm_Man_t
Definition absRef.h:55
Here is the caller graph for this function:

◆ Rnm_ManRefine()

Vec_Int_t * Rnm_ManRefine ( Rnm_Man_t * p,
Abc_Cex_t * pCex,
Vec_Int_t * vMap,
int fPropFanout,
int fNewRefinement,
int fVerbose )

Function*************************************************************

Synopsis [Computes the refinement for a given counter-example.]

Description []

SideEffects []

SeeAlso []

Definition at line 673 of file absRef.c.

674{
675 int fVerify = 1;
676 Vec_Int_t * vGoodPPis, * vNewPPis;
677 abctime clk, clk2 = Abc_Clock();
678 int RetValue;
679 p->nCalls++;
680// Gia_ManCleanValue( p->pGia );
681 // initialize
682 p->pCex = pCex;
683 p->vMap = vMap;
684 p->fPropFanout = fPropFanout;
685 p->fVerbose = fVerbose;
686 // collects used objects
687 Rnm_ManCollect( p );
688 // initialize datastructure
689 p->nObjsFrame = 1 + Vec_IntSize(vMap) + Vec_IntSize(p->vObjs);
690 p->nObjs = p->nObjsFrame * (pCex->iFrame + 1);
691 if ( p->nObjs > p->nObjsAlloc )
692 p->pObjs = ABC_REALLOC( Rnm_Obj_t, p->pObjs, (p->nObjsAlloc = p->nObjs + 10000) );
693 memset( p->pObjs, 0, sizeof(Rnm_Obj_t) * p->nObjs );
694 // propagate priorities
695 clk = Abc_Clock();
696 vGoodPPis = Vec_IntAlloc( 100 );
697 if ( Rnm_ManSensitize( p ) ) // the CEX is not a true CEX
698 {
699 p->timeFwd += Abc_Clock() - clk;
700 // select refinement
701 clk = Abc_Clock();
702 p->nVisited = 0;
703 Rnm_ManJustify_rec( p, Gia_ObjFanin0(Gia_ManPo(p->pGia, 0)), pCex->iFrame, vGoodPPis );
704 RetValue = Vec_IntUniqify( vGoodPPis );
705// assert( RetValue == 0 );
706 p->timeBwd += Abc_Clock() - clk;
707 }
708
709 // verify (empty) refinement
710 // (only works when post-processing is not applied)
711 if ( fVerify )
712 {
713 clk = Abc_Clock();
714 Rnm_ManVerifyUsingTerSim( p->pGia, p->pCex, p->vMap, p->vObjs, vGoodPPis );
715 p->timeVer += Abc_Clock() - clk;
716 }
717
718 // at this point array vGoodPPis contains the set of important PPIs
719 if ( Vec_IntSize(vGoodPPis) > 0 ) // spurious CEX resulting in a non-trivial refinement
720 {
721 // filter selected set
722 if ( !fNewRefinement ) // default
723 vNewPPis = Rnm_ManFilterSelected( p, vGoodPPis );
724 else // this is enabled when &gla is called with -r (&gla -r)
725 vNewPPis = Rnm_ManFilterSelectedNew( p, vGoodPPis );
726
727 // replace the PPI array if necessary
728 if ( Vec_IntSize(vNewPPis) > 0 ) // something to select, replace current refinement
729 Vec_IntFree( vGoodPPis ), vGoodPPis = vNewPPis;
730 else // if there is nothing to select, do not change the current refinement array
731 Vec_IntFree( vNewPPis );
732 }
733
734 // clean values
735 // we cannot do this before, because we need to remember what objects
736 // belong to the abstraction when we do Rnm_ManFilterSelected()
738
739// Vec_IntReverseOrder( vGoodPPis );
740 p->timeTotal += Abc_Clock() - clk2;
741 p->nRefines += Vec_IntSize(vGoodPPis);
742 return vGoodPPis;
743}
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_REALLOC(type, obj, num)
Definition abc_global.h:268
void Rnm_ManVerifyUsingTerSim(Gia_Man_t *p, Abc_Cex_t *pCex, Vec_Int_t *vMap, Vec_Int_t *vObjs, Vec_Int_t *vRes)
Definition absRef.c:619
void Rnm_ManCleanValues(Rnm_Man_t *p)
Definition absRef.c:375
int Rnm_ManSensitize(Rnm_Man_t *p)
Definition absRef.c:396
void Rnm_ManCollect(Rnm_Man_t *p)
Definition absRef.c:351
Vec_Int_t * Rnm_ManFilterSelectedNew(Rnm_Man_t *p, Vec_Int_t *vOldPPis)
Vec_Int_t * Rnm_ManFilterSelected(Rnm_Man_t *p, Vec_Int_t *vOldPPis)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Rnm_ManSensitize()

int Rnm_ManSensitize ( Rnm_Man_t * p)

Function*************************************************************

Synopsis [Performs sensitization analysis.]

Description []

SideEffects []

SeeAlso []

Definition at line 396 of file absRef.c.

397{
398 Rnm_Obj_t * pRnm, * pRnm0, * pRnm1;
399 Gia_Obj_t * pObj;
400 int f, i, iBit = p->pCex->nRegs;
401 // const0 is initialized automatically in all timeframes
402 for ( f = 0; f <= p->pCex->iFrame; f++, iBit += p->pCex->nPis )
403 {
404 Gia_ManForEachObjVec( p->vMap, p->pGia, pObj, i )
405 {
406 assert( Gia_ObjIsCi(pObj) || Gia_ObjIsAnd(pObj) );
407 pRnm = Rnm_ManObj( p, pObj, f );
408 pRnm->Value = Abc_InfoHasBit( p->pCex->pData, iBit + i );
409 if ( !Gia_ObjIsPi(p->pGia, pObj) ) // this is PPI
410 {
411 assert( pObj->Value > 0 );
412 pRnm->Prio = pObj->Value;
413 pRnm->fPPi = 1;
414 }
415 }
416 Gia_ManForEachObjVec( p->vObjs, p->pGia, pObj, i )
417 {
418 assert( Gia_ObjIsRo(p->pGia, pObj) || Gia_ObjIsAnd(pObj) || Gia_ObjIsCo(pObj) );
419 pRnm = Rnm_ManObj( p, pObj, f );
420 assert( !pRnm->fPPi );
421 if ( Gia_ObjIsRo(p->pGia, pObj) )
422 {
423 if ( f == 0 )
424 continue;
425 pRnm0 = Rnm_ManObj( p, Gia_ObjRoToRi(p->pGia, pObj), f-1 );
426 pRnm->Value = pRnm0->Value;
427 pRnm->Prio = pRnm0->Prio;
428 continue;
429 }
430 if ( Gia_ObjIsCo(pObj) )
431 {
432 pRnm0 = Rnm_ManObj( p, Gia_ObjFanin0(pObj), f );
433 pRnm->Value = (pRnm0->Value ^ Gia_ObjFaninC0(pObj));
434 pRnm->Prio = pRnm0->Prio;
435 continue;
436 }
437 assert( Gia_ObjIsAnd(pObj) );
438 pRnm0 = Rnm_ManObj( p, Gia_ObjFanin0(pObj), f );
439 pRnm1 = Rnm_ManObj( p, Gia_ObjFanin1(pObj), f );
440 pRnm->Value = (pRnm0->Value ^ Gia_ObjFaninC0(pObj)) & (pRnm1->Value ^ Gia_ObjFaninC1(pObj));
441 if ( pRnm->Value == 1 )
442 pRnm->Prio = Abc_MaxInt( pRnm0->Prio, pRnm1->Prio );
443 else if ( (pRnm0->Value ^ Gia_ObjFaninC0(pObj)) == 0 && (pRnm1->Value ^ Gia_ObjFaninC1(pObj)) == 0 )
444 pRnm->Prio = Abc_MinInt( pRnm0->Prio, pRnm1->Prio ); // choice
445 else if ( (pRnm0->Value ^ Gia_ObjFaninC0(pObj)) == 0 )
446 pRnm->Prio = pRnm0->Prio;
447 else
448 pRnm->Prio = pRnm1->Prio;
449 }
450 }
451 assert( iBit == p->pCex->nBits );
452 pRnm = Rnm_ManObj( p, Gia_ManPo(p->pGia, 0), p->pCex->iFrame );
453 if ( pRnm->Value != 1 )
454 printf( "Output value is incorrect.\n" );
455 return pRnm->Prio;
456}
Here is the caller graph for this function:

◆ Rnm_ManStart()

Rnm_Man_t * Rnm_ManStart ( Gia_Man_t * pGia)

FUNCTION DEFINITIONS ///.

FUNCTION DECLARATIONS ///.

Function*************************************************************

Synopsis [Creates a new manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 264 of file absRef.c.

265{
266 Rnm_Man_t * p;
267 assert( Gia_ManPoNum(pGia) == 1 );
268 p = ABC_CALLOC( Rnm_Man_t, 1 );
269 p->pGia = pGia;
270 p->vObjs = Vec_IntAlloc( 100 );
271 p->vCounts = Vec_StrStart( Gia_ManObjNum(pGia) );
272 p->vFanins = Vec_IntAlloc( 1000 );
273// p->vSatVars = Vec_IntAlloc( 0 );
274// p->vSat2Ids = Vec_IntAlloc( 1000 );
275// p->vIsopMem = Vec_IntAlloc( 0 );
276 p->nObjsAlloc = 10000;
277 p->pObjs = ABC_ALLOC( Rnm_Obj_t, p->nObjsAlloc );
278 if ( p->pGia->vFanout == NULL )
280 Gia_ManCleanValue(pGia);
281 Gia_ManCleanMark0(pGia);
282 Gia_ManCleanMark1(pGia);
283 return p;
284}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
void Gia_ManStaticFanoutStart(Gia_Man_t *p)
Definition giaFanout.c:238
void Gia_ManCleanValue(Gia_Man_t *p)
Definition giaUtil.c:351
void Gia_ManCleanMark0(Gia_Man_t *p)
Definition giaUtil.c:256
void Gia_ManCleanMark1(Gia_Man_t *p)
Definition giaUtil.c:313
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Rnm_ManStop()

void Rnm_ManStop ( Rnm_Man_t * p,
int fProfile )

Definition at line 285 of file absRef.c.

286{
287 if ( !p ) return;
288 // print runtime statistics
289 if ( fProfile && p->nCalls )
290 {
291 double MemGia = sizeof(Gia_Man_t) + sizeof(Gia_Obj_t) * p->pGia->nObjsAlloc + sizeof(int) * p->pGia->nTravIdsAlloc;
292 double MemOther = sizeof(Rnm_Man_t) + sizeof(Rnm_Obj_t) * p->nObjsAlloc + sizeof(int) * Vec_IntCap(p->vObjs);
293 abctime timeOther = p->timeTotal - p->timeFwd - p->timeBwd - p->timeVer;
294 printf( "Abstraction refinement runtime statistics:\n" );
295 ABC_PRTP( "Sensetization", p->timeFwd, p->timeTotal );
296 ABC_PRTP( "Justification", p->timeBwd, p->timeTotal );
297 ABC_PRTP( "Verification ", p->timeVer, p->timeTotal );
298 ABC_PRTP( "Other ", timeOther, p->timeTotal );
299 ABC_PRTP( "TOTAL ", p->timeTotal, p->timeTotal );
300 printf( "Total calls = %d. Average refine = %.1f. GIA mem = %.3f MB. Other mem = %.3f MB.\n",
301 p->nCalls, 1.0*p->nRefines/p->nCalls, MemGia/(1<<20), MemOther/(1<<20) );
302 }
303
304 Gia_ManCleanMark0(p->pGia);
305 Gia_ManCleanMark1(p->pGia);
307// Gia_ManSetPhase(p->pGia);
308// Vec_IntFree( p->vIsopMem );
309// Vec_IntFree( p->vSatVars );
310// Vec_IntFree( p->vSat2Ids );
311 Vec_StrFree( p->vCounts );
312 Vec_IntFree( p->vFanins );
313 Vec_IntFree( p->vObjs );
314 ABC_FREE( p->pObjs );
315 ABC_FREE( p );
316}
#define ABC_PRTP(a, t, T)
Definition abc_global.h:258
#define ABC_FREE(obj)
Definition abc_global.h:267
void Gia_ManStaticFanoutStop(Gia_Man_t *p)
Definition giaFanout.c:393
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
abctime timeOther
Definition llb3Image.c:82
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Rnm_ManVerifyUsingTerSim()

void Rnm_ManVerifyUsingTerSim ( Gia_Man_t * p,
Abc_Cex_t * pCex,
Vec_Int_t * vMap,
Vec_Int_t * vObjs,
Vec_Int_t * vRes )

Function*************************************************************

Synopsis [Performs refinement.]

Description []

SideEffects []

SeeAlso []

Definition at line 619 of file absRef.c.

620{
621 Gia_Obj_t * pObj;
622 int i, f, iBit = pCex->nRegs;
623 Gia_ObjTerSimSet0( Gia_ManConst0(p) );
624 for ( f = 0; f <= pCex->iFrame; f++, iBit += pCex->nPis )
625 {
626 Gia_ManForEachObjVec( vMap, p, pObj, i )
627 {
628 pObj->Value = Abc_InfoHasBit( pCex->pData, iBit + i );
629 if ( !Gia_ObjIsPi(p, pObj) )
630 Gia_ObjTerSimSetX( pObj );
631 else if ( pObj->Value )
632 Gia_ObjTerSimSet1( pObj );
633 else
634 Gia_ObjTerSimSet0( pObj );
635 }
636 Gia_ManForEachObjVec( vRes, p, pObj, i ) // vRes is subset of vMap
637 {
638 if ( pObj->Value )
639 Gia_ObjTerSimSet1( pObj );
640 else
641 Gia_ObjTerSimSet0( pObj );
642 }
643 Gia_ManForEachObjVec( vObjs, p, pObj, i )
644 {
645 if ( Gia_ObjIsCo(pObj) )
646 Gia_ObjTerSimCo( pObj );
647 else if ( Gia_ObjIsAnd(pObj) )
648 Gia_ObjTerSimAnd( pObj );
649 else if ( f == 0 )
650 Gia_ObjTerSimSet0( pObj );
651 else
652 Gia_ObjTerSimRo( p, pObj );
653 }
654 }
655 Gia_ManForEachObjVec( vMap, p, pObj, i )
656 pObj->Value = 0;
657 pObj = Gia_ManPo( p, 0 );
658 if ( !Gia_ObjTerSimGet1(pObj) )
659 Abc_Print( 1, "\nRefinement verification has failed!!!\n" );
660}
Here is the caller graph for this function: