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

Go to the source code of this file.

Functions

void Gia_Iso3Init (Gia_Man_t *p)
 
void Gia_Iso3Compute (Gia_Man_t *p, Vec_Int_t *vSign)
 
int Gia_Iso3Unique (Vec_Int_t *vSign)
 
void Gia_Iso3Test (Gia_Man_t *p)
 
Vec_Wec_tGia_Iso4Gia (Gia_Man_t *p)
 
void Gia_Iso4Test (Gia_Man_t *p)
 
Vec_Int_tGia_IsoCollectData (Gia_Man_t *p, Vec_Int_t *vObjs)
 
void Gia_IsoCompareVecs (Gia_Man_t *pGia0, Vec_Wec_t *vLevs0, Gia_Man_t *pGia1, Vec_Wec_t *vLevs1)
 
void Gia_Iso4TestTwo (Gia_Man_t *pGia0, Gia_Man_t *pGia1)
 

Function Documentation

◆ Gia_Iso3Compute()

void Gia_Iso3Compute ( Gia_Man_t * p,
Vec_Int_t * vSign )

Definition at line 83 of file giaIso3.c.

84{
85 Gia_Obj_t * pObj;
86 int i;
87 Gia_ManForEachObj( p, pObj, i )
88 {
89 if ( Gia_ObjIsAnd(pObj) || Gia_ObjIsCo(pObj) )
90 Gia_Iso3ComputeEdge( p, pObj, Gia_ObjFanin0(pObj), Gia_ObjFaninC0(pObj), vSign );
91 if ( Gia_ObjIsAnd(pObj) )
92 Gia_Iso3ComputeEdge( p, pObj, Gia_ObjFanin1(pObj), Gia_ObjFaninC1(pObj), vSign );
93 }
94}
Cube * p
Definition exorList.c:222
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
Definition gia.h:1190
Here is the caller graph for this function:

◆ Gia_Iso3Init()

void Gia_Iso3Init ( Gia_Man_t * p)

Definition at line 59 of file giaIso3.c.

60{
61 Gia_Obj_t * pObj;
62 int i;
63 Gia_ManForEachObj( p, pObj, i )
64 pObj->Value = Gia_Iso3Node( pObj );
65}
unsigned Value
Definition gia.h:89
Here is the caller graph for this function:

◆ Gia_Iso3Test()

void Gia_Iso3Test ( Gia_Man_t * p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 138 of file giaIso3.c.

139{
140 int nIterMax = 500;
141 int i, Prev = -1, This;
142 abctime clk = Abc_Clock();
143 Vec_Int_t * vSign = NULL;
144 Gia_Iso3Init( p );
145 for ( i = 0; i < nIterMax; i++ )
146 {
147 vSign = Gia_Iso3Save( p );
148// This = Gia_Iso3Unique( vSign );
149 This = Vec_IntUniqueCount( vSign, 1, NULL );
150 printf( "Iter %3d : %6d out of %6d ", i, This, Vec_IntSize(vSign) );
151 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
152 if ( This == Prev )
153 break;
154 Prev = This;
155 Gia_Iso3Compute( p, vSign );
156 Vec_IntFreeP( &vSign );
157 }
158 Vec_IntFreeP( &vSign );
159}
ABC_INT64_T abctime
Definition abc_global.h:332
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
void Gia_Iso3Compute(Gia_Man_t *p, Vec_Int_t *vSign)
Definition giaIso3.c:83
void Gia_Iso3Init(Gia_Man_t *p)
Definition giaIso3.c:59
Here is the call graph for this function:

◆ Gia_Iso3Unique()

int Gia_Iso3Unique ( Vec_Int_t * vSign)

Definition at line 117 of file giaIso3.c.

118{
119 int nUnique;
120 Vec_Int_t * vCopy = Vec_IntDup( vSign );
121 Vec_IntUniqify( vCopy );
122 nUnique = Vec_IntSize(vCopy);
123 Vec_IntFree( vCopy );
124 return nUnique;
125}

◆ Gia_Iso4Gia()

Vec_Wec_t * Gia_Iso4Gia ( Gia_Man_t * p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 172 of file giaIso3.c.

173{
174 Vec_Wec_t * vLevs = Gia_ManLevelizeR( p );
175 Vec_Int_t * vLevel; int l;
176 Abc_Random( 1 );
177 Vec_WecForEachLevel( vLevs, vLevel, l )
178 {
179 Gia_Obj_t * pObj; int i;
180 unsigned RandC[2] = { Abc_Random(0), Abc_Random(0) };
181 if ( l == 0 )
182 {
183 Gia_ManForEachObjVec( vLevel, p, pObj, i )
184 {
185 assert( Gia_ObjIsCo(pObj) );
186 pObj->Value = Abc_Random(0);
187 Gia_ObjFanin0(pObj)->Value += pObj->Value + RandC[Gia_ObjFaninC0(pObj)];
188 }
189 }
190 else
191 {
192 Gia_ManForEachObjVec( vLevel, p, pObj, i ) if ( Gia_ObjIsAnd(pObj) )
193 {
194 Gia_ObjFanin0(pObj)->Value += pObj->Value + RandC[Gia_ObjFaninC0(pObj)];
195 Gia_ObjFanin1(pObj)->Value += pObj->Value + RandC[Gia_ObjFaninC1(pObj)];
196 }
197 }
198 }
199 return vLevs;
200}
unsigned Abc_Random(int fReset)
Definition utilSort.c:1004
Vec_Wec_t * Gia_ManLevelizeR(Gia_Man_t *p)
Definition giaDfs.c:430
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
Definition gia.h:1194
#define assert(ex)
Definition util_old.h:213
#define Vec_WecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Definition vecWec.h:55
typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t
INCLUDES ///.
Definition vecWec.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_Iso4Test()

void Gia_Iso4Test ( Gia_Man_t * p)

Definition at line 201 of file giaIso3.c.

202{
203 Vec_Wec_t * vLevs = Gia_Iso4Gia( p );
204 Vec_Int_t * vLevel; int l;
205 Vec_WecForEachLevel( vLevs, vLevel, l )
206 {
207 Gia_Obj_t * pObj; int i;
208 printf( "Level %d\n", l );
209 Gia_ManForEachObjVec( vLevel, p, pObj, i )
210 printf( "Obj = %5d. Value = %08x.\n", Gia_ObjId(p, pObj), pObj->Value );
211 }
212 Vec_WecFree( vLevs );
213}
Vec_Wec_t * Gia_Iso4Gia(Gia_Man_t *p)
Definition giaIso3.c:172
Here is the call graph for this function:

◆ Gia_Iso4TestTwo()

void Gia_Iso4TestTwo ( Gia_Man_t * pGia0,
Gia_Man_t * pGia1 )

Definition at line 243 of file giaIso3.c.

244{
245 Vec_Wec_t * vLevs0 = Gia_Iso4Gia( pGia0 );
246 Vec_Wec_t * vLevs1 = Gia_Iso4Gia( pGia1 );
247 Gia_IsoCompareVecs( pGia0, vLevs0, pGia1, vLevs1 );
248 Vec_WecFree( vLevs0 );
249 Vec_WecFree( vLevs1 );
250}
void Gia_IsoCompareVecs(Gia_Man_t *pGia0, Vec_Wec_t *vLevs0, Gia_Man_t *pGia1, Vec_Wec_t *vLevs1)
Definition giaIso3.c:222
Here is the call graph for this function:

◆ Gia_IsoCollectData()

Vec_Int_t * Gia_IsoCollectData ( Gia_Man_t * p,
Vec_Int_t * vObjs )

Definition at line 214 of file giaIso3.c.

215{
216 Gia_Obj_t * pObj; int i;
217 Vec_Int_t * vData = Vec_IntAlloc( Vec_IntSize(vObjs) );
218 Gia_ManForEachObjVec( vObjs, p, pObj, i )
219 Vec_IntPush( vData, pObj->Value );
220 return vData;
221}
Here is the caller graph for this function:

◆ Gia_IsoCompareVecs()

void Gia_IsoCompareVecs ( Gia_Man_t * pGia0,
Vec_Wec_t * vLevs0,
Gia_Man_t * pGia1,
Vec_Wec_t * vLevs1 )

Definition at line 222 of file giaIso3.c.

223{
224 int i, Common, nLevels = Abc_MinInt( Vec_WecSize(vLevs0), Vec_WecSize(vLevs1) );
225 Gia_ManPrintStats( pGia0, NULL );
226 Gia_ManPrintStats( pGia1, NULL );
227 printf( "Printing %d shared levels:\n", nLevels );
228 for ( i = 0; i < nLevels; i++ )
229 {
230 Vec_Int_t * vLev0 = Vec_WecEntry(vLevs0, i);
231 Vec_Int_t * vLev1 = Vec_WecEntry(vLevs1, i);
232 Vec_Int_t * vData0 = Gia_IsoCollectData( pGia0, vLev0 );
233 Vec_Int_t * vData1 = Gia_IsoCollectData( pGia1, vLev1 );
234 Vec_IntSort( vData0, 0 );
235 Vec_IntSort( vData1, 0 );
236 Common = Vec_IntTwoCountCommon( vData0, vData1 );
237 printf( "Level = %3d. One = %6d. Two = %6d. Common = %6d.\n",
238 i, Vec_IntSize(vData0)-Common, Vec_IntSize(vData1)-Common, Common );
239 Vec_IntFree( vData0 );
240 Vec_IntFree( vData1 );
241 }
242}
Vec_Int_t * Gia_IsoCollectData(Gia_Man_t *p, Vec_Int_t *vObjs)
Definition giaIso3.c:214
void Gia_ManPrintStats(Gia_Man_t *p, Gps_Par_t *pPars)
Definition giaMan.c:495
Here is the call graph for this function:
Here is the caller graph for this function: