21#ifndef ABC__map__mpm_Int_h
22#define ABC__map__mpm_Int_h
52#define MPM_UNIT_TIME 1
53#define MPM_UNIT_AREA 20
54#define MPM_UNIT_EDGE 50
55#define MPM_UNIT_REFS 100
171static inline int Mpm_ObjCutBest(
Mpm_Man_t *
p,
Mig_Obj_t * pObj ) {
return Vec_IntEntry(&
p->vCutBests, Mig_ObjId(pObj)); }
172static inline void Mpm_ObjSetCutBest(
Mpm_Man_t *
p,
Mig_Obj_t * pObj,
int i ) { Vec_IntWriteEntry(&
p->vCutBests, Mig_ObjId(pObj), i); }
174static inline int Mpm_CutWordNum(
int nLeaves ) {
return ((
sizeof(
Mpm_Cut_t) + (nLeaves << 2)) >> 3); }
178static inline int Mpm_ObjCutList(
Mpm_Man_t *
p,
Mig_Obj_t * pObj ) {
return Vec_IntEntry(&
p->vCutLists, Mig_ObjId(pObj)); }
179static inline int * Mpm_ObjCutListP(
Mpm_Man_t *
p,
Mig_Obj_t * pObj ) {
return Vec_IntEntryP(&
p->vCutLists, Mig_ObjId(pObj)); }
180static inline void Mpm_ObjSetCutList(
Mpm_Man_t *
p,
Mig_Obj_t * pObj,
int i ) { Vec_IntWriteEntry(&
p->vCutLists, Mig_ObjId(pObj), i); }
182static inline int Mpm_CutLeafNum(
Mpm_Cut_t * pCut ) {
return pCut->
nLeaves; }
183static inline word * Mpm_CutTruth(
Mpm_Man_t *
p,
int iFunc ) {
return Vec_MemReadEntry(
p->vTtMem, iFunc); }
185static inline int Mig_ObjMigRefNum(
Mpm_Man_t *
p,
Mig_Obj_t * pObj ) {
return Vec_IntEntry(&
p->vMigRefs, Mig_ObjId(pObj)); }
186static inline int Mig_ObjMigRefDec(
Mpm_Man_t *
p,
Mig_Obj_t * pObj ) {
return Vec_IntAddToEntry(&
p->vMigRefs, Mig_ObjId(pObj), -1); }
188static inline void Mpm_ManCleanMapRefs(
Mpm_Man_t *
p ) { Vec_IntFill( &
p->vMapRefs, Mig_ManObjNum(
p->pMig), 0 ); }
189static inline int Mpm_ObjMapRef(
Mpm_Man_t *
p,
Mig_Obj_t * pObj ) {
return Vec_IntEntry(&
p->vMapRefs, Mig_ObjId(pObj)); }
190static inline void Mpm_ObjSetMapRef(
Mpm_Man_t *
p,
Mig_Obj_t * pObj,
int i ) { Vec_IntWriteEntry(&
p->vMapRefs, Mig_ObjId(pObj), i); }
192static inline int Mpm_ObjEstRef(
Mpm_Man_t *
p,
Mig_Obj_t * pObj ) {
return Vec_IntEntry(&
p->vEstRefs, Mig_ObjId(pObj)); }
193static inline void Mpm_ObjSetEstRef(
Mpm_Man_t *
p,
Mig_Obj_t * pObj,
int i ) { Vec_IntWriteEntry(&
p->vEstRefs, Mig_ObjId(pObj), i); }
195static inline void Mpm_ManCleanRequired(
Mpm_Man_t *
p ) { Vec_IntFill(&
p->vRequireds,Mig_ManObjNum(
p->pMig),
ABC_INFINITY);}
196static inline int Mpm_ObjRequired(
Mpm_Man_t *
p,
Mig_Obj_t * pObj ) {
return Vec_IntEntry(&
p->vRequireds, Mig_ObjId(pObj)); }
197static inline void Mpm_ObjSetRequired(
Mpm_Man_t *
p,
Mig_Obj_t * pObj,
int i ) { Vec_IntWriteEntry(&
p->vRequireds, Mig_ObjId(pObj), i); }
199static inline int Mpm_ObjTime(
Mpm_Man_t *
p,
Mig_Obj_t * pObj ) {
return Vec_IntEntry(&
p->vTimes, Mig_ObjId(pObj)); }
200static inline void Mpm_ObjSetTime(
Mpm_Man_t *
p,
Mig_Obj_t * pObj,
int i ) { Vec_IntWriteEntry(&
p->vTimes, Mig_ObjId(pObj), i); }
202static inline int Mpm_ObjArea(
Mpm_Man_t *
p,
Mig_Obj_t * pObj ) {
return Vec_IntEntry(&
p->vAreas, Mig_ObjId(pObj)); }
203static inline void Mpm_ObjSetArea(
Mpm_Man_t *
p,
Mig_Obj_t * pObj,
int i ) { Vec_IntWriteEntry(&
p->vAreas, Mig_ObjId(pObj), i); }
205static inline int Mpm_ObjEdge(
Mpm_Man_t *
p,
Mig_Obj_t * pObj ) {
return Vec_IntEntry(&
p->vEdges, Mig_ObjId(pObj)); }
206static inline void Mpm_ObjSetEdge(
Mpm_Man_t *
p,
Mig_Obj_t * pObj,
int i ) { Vec_IntWriteEntry(&
p->vEdges, Mig_ObjId(pObj), i); }
208static inline void Mpm_VarsClear(
int * V2P,
int * P2V,
int nVars ) {
int i;
for ( i = 0; i < nVars; i++ ) V2P[i] = P2V[i] = i; }
209static inline void Mpm_VarsSwap(
int * V2P,
int * P2V,
int iVar,
int jVar ) { V2P[P2V[iVar]] = jVar; V2P[P2V[jVar]] = iVar; P2V[iVar] ^= P2V[jVar]; P2V[jVar] ^= P2V[iVar]; P2V[iVar] ^= P2V[jVar]; }
212#define Mpm_ObjForEachCut( p, pObj, hCut, pCut ) \
213 for ( hCut = Mpm_ObjCutList(p, pObj); hCut && (pCut = Mpm_CutFetch(p, hCut)); hCut = pCut->hNext )
214#define Mpm_ObjForEachCutSafe( p, pObj, hCut, pCut, hNext ) \
215 for ( hCut = Mpm_ObjCutList(p, pObj); hCut && (pCut = Mpm_CutFetch(p, hCut)) && ((hNext = pCut->hNext), 1); hCut = hNext )
218#define Mpm_CutForEachLeafId( pCut, iLeafId, i ) \
219 for ( i = 0; i < (int)pCut->nLeaves && ((iLeafId = Abc_Lit2Var(pCut->pLeaves[i])), 1); i++ )
220#define Mpm_CutForEachLeafLit( pCut, iLeafLit, i ) \
221 for ( i = 0; i < (int)pCut->nLeaves && ((iLeafLit = pCut->pLeaves[i]), 1); i++ )
222#define Mpm_CutForEachLeaf( p, pCut, pLeaf, i ) \
223 for ( i = 0; i < (int)pCut->nLeaves && (pLeaf = Mig_ManObj(p, Abc_Lit2Var(pCut->pLeaves[i]))); i++ )
#define ABC_INFINITY
MACRO DEFINITIONS ///.
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
unsigned __int64 word
DECLARATIONS ///.
struct Mmr_Step_t_ Mmr_Step_t
struct Mpm_Uni_t_ Mpm_Uni_t
void Mpm_ManPrintStatsInit(Mpm_Man_t *p)
int Mpm_CutComputeTruth(Mpm_Man_t *p, Mpm_Cut_t *pCut, Mpm_Cut_t *pCut0, Mpm_Cut_t *pCut1, Mpm_Cut_t *pCutC, int fCompl0, int fCompl1, int fComplC, int Type)
struct Mpm_Man_t_ Mpm_Man_t
#define MPM_CUT_MAX
INCLUDES ///.
struct Mpm_Dsd_t_ Mpm_Dsd_t
Mpm_Man_t * Mpm_ManStart(Mig_Man_t *pMig, Mpm_Par_t *pPars)
DECLARATIONS ///.
void Mpm_ManPrintStats(Mpm_Man_t *p)
void Kit_DsdPrintFromTruth(unsigned *pTruth, int nVars)
void Mpm_CutPrint(Mpm_Cut_t *pCut)
int Mpm_CutCheckDsd6(Mpm_Man_t *p, word t)
void Mpm_ManPrintPerm(unsigned s)
void Mpm_LibLutFree(Mpm_LibLut_t *pLib)
struct Mpm_Cut_t_ Mpm_Cut_t
BASIC TYPES ///.
word Mpm_CutTruthFromDsd(Mpm_Man_t *pMan, Mpm_Cut_t *pCut, int iDsdLit)
Vec_Wec_t * Mpm_ManFindDsdMatches(Mpm_Man_t *p, void *pScl)
DECLARATIONS ///.
void Mpm_ManPerform(Mpm_Man_t *p)
int Mpm_CutComputeDsd6(Mpm_Man_t *p, Mpm_Cut_t *pCut, Mpm_Cut_t *pCut0, Mpm_Cut_t *pCut1, Mpm_Cut_t *pCutC, int fCompl0, int fCompl1, int fComplC, int Type)
void Mpm_ManPrepare(Mpm_Man_t *p)
void Mpm_ManPrecomputePerms(Mpm_Man_t *p)
Mpm_LibLut_t * Mpm_LibLutSetSimple(int nLutSize)
DECLARATIONS ///.
void Mpm_ManStop(Mpm_Man_t *p)
void Mpm_ManPrintDsdStats(Mpm_Man_t *p)
void * Mpm_ManFromIfLogic(Mpm_Man_t *pMan)
Mig_Man_t * Mig_ManCreate(void *pGia)
FUNCTION DECLARATIONS ///.
struct Mig_Obj_t_ Mig_Obj_t
struct Mig_Man_t_ Mig_Man_t
#define MPM_VAR_MAX
INCLUDES ///.
struct Mpm_Par_t_ Mpm_Par_t
struct Mpm_LibLut_t_ Mpm_LibLut_t
BASIC TYPES ///.
word Truth1[(1<<((MPM_VAR_MAX) -6))]
word Truth0[(1<<((MPM_VAR_MAX) -6))]
word TruthC[(1<<((MPM_VAR_MAX) -6))]
Mpm_Uni_t pCutUnits[MPM_CUT_MAX+1]
Mpm_Uni_t * pCutStore[MPM_CUT_MAX+1]
word Truth[(1<<((MPM_VAR_MAX) -6))]
int(* pCutCmp)(Mpm_Uni_t *, Mpm_Uni_t *)
Mpm_Cut_t * pCuts[3][MPM_CUT_MAX+1]
word pSigns[3][MPM_CUT_MAX+1]
typedefABC_NAMESPACE_IMPL_START struct Vec_Mem_t_ Vec_Mem_t
DECLARATIONS ///.
struct Hsh_IntMan_t_ Hsh_IntMan_t
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Wrd_t_ Vec_Wrd_t
INCLUDES ///.