Commit 53ca51f6 by Alan Mishchenko

Using seed assignment of edges in &edge.

parent 6f370462
...@@ -1217,6 +1217,7 @@ extern Gia_Man_t * Gia_ManDupSliced( Gia_Man_t * p, int nSuppMax ); ...@@ -1217,6 +1217,7 @@ extern Gia_Man_t * Gia_ManDupSliced( Gia_Man_t * p, int nSuppMax );
extern void Gia_ManEdgeFromArray( Gia_Man_t * p, Vec_Int_t * vArray ); extern void Gia_ManEdgeFromArray( Gia_Man_t * p, Vec_Int_t * vArray );
extern Vec_Int_t * Gia_ManEdgeToArray( Gia_Man_t * p ); extern Vec_Int_t * Gia_ManEdgeToArray( Gia_Man_t * p );
extern void Gia_ManConvertPackingToEdges( Gia_Man_t * p ); extern void Gia_ManConvertPackingToEdges( Gia_Man_t * p );
extern int Gia_ObjCheckEdge( Gia_Man_t * p, int iObj, int iNext );
extern int Gia_ManEvalEdgeDelay( Gia_Man_t * p ); extern int Gia_ManEvalEdgeDelay( Gia_Man_t * p );
extern int Gia_ManEvalEdgeCount( Gia_Man_t * p ); extern int Gia_ManEvalEdgeCount( Gia_Man_t * p );
extern int Gia_ManComputeEdgeDelay( Gia_Man_t * p, int fUseTwo ); extern int Gia_ManComputeEdgeDelay( Gia_Man_t * p, int fUseTwo );
......
...@@ -169,6 +169,10 @@ static inline int Gia_ObjHaveEdge( Gia_Man_t * p, int iObj, int iNext ) ...@@ -169,6 +169,10 @@ static inline int Gia_ObjHaveEdge( Gia_Man_t * p, int iObj, int iNext )
{ {
return Vec_IntEntry(p->vEdge1, iObj) == iNext || Vec_IntEntry(p->vEdge2, iObj) == iNext; return Vec_IntEntry(p->vEdge1, iObj) == iNext || Vec_IntEntry(p->vEdge2, iObj) == iNext;
} }
int Gia_ObjCheckEdge( Gia_Man_t * p, int iObj, int iNext )
{
return Gia_ObjHaveEdge( p, iObj, iNext );
}
static inline int Gia_ObjEvalEdgeDelay( Gia_Man_t * p, int iObj, Vec_Int_t * vDelay ) static inline int Gia_ObjEvalEdgeDelay( Gia_Man_t * p, int iObj, Vec_Int_t * vDelay )
{ {
int i, iFan, Delay, DelayMax = 0; int i, iFan, Delay, DelayMax = 0;
......
...@@ -47,6 +47,7 @@ struct Seg_Man_t_ ...@@ -47,6 +47,7 @@ struct Seg_Man_t_
int fVerbose; // verbose int fVerbose; // verbose
// window // window
Gia_Man_t * pGia; Gia_Man_t * pGia;
Vec_Int_t * vPolars; // polarity
Vec_Int_t * vEdges; // edges as fanin/fanout pairs Vec_Int_t * vEdges; // edges as fanin/fanout pairs
Vec_Int_t * vFirsts; // first SAT variable Vec_Int_t * vFirsts; // first SAT variable
Vec_Int_t * vNvars; // number of SAT variables Vec_Int_t * vNvars; // number of SAT variables
...@@ -74,15 +75,20 @@ extern sat_solver * Sbm_AddCardinSolver( int LogN, Vec_Int_t ** pvVars ); ...@@ -74,15 +75,20 @@ extern sat_solver * Sbm_AddCardinSolver( int LogN, Vec_Int_t ** pvVars );
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
Vec_Int_t * Seg_ManCountIntEdges( Gia_Man_t * p ) Vec_Int_t * Seg_ManCountIntEdges( Gia_Man_t * p, Vec_Int_t * vPolars )
{ {
int i, iLut, iFanin; int i, iLut, iFanin;
Vec_Int_t * vEdges = Vec_IntAlloc( 1000 ); Vec_Int_t * vEdges = Vec_IntAlloc( 1000 );
assert( Gia_ManHasMapping(p) ); assert( Gia_ManHasMapping(p) );
Vec_IntClear( vPolars );
Gia_ManForEachLut( p, iLut ) Gia_ManForEachLut( p, iLut )
Gia_LutForEachFanin( p, iLut, iFanin, i ) Gia_LutForEachFanin( p, iLut, iFanin, i )
if ( Gia_ObjIsAnd(Gia_ManObj(p, iFanin)) ) if ( Gia_ObjIsAnd(Gia_ManObj(p, iFanin)) )
{
if ( p->vEdge1 && Gia_ObjCheckEdge(p, iFanin, iLut) )
Vec_IntPush( vPolars, Vec_IntSize(vEdges)/2 );
Vec_IntPushTwo( vEdges, iFanin, iLut ); Vec_IntPushTwo( vEdges, iFanin, iLut );
}
return vEdges; return vEdges;
} }
Vec_Wec_t * Seg_ManCollectObjEdges( Vec_Int_t * vEdges, int nObjs ) Vec_Wec_t * Seg_ManCollectObjEdges( Vec_Int_t * vEdges, int nObjs )
...@@ -142,7 +148,8 @@ Seg_Man_t * Seg_ManAlloc( Gia_Man_t * pGia ) ...@@ -142,7 +148,8 @@ Seg_Man_t * Seg_ManAlloc( Gia_Man_t * pGia )
{ {
int nVarsAll; int nVarsAll;
Seg_Man_t * p = ABC_CALLOC( Seg_Man_t, 1 ); Seg_Man_t * p = ABC_CALLOC( Seg_Man_t, 1 );
p->vEdges = Seg_ManCountIntEdges( pGia ); p->vPolars = Vec_IntAlloc( 1000 );
p->vEdges = Seg_ManCountIntEdges( pGia, p->vPolars );
p->nVars = Vec_IntSize(p->vEdges)/2; p->nVars = Vec_IntSize(p->vEdges)/2;
p->LogN = Abc_Base2Log(p->nVars); p->LogN = Abc_Base2Log(p->nVars);
p->Power2 = 1 << p->LogN; p->Power2 = 1 << p->LogN;
...@@ -172,6 +179,7 @@ void Seg_ManClean( Seg_Man_t * p ) ...@@ -172,6 +179,7 @@ void Seg_ManClean( Seg_Man_t * p )
Vec_IntClear( p->vFirsts ); Vec_IntClear( p->vFirsts );
Vec_IntClear( p->vNvars ); Vec_IntClear( p->vNvars );
Vec_IntClear( p->vLits ); Vec_IntClear( p->vLits );
Vec_IntClear( p->vPolars );
// other // other
Gia_ManFillValue( p->pGia ); Gia_ManFillValue( p->pGia );
} }
...@@ -184,6 +192,7 @@ void Seg_ManStop( Seg_Man_t * p ) ...@@ -184,6 +192,7 @@ void Seg_ManStop( Seg_Man_t * p )
Vec_IntFree( p->vFirsts ); Vec_IntFree( p->vFirsts );
Vec_IntFree( p->vNvars ); Vec_IntFree( p->vNvars );
Vec_IntFree( p->vLits ); Vec_IntFree( p->vLits );
Vec_IntFree( p->vPolars );
ABC_FREE( p->pLevels ); ABC_FREE( p->pLevels );
// other // other
ABC_FREE( p ); ABC_FREE( p );
...@@ -432,6 +441,7 @@ void Seg_ManComputeDelay( Gia_Man_t * pGia, int DelayInit, int fTwo, int fVerbos ...@@ -432,6 +441,7 @@ void Seg_ManComputeDelay( Gia_Man_t * pGia, int DelayInit, int fTwo, int fVerbos
sat_solver_set_resource_limits( p->pSat, nBTLimit, 0, 0, 0 ); sat_solver_set_resource_limits( p->pSat, nBTLimit, 0, 0, 0 );
sat_solver_set_runtime_limit( p->pSat, nTimeOut ? nTimeOut * CLOCKS_PER_SEC + Abc_Clock(): 0 ); sat_solver_set_runtime_limit( p->pSat, nTimeOut ? nTimeOut * CLOCKS_PER_SEC + Abc_Clock(): 0 );
sat_solver_set_random( p->pSat, 1 ); sat_solver_set_random( p->pSat, 1 );
sat_solver_set_polarity( p->pSat, Vec_IntArray(p->vPolars), Vec_IntSize(p->vPolars) );
sat_solver_set_var_activity( p->pSat, Vec_IntArray(vVars), Vec_IntSize(vVars) ); sat_solver_set_var_activity( p->pSat, Vec_IntArray(vVars), Vec_IntSize(vVars) );
Vec_IntFree( vVars ); Vec_IntFree( vVars );
// increment delay gradually // increment delay gradually
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment