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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START Vec_Int_tInt2_ManComputeCoPres (Vec_Int_t *vSop, int nRegs)
 DECLARATIONS ///.
 
void Int2_ManCollectInternal_rec (Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vNodes)
 
Vec_Int_tInt2_ManCollectInternal (Gia_Man_t *p, Vec_Int_t *vCoPres)
 
Gia_Man_tInt2_ManProbToGia (Gia_Man_t *p, Vec_Int_t *vSop)
 

Function Documentation

◆ Int2_ManCollectInternal()

Vec_Int_t * Int2_ManCollectInternal ( Gia_Man_t * p,
Vec_Int_t * vCoPres )

Definition at line 84 of file int2Util.c.

85{
86 Vec_Int_t * vNodes;
87 Gia_Obj_t * pObj;
88 int i, Entry;
90 Gia_ObjSetTravIdCurrent(p, Gia_ManConst0(p));
91 Gia_ManForEachCi( p, pObj, i )
92 Gia_ObjSetTravIdCurrent(p, pObj);
93 vNodes = Vec_IntAlloc( 1000 );
94 Vec_IntForEachEntry( vCoPres, Entry, i )
95 Int2_ManCollectInternal_rec( p, Gia_ObjFanin0(Gia_ManCo(p, Entry)), vNodes );
96 return vNodes;
97}
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Cube * p
Definition exorList.c:222
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
void Gia_ManIncrementTravId(Gia_Man_t *p)
Definition giaUtil.c:190
#define Gia_ManForEachCi(p, pObj, i)
Definition gia.h:1228
void Int2_ManCollectInternal_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vNodes)
Definition int2Util.c:72
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Int2_ManCollectInternal_rec()

void Int2_ManCollectInternal_rec ( Gia_Man_t * p,
Gia_Obj_t * pObj,
Vec_Int_t * vNodes )

Definition at line 72 of file int2Util.c.

73{
74 if ( Gia_ObjIsTravIdCurrent(p, pObj) )
75 return;
76 Gia_ObjSetTravIdCurrent(p, pObj);
77 if ( Gia_ObjIsCi(pObj) )
78 return;
79 assert( Gia_ObjIsAnd(pObj) );
80 Int2_ManCollectInternal_rec( p, Gia_ObjFanin0(pObj), vNodes );
81 Int2_ManCollectInternal_rec( p, Gia_ObjFanin1(pObj), vNodes );
82 Vec_IntPush( vNodes, Gia_ObjId(p, pObj) );
83}
#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_ManComputeCoPres()

ABC_NAMESPACE_IMPL_START Vec_Int_t * Int2_ManComputeCoPres ( Vec_Int_t * vSop,
int nRegs )

DECLARATIONS ///.

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

FileName [int2Util.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
int2Util.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 int2Util.c.

46{
47 Vec_Int_t * vCoPres, * vMap;
48 vCoPres = Vec_IntAlloc( 100 );
49 if ( vSop == NULL )
50 Vec_IntPush( vCoPres, 0 );
51 else
52 {
53 int i, k, Limit;
54 vMap = Vec_IntStart( nRegs );
55 Vec_IntForEachEntryStart( vSop, Limit, i, 1 )
56 {
57 for ( k = 0; k < Limit; k++ )
58 {
59 i++;
60 assert( Vec_IntEntry(vSop, i + k) < 2 * nRegs );
61 Vec_IntWriteEntry( vMap, Abc_Lit2Var(Vec_IntEntry(vSop, i + k)), 1 );
62 }
63 }
64 Vec_IntForEachEntry( vMap, Limit, i )
65 if ( Limit )
66 Vec_IntPush( vCoPres, i+1 );
67 Vec_IntFree( vMap );
68 }
69 return vCoPres;
70}
#define Vec_IntForEachEntryStart(vVec, Entry, i, Start)
Definition vecInt.h:56
Here is the caller graph for this function:

◆ Int2_ManProbToGia()

Gia_Man_t * Int2_ManProbToGia ( Gia_Man_t * p,
Vec_Int_t * vSop )

Definition at line 98 of file int2Util.c.

99{
100 Vec_Int_t * vCoPres, * vNodes;
101 Gia_Man_t * pNew, * pTemp;
102 Gia_Obj_t * pObj;
103 int i, k, Entry, Limit;
104 int Lit, Cube, Sop;
105 assert( Gia_ManPoNum(p) == 1 );
106 // collect COs and ANDs
107 vCoPres = Int2_ManComputeCoPres( vSop, Gia_ManRegNum(p) );
108 vNodes = Int2_ManCollectInternal( p, vCoPres );
109 // create new manager
110 pNew = Gia_ManStart( Gia_ManObjNum(p) );
111 pNew->pName = Abc_UtilStrsav( p->pName );
112 pNew->pSpec = Abc_UtilStrsav( p->pSpec );
113 Gia_ManConst0(p)->Value = 0;
114 Gia_ManForEachCi( p, pObj, i )
115 pObj->Value = Gia_ManAppendCi(pNew);
116 Gia_ManHashAlloc( pNew );
117 Gia_ManForEachObjVec( vNodes, p, pObj, i )
118 pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
119 Vec_IntForEachEntry( vCoPres, Entry, i )
120 {
121 pObj = Gia_ManCo(p, Entry);
122 pObj->Value = Gia_ObjFanin0Copy( pObj );
123 }
124 // create additional cubes
125 Sop = 0;
126 Vec_IntForEachEntryStart( vSop, Limit, i, 1 )
127 {
128 Cube = 1;
129 for ( k = 0; k < Limit; k++ )
130 {
131 i++;
132 Lit = Vec_IntEntry( vSop, i + k );
133 pObj = Gia_ManRi( p, Abc_Lit2Var(Lit) );
134 Cube = Gia_ManHashAnd( pNew, Cube, Abc_LitNotCond(pObj->Value, Abc_LitIsCompl(Lit)) );
135 }
136 Sop = Gia_ManHashOr( pNew, Sop, Cube );
137 }
138 Gia_ManAppendCo( pNew, Sop );
139 Gia_ManHashStop( pNew );
140 // cleanup
141 pNew = Gia_ManCleanup( pTemp = pNew );
142 Gia_ManStop( pTemp );
143 return pNew;
144}
struct cube Cube
void Gia_ManStop(Gia_Man_t *p)
Definition giaMan.c:82
void Gia_ManHashAlloc(Gia_Man_t *p)
Definition giaHash.c:105
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
Definition giaMan.c:57
int Gia_ManHashOr(Gia_Man_t *p, int iLit0, int iLit1)
Definition giaHash.c:621
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
Definition gia.h:1194
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
Definition giaScl.c:84
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition giaHash.c:576
void Gia_ManHashStop(Gia_Man_t *p)
Definition giaHash.c:149
Vec_Int_t * Int2_ManCollectInternal(Gia_Man_t *p, Vec_Int_t *vCoPres)
Definition int2Util.c:84
ABC_NAMESPACE_IMPL_START Vec_Int_t * Int2_ManComputeCoPres(Vec_Int_t *vSop, int nRegs)
DECLARATIONS ///.
Definition int2Util.c:45
char * pSpec
Definition gia.h:100
char * pName
Definition gia.h:99
unsigned Value
Definition gia.h:89
Here is the call graph for this function:
Here is the caller graph for this function: