ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
int2Refine.c File Reference
#include "int2Int.h"
Include dependency graph for int2Refine.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void Int2_ManJustify_rec (Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vSelect)
 DECLARATIONS ///.
 
Vec_Int_tInt2_ManRefineCube (Gia_Man_t *p, Vec_Int_t *vAssign, Vec_Int_t *vPrio)
 

Function Documentation

◆ Int2_ManJustify_rec()

ABC_NAMESPACE_IMPL_START void Int2_ManJustify_rec ( Gia_Man_t * p,
Gia_Obj_t * pObj,
Vec_Int_t * vSelect )

DECLARATIONS ///.

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

FileName [int2Refine.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Interpolation engine.]

Synopsis [Various utilities.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - Dec 1, 2013.]

Revision [

Id
int2Refine.c,v 1.00 2013/12/01 00:00:00 alanmi Exp

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file int2Refine.c.

46{
47 if ( pObj->fMark1 )
48 return;
49 pObj->fMark1 = 1;
50 if ( Gia_ObjIsPi(p, pObj) )
51 return;
52 if ( Gia_ObjIsCo(pObj) )
53 {
54 Vec_IntPush( vSelect, Gia_ObjCioId(pObj) );
55 return;
56 }
57 assert( Gia_ObjIsAnd(pObj) );
58 if ( pObj->Value == 1 )
59 {
60 if ( Gia_ObjFanin0(pObj)->Value < ABC_INFINITY )
61 Int2_ManJustify_rec( p, Gia_ObjFanin0(pObj), vSelect );
62 if ( Gia_ObjFanin1(pObj)->Value < ABC_INFINITY )
63 Int2_ManJustify_rec( p, Gia_ObjFanin1(pObj), vSelect );
64 return;
65 }
66 if ( (Gia_ObjFanin0(pObj)->fMark0 ^ Gia_ObjFaninC0(pObj)) == 0 && (Gia_ObjFanin1(pObj)->fMark0 ^ Gia_ObjFaninC1(pObj)) == 0 )
67 {
68 if ( Gia_ObjFanin0(pObj)->fMark0 <= Gia_ObjFanin1(pObj)->fMark0 ) // choice
69 {
70 if ( Gia_ObjFanin0(pObj)->Value < ABC_INFINITY )
71 Int2_ManJustify_rec( p, Gia_ObjFanin0(pObj), vSelect );
72 }
73 else
74 {
75 if ( Gia_ObjFanin1(pObj)->Value < ABC_INFINITY )
76 Int2_ManJustify_rec( p, Gia_ObjFanin1(pObj), vSelect );
77 }
78 }
79 else if ( (Gia_ObjFanin0(pObj)->fMark0 ^ Gia_ObjFaninC0(pObj)) == 0 )
80 {
81 if ( Gia_ObjFanin0(pObj)->Value < ABC_INFINITY )
82 Int2_ManJustify_rec( p, Gia_ObjFanin0(pObj), vSelect );
83 }
84 else if ( (Gia_ObjFanin1(pObj)->fMark0 ^ Gia_ObjFaninC1(pObj)) == 0 )
85 {
86 if ( Gia_ObjFanin1(pObj)->Value < ABC_INFINITY )
87 Int2_ManJustify_rec( p, Gia_ObjFanin1(pObj), vSelect );
88 }
89 else assert( 0 );
90 }
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition abc_global.h:250
Cube * p
Definition exorList.c:222
ABC_NAMESPACE_IMPL_START void Int2_ManJustify_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vSelect)
DECLARATIONS ///.
Definition int2Refine.c:45
unsigned fMark1
Definition gia.h:86
unsigned Value
Definition gia.h:89
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Int2_ManRefineCube()

Vec_Int_t * Int2_ManRefineCube ( Gia_Man_t * p,
Vec_Int_t * vAssign,
Vec_Int_t * vPrio )

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

Synopsis [Computes the reduced set of flop variables.]

Description [Given is a single-output seq AIG manager and an assignment of its CIs. Returned is a subset of flops that justifies the output.]

SideEffects []

SeeAlso []

Definition at line 104 of file int2Refine.c.

105{
106 Vec_Int_t * vSubset;
107 Gia_Obj_t * pObj;
108 int i;
109 // set values and prios
110 assert( Gia_ManRegNum(p) > 0 );
111 assert( Vec_IntSize(vAssign) == Vec_IntSize(vPrio) );
112 Gia_ManConst0(p)->fMark0 = 0;
113 Gia_ManConst0(p)->fMark1 = 0;
114 Gia_ManConst0(p)->Value = ABC_INFINITY;
115 Gia_ManForEachCi( p, pObj, i )
116 {
117 pObj->fMark0 = Vec_IntEntry(vAssign, i);
118 pObj->fMark1 = 0;
119 pObj->Value = Vec_IntEntry(vPrio, i);
120 }
121 Gia_ManForEachAnd( p, pObj, i )
122 {
123 pObj->fMark0 = (Gia_ObjFanin0(pObj)->fMark0 ^ Gia_ObjFaninC0(pObj)) & (Gia_ObjFanin1(pObj)->fMark0 ^ Gia_ObjFaninC1(pObj));
124 pObj->fMark1 = 0;
125 if ( pObj->fMark0 == 1 )
126 pObj->Value = Abc_MaxInt( Gia_ObjFanin0(pObj)->Value, Gia_ObjFanin1(pObj)->Value );
127 else if ( (Gia_ObjFanin0(pObj)->fMark0 ^ Gia_ObjFaninC0(pObj)) == 0 && (Gia_ObjFanin1(pObj)->fMark0 ^ Gia_ObjFaninC1(pObj)) == 0 )
128 pObj->Value = Abc_MinInt( Gia_ObjFanin0(pObj)->Value, Gia_ObjFanin1(pObj)->Value ); // choice
129 else if ( (Gia_ObjFanin0(pObj)->fMark0 ^ Gia_ObjFaninC0(pObj)) == 0 )
130 pObj->Value = Gia_ObjFanin0(pObj)->Value;
131 else
132 pObj->Value = Gia_ObjFanin1(pObj)->Value;
133 }
134 pObj = Gia_ManPo( p, 0 );
135 pObj->fMark0 = (Gia_ObjFanin0(pObj)->fMark0 ^ Gia_ObjFaninC0(pObj));
136 pObj->fMark1 = 0;
137 pObj->Value = Gia_ObjFanin0(pObj)->Value;
138 assert( pObj->fMark0 == 1 );
139 assert( pObj->Value < ABC_INFINITY );
140 // select subset
141 vSubset = Vec_IntAlloc( 100 );
142 Int2_ManJustify_rec( p, Gia_ObjFanin0(pObj), vSubset );
143 return vSubset;
144}
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
#define Gia_ManForEachAnd(p, pObj, i)
Definition gia.h:1214
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
#define Gia_ManForEachCi(p, pObj, i)
Definition gia.h:1228
unsigned fMark0
Definition gia.h:81
Here is the call graph for this function:
Here is the caller graph for this function: