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

Go to the source code of this file.

Functions

int Gia_ManDomDerive_rec (Gia_Man_t *pNew, Gia_Man_t *p, Gia_Obj_t *pNode)
 
Gia_Man_tGia_ManDomDerive (Gia_Man_t *p, Gia_Obj_t *pRoot, Vec_Int_t *vSupp, int nVars)
 
void Gia_ManComputeDomsTry (Gia_Man_t *p)
 

Function Documentation

◆ Gia_ManComputeDomsTry()

void Gia_ManComputeDomsTry ( Gia_Man_t * p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 250 of file giaMffc.c.

251{
252 extern void Gia_ManCollapseTestTest( Gia_Man_t * p );
253
254 Vec_Int_t * vSupp, * vSuppRefs;
255 Gia_Man_t * pNew;
256 Gia_Obj_t * pObj;
257 int i, nSize, Entry, k;
258 abctime clk = Abc_Clock();
259 ABC_FREE( p->pRefs );
262 Gia_ManComputeDoms( p );
263 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
264 vSupp = Vec_IntAlloc( 1000 );
265 vSuppRefs = Vec_IntAlloc( 1000 );
266 Gia_ManForEachObj( p, pObj, i )
267 {
268 if ( !Gia_ObjIsAnd(pObj) && !Gia_ObjIsCo(pObj) )
269 continue;
270 if ( Gia_ObjDom(p, pObj) != i )
271 continue;
272 if ( Gia_ObjIsCo(pObj) )
273 pObj = Gia_ObjFanin0(pObj);
274 if ( !Gia_ObjIsAnd(pObj) )
275 continue;
276 nSize = Gia_NodeMffcSizeSupp( p, pObj, vSupp, vSuppRefs );
277 if ( nSize < 10 )//|| nSize > 100 )
278 continue;
279 // sort by cost
280 Vec_IntSelectSortCost2( Vec_IntArray(vSupp), Vec_IntSize(vSupp), Vec_IntArray(vSuppRefs) );
281
282 printf( "Obj %6d : ", i );
283 printf( "Cone = %4d ", nSize );
284 printf( "Supp = %4d ", Vec_IntSize(vSupp) );
285// Vec_IntForEachEntry( vSuppRefs, Entry, k )
286// printf( "%d(%d) ", -Entry, Gia_ObjLevelId(p, Vec_IntEntry(vSupp, k)) );
287 printf( "\n" );
288
289 // selected k
290 for ( k = 0; k < Vec_IntSize(vSupp); k++ )
291 if ( Vec_IntEntry(vSuppRefs, k) == 1 )
292 break;
293 k = Abc_MinInt( k, 3 );
294 k = 0;
295
296 // dump
297 pNew = Gia_ManDomDerive( p, pObj, vSupp, k );
298 Gia_DumpAiger( pNew, "mffc", i, 6 );
299 Gia_ManCollapseTestTest( pNew );
300
301 Gia_ManStop( pNew );
302 }
303 Vec_IntFree( vSuppRefs );
304 Vec_IntFree( vSupp );
305}
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_FREE(obj)
Definition abc_global.h:267
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Cube * p
Definition exorList.c:222
Gia_Man_t * Gia_ManDomDerive(Gia_Man_t *p, Gia_Obj_t *pRoot, Vec_Int_t *vSupp, int nVars)
Definition giaMffc.c:205
void Gia_ManStop(Gia_Man_t *p)
Definition giaMan.c:82
int Gia_NodeMffcSizeSupp(Gia_Man_t *p, Gia_Obj_t *pNode, Vec_Int_t *vSupp)
Definition giaUtil.c:1279
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
void Gia_DumpAiger(Gia_Man_t *p, char *pFilePrefix, int iFileNum, int nFileNumDigits)
Definition giaAiger.c:1611
void Gia_ManCreateRefs(Gia_Man_t *p)
Definition giaUtil.c:779
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
Definition gia.h:1190
int Gia_ManLevelNum(Gia_Man_t *p)
Definition giaUtil.c:546
Here is the call graph for this function:

◆ Gia_ManDomDerive()

Gia_Man_t * Gia_ManDomDerive ( Gia_Man_t * p,
Gia_Obj_t * pRoot,
Vec_Int_t * vSupp,
int nVars )

Definition at line 205 of file giaMffc.c.

206{
207 Gia_Man_t * pNew, * pTemp;
208 int nMints = 1 << nVars;
209 int i, m, iResLit;
210 assert( nVars >= 0 && nVars <= 5 );
211 pNew = Gia_ManStart( Gia_ManObjNum(p) );
212 pNew->pName = Abc_UtilStrsav( p->pName );
213 pNew->pSpec = Abc_UtilStrsav( p->pSpec );
214 Gia_ManConst0(p)->Value = 0;
215 Gia_ManHashAlloc( pNew );
216 for ( i = 0; i < Vec_IntSize(vSupp); i++ )
217 Gia_ManAppendCi(pNew);
218 for ( m = 0; m < nMints; m++ )
219 {
220 Gia_Obj_t * pObj;
222 Gia_ManForEachObjVec( vSupp, p, pObj, i )
223 {
224 if ( i < nVars )
225 pObj->Value = (m >> i) & 1;
226 else
227 pObj->Value = Gia_ObjToLit(pNew, Gia_ManCi(pNew, i));
228 Gia_ObjSetTravIdCurrent( p, pObj );
229 }
230 iResLit = Gia_ManDomDerive_rec( pNew, p, pRoot );
231 Gia_ManAppendCo( pNew, iResLit );
232 }
233 Gia_ManHashStop( pNew );
234 pNew = Gia_ManCleanup( pTemp = pNew );
235 Gia_ManStop( pTemp );
236 return pNew;
237}
int Gia_ManDomDerive_rec(Gia_Man_t *pNew, Gia_Man_t *p, Gia_Obj_t *pNode)
Definition giaMffc.c:195
void Gia_ManHashAlloc(Gia_Man_t *p)
Definition giaHash.c:105
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
Definition giaMan.c:57
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
Definition gia.h:1194
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
Definition giaScl.c:84
void Gia_ManIncrementTravId(Gia_Man_t *p)
Definition giaUtil.c:190
void Gia_ManHashStop(Gia_Man_t *p)
Definition giaHash.c:149
char * pSpec
Definition gia.h:100
char * pName
Definition gia.h:99
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:

◆ Gia_ManDomDerive_rec()

int Gia_ManDomDerive_rec ( Gia_Man_t * pNew,
Gia_Man_t * p,
Gia_Obj_t * pNode )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 195 of file giaMffc.c.

196{
197 if ( Gia_ObjIsTravIdCurrent(p, pNode) )
198 return pNode->Value;
199 Gia_ObjSetTravIdCurrent(p, pNode);
200 assert( Gia_ObjIsAnd(pNode) );
201 Gia_ManDomDerive_rec( pNew, p, Gia_ObjFanin0(pNode) );
202 Gia_ManDomDerive_rec( pNew, p, Gia_ObjFanin1(pNode) );
203 return pNode->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pNode), Gia_ObjFanin1Copy(pNode) );
204}
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition giaHash.c:576
Here is the call graph for this function:
Here is the caller graph for this function: