Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
5fd6dc0f
Commit
5fd6dc0f
authored
Nov 06, 2017
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Profiling quantification and other changes.
parent
71696919
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
89 additions
and
68 deletions
+89
-68
src/aig/gia/gia.h
+5
-0
src/aig/gia/giaMan.c
+1
-0
src/proof/cec/cecSat.c
+36
-31
src/proof/cec/cecSatG.c
+7
-7
src/sat/glucose/AbcGlucose.cpp
+40
-30
No files found.
src/aig/gia/gia.h
View file @
5fd6dc0f
...
@@ -148,6 +148,7 @@ struct Gia_Man_t_
...
@@ -148,6 +148,7 @@ struct Gia_Man_t_
Abc_Cex_t
*
pCexSeq
;
// sequential counter-example
Abc_Cex_t
*
pCexSeq
;
// sequential counter-example
Vec_Ptr_t
*
vSeqModelVec
;
// sequential counter-examples
Vec_Ptr_t
*
vSeqModelVec
;
// sequential counter-examples
Vec_Int_t
vCopies
;
// intermediate copies
Vec_Int_t
vCopies
;
// intermediate copies
Vec_Int_t
vCopies2
;
// intermediate copies
Vec_Int_t
*
vTruths
;
// used for truth table computation
Vec_Int_t
*
vTruths
;
// used for truth table computation
Vec_Int_t
*
vFlopClasses
;
// classes of flops for retiming/merging/etc
Vec_Int_t
*
vFlopClasses
;
// classes of flops for retiming/merging/etc
Vec_Int_t
*
vGateClasses
;
// classes of gates for abstraction
Vec_Int_t
*
vGateClasses
;
// classes of gates for abstraction
...
@@ -532,6 +533,10 @@ static inline int Gia_ObjCopyArray( Gia_Man_t * p, int iObj )
...
@@ -532,6 +533,10 @@ static inline int Gia_ObjCopyArray( Gia_Man_t * p, int iObj )
static
inline
void
Gia_ObjSetCopyArray
(
Gia_Man_t
*
p
,
int
iObj
,
int
iLit
)
{
Vec_IntWriteEntry
(
&
p
->
vCopies
,
iObj
,
iLit
);
}
static
inline
void
Gia_ObjSetCopyArray
(
Gia_Man_t
*
p
,
int
iObj
,
int
iLit
)
{
Vec_IntWriteEntry
(
&
p
->
vCopies
,
iObj
,
iLit
);
}
static
inline
void
Gia_ManCleanCopyArray
(
Gia_Man_t
*
p
)
{
Vec_IntFill
(
&
p
->
vCopies
,
Gia_ManObjNum
(
p
),
-
1
);
}
static
inline
void
Gia_ManCleanCopyArray
(
Gia_Man_t
*
p
)
{
Vec_IntFill
(
&
p
->
vCopies
,
Gia_ManObjNum
(
p
),
-
1
);
}
static
inline
int
Gia_ObjCopy2Array
(
Gia_Man_t
*
p
,
int
iObj
)
{
return
Vec_IntEntry
(
&
p
->
vCopies2
,
iObj
);
}
static
inline
void
Gia_ObjSetCopy2Array
(
Gia_Man_t
*
p
,
int
iObj
,
int
iLit
)
{
Vec_IntWriteEntry
(
&
p
->
vCopies2
,
iObj
,
iLit
);
}
static
inline
void
Gia_ManCleanCopy2Array
(
Gia_Man_t
*
p
)
{
Vec_IntFill
(
&
p
->
vCopies2
,
Gia_ManObjNum
(
p
),
-
1
);
}
static
inline
int
Gia_ObjFanin0CopyF
(
Gia_Man_t
*
p
,
int
f
,
Gia_Obj_t
*
pObj
)
{
return
Abc_LitNotCond
(
Gia_ObjCopyF
(
p
,
f
,
Gia_ObjFanin0
(
pObj
)),
Gia_ObjFaninC0
(
pObj
));
}
static
inline
int
Gia_ObjFanin0CopyF
(
Gia_Man_t
*
p
,
int
f
,
Gia_Obj_t
*
pObj
)
{
return
Abc_LitNotCond
(
Gia_ObjCopyF
(
p
,
f
,
Gia_ObjFanin0
(
pObj
)),
Gia_ObjFaninC0
(
pObj
));
}
static
inline
int
Gia_ObjFanin1CopyF
(
Gia_Man_t
*
p
,
int
f
,
Gia_Obj_t
*
pObj
)
{
return
Abc_LitNotCond
(
Gia_ObjCopyF
(
p
,
f
,
Gia_ObjFanin1
(
pObj
)),
Gia_ObjFaninC1
(
pObj
));
}
static
inline
int
Gia_ObjFanin1CopyF
(
Gia_Man_t
*
p
,
int
f
,
Gia_Obj_t
*
pObj
)
{
return
Abc_LitNotCond
(
Gia_ObjCopyF
(
p
,
f
,
Gia_ObjFanin1
(
pObj
)),
Gia_ObjFaninC1
(
pObj
));
}
static
inline
int
Gia_ObjFanin0CopyArray
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Abc_LitNotCond
(
Gia_ObjCopyArray
(
p
,
Gia_ObjFaninId0p
(
p
,
pObj
)),
Gia_ObjFaninC0
(
pObj
));
}
static
inline
int
Gia_ObjFanin0CopyArray
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Abc_LitNotCond
(
Gia_ObjCopyArray
(
p
,
Gia_ObjFaninId0p
(
p
,
pObj
)),
Gia_ObjFaninC0
(
pObj
));
}
...
...
src/aig/gia/giaMan.c
View file @
5fd6dc0f
...
@@ -117,6 +117,7 @@ void Gia_ManStop( Gia_Man_t * p )
...
@@ -117,6 +117,7 @@ void Gia_ManStop( Gia_Man_t * p )
Vec_IntFreeP
(
&
p
->
vLevels
);
Vec_IntFreeP
(
&
p
->
vLevels
);
Vec_IntFreeP
(
&
p
->
vTruths
);
Vec_IntFreeP
(
&
p
->
vTruths
);
Vec_IntErase
(
&
p
->
vCopies
);
Vec_IntErase
(
&
p
->
vCopies
);
Vec_IntErase
(
&
p
->
vCopies2
);
Vec_IntFreeP
(
&
p
->
vTtNums
);
Vec_IntFreeP
(
&
p
->
vTtNums
);
Vec_IntFreeP
(
&
p
->
vTtNodes
);
Vec_IntFreeP
(
&
p
->
vTtNodes
);
Vec_WrdFreeP
(
&
p
->
vTtMemory
);
Vec_WrdFreeP
(
&
p
->
vTtMemory
);
...
...
src/proof/cec/cecSat.c
View file @
5fd6dc0f
...
@@ -73,9 +73,9 @@ struct Cec2_Man_t_
...
@@ -73,9 +73,9 @@ struct Cec2_Man_t_
abctime
timeStart
;
abctime
timeStart
;
};
};
static
inline
int
Cec2_ObjSatId
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Gia_ObjCopyArray
(
p
,
Gia_ObjId
(
p
,
pObj
));
}
static
inline
int
Cec2_ObjSatId
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Gia_ObjCopy
2
Array
(
p
,
Gia_ObjId
(
p
,
pObj
));
}
static
inline
int
Cec2_ObjSetSatId
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
int
Num
)
{
assert
(
Cec2_ObjSatId
(
p
,
pObj
)
==
-
1
);
Gia_ObjSetCopyArray
(
p
,
Gia_ObjId
(
p
,
pObj
),
Num
);
return
Num
;
}
static
inline
int
Cec2_ObjSetSatId
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
int
Num
)
{
assert
(
Cec2_ObjSatId
(
p
,
pObj
)
==
-
1
);
Gia_ObjSetCopy
2
Array
(
p
,
Gia_ObjId
(
p
,
pObj
),
Num
);
return
Num
;
}
static
inline
void
Cec2_ObjCleanSatId
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
assert
(
Cec2_ObjSatId
(
p
,
pObj
)
!=
-
1
);
Gia_ObjSetCopyArray
(
p
,
Gia_ObjId
(
p
,
pObj
),
-
1
);
}
static
inline
void
Cec2_ObjCleanSatId
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
assert
(
Cec2_ObjSatId
(
p
,
pObj
)
!=
-
1
);
Gia_ObjSetCopy
2
Array
(
p
,
Gia_ObjId
(
p
,
pObj
),
-
1
);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
/// FUNCTION DEFINITIONS ///
...
@@ -310,49 +310,54 @@ void Cec2_ObjAddToFrontier( Gia_Man_t * p, Gia_Obj_t * pObj, Vec_Ptr_t * vFronti
...
@@ -310,49 +310,54 @@ void Cec2_ObjAddToFrontier( Gia_Man_t * p, Gia_Obj_t * pObj, Vec_Ptr_t * vFronti
if
(
Gia_ObjIsAnd
(
pObj
)
)
if
(
Gia_ObjIsAnd
(
pObj
)
)
Vec_PtrPush
(
vFrontier
,
pObj
);
Vec_PtrPush
(
vFrontier
,
pObj
);
}
}
int
Cec2_ObjGetCnfVar
(
Cec2_Man_t
*
p
,
int
iObj
)
int
Gia_ObjGetCnfVar
(
Gia_Man_t
*
pGia
,
int
iObj
,
Vec_Ptr_t
*
vFrontier
,
Vec_Ptr_t
*
vFanins
,
satoko_t
*
pSat
)
{
{
Gia_Obj_t
*
pNode
,
*
pFanin
;
Gia_Obj_t
*
pNode
,
*
pFanin
;
Gia_Obj_t
*
pObj
=
Gia_ManObj
(
p
->
pNew
,
iObj
);
Gia_Obj_t
*
pObj
=
Gia_ManObj
(
p
Gia
,
iObj
);
int
i
,
k
,
fUseMuxes
=
1
;
int
i
,
k
,
fUseMuxes
=
1
;
if
(
Vec_IntSize
(
&
pGia
->
vCopies2
)
<
Gia_ManObjNum
(
pGia
)
)
Vec_IntFillExtra
(
&
pGia
->
vCopies2
,
Gia_ManObjNum
(
pGia
),
-
1
);
// quit if CNF is ready
// quit if CNF is ready
if
(
Cec2_ObjSatId
(
p
->
pNew
,
pObj
)
>=
0
)
if
(
Cec2_ObjSatId
(
p
Gia
,
pObj
)
>=
0
)
return
Cec2_ObjSatId
(
p
->
pNew
,
pObj
);
return
Cec2_ObjSatId
(
p
Gia
,
pObj
);
assert
(
iObj
>
0
);
assert
(
iObj
>
0
);
if
(
Gia_ObjIsCi
(
pObj
)
)
if
(
Gia_ObjIsCi
(
pObj
)
)
return
Cec2_ObjSetSatId
(
p
->
pNew
,
pObj
,
satoko_add_variable
(
p
->
pSat
,
0
)
);
return
Cec2_ObjSetSatId
(
p
Gia
,
pObj
,
satoko_add_variable
(
pSat
,
0
)
);
assert
(
Gia_ObjIsAnd
(
pObj
)
);
assert
(
Gia_ObjIsAnd
(
pObj
)
);
// start the frontier
// start the frontier
Vec_PtrClear
(
p
->
vFrontier
);
Vec_PtrClear
(
vFrontier
);
Cec2_ObjAddToFrontier
(
p
->
pNew
,
pObj
,
p
->
vFrontier
,
p
->
pSat
);
Cec2_ObjAddToFrontier
(
p
Gia
,
pObj
,
vFrontier
,
pSat
);
// explore nodes in the frontier
// explore nodes in the frontier
Vec_PtrForEachEntry
(
Gia_Obj_t
*
,
p
->
vFrontier
,
pNode
,
i
)
Vec_PtrForEachEntry
(
Gia_Obj_t
*
,
vFrontier
,
pNode
,
i
)
{
{
// create the supergate
// create the supergate
assert
(
Cec2_ObjSatId
(
p
->
pNew
,
pNode
)
>=
0
);
assert
(
Cec2_ObjSatId
(
p
Gia
,
pNode
)
>=
0
);
if
(
fUseMuxes
&&
pNode
->
fMark0
)
if
(
fUseMuxes
&&
pNode
->
fMark0
)
{
{
Vec_PtrClear
(
p
->
vFanins
);
Vec_PtrClear
(
vFanins
);
Vec_PtrPushUnique
(
p
->
vFanins
,
Gia_ObjFanin0
(
Gia_ObjFanin0
(
pNode
)
)
);
Vec_PtrPushUnique
(
vFanins
,
Gia_ObjFanin0
(
Gia_ObjFanin0
(
pNode
)
)
);
Vec_PtrPushUnique
(
p
->
vFanins
,
Gia_ObjFanin0
(
Gia_ObjFanin1
(
pNode
)
)
);
Vec_PtrPushUnique
(
vFanins
,
Gia_ObjFanin0
(
Gia_ObjFanin1
(
pNode
)
)
);
Vec_PtrPushUnique
(
p
->
vFanins
,
Gia_ObjFanin1
(
Gia_ObjFanin0
(
pNode
)
)
);
Vec_PtrPushUnique
(
vFanins
,
Gia_ObjFanin1
(
Gia_ObjFanin0
(
pNode
)
)
);
Vec_PtrPushUnique
(
p
->
vFanins
,
Gia_ObjFanin1
(
Gia_ObjFanin1
(
pNode
)
)
);
Vec_PtrPushUnique
(
vFanins
,
Gia_ObjFanin1
(
Gia_ObjFanin1
(
pNode
)
)
);
Vec_PtrForEachEntry
(
Gia_Obj_t
*
,
p
->
vFanins
,
pFanin
,
k
)
Vec_PtrForEachEntry
(
Gia_Obj_t
*
,
vFanins
,
pFanin
,
k
)
Cec2_ObjAddToFrontier
(
p
->
pNew
,
Gia_Regular
(
pFanin
),
p
->
vFrontier
,
p
->
pSat
);
Cec2_ObjAddToFrontier
(
p
Gia
,
Gia_Regular
(
pFanin
),
vFrontier
,
pSat
);
Cec2_AddClausesMux
(
p
->
pNew
,
pNode
,
p
->
pSat
);
Cec2_AddClausesMux
(
p
Gia
,
pNode
,
pSat
);
}
}
else
else
{
{
Cec2_CollectSuper
(
pNode
,
fUseMuxes
,
p
->
vFanins
);
Cec2_CollectSuper
(
pNode
,
fUseMuxes
,
vFanins
);
Vec_PtrForEachEntry
(
Gia_Obj_t
*
,
p
->
vFanins
,
pFanin
,
k
)
Vec_PtrForEachEntry
(
Gia_Obj_t
*
,
vFanins
,
pFanin
,
k
)
Cec2_ObjAddToFrontier
(
p
->
pNew
,
Gia_Regular
(
pFanin
),
p
->
vFrontier
,
p
->
pSat
);
Cec2_ObjAddToFrontier
(
p
Gia
,
Gia_Regular
(
pFanin
),
vFrontier
,
pSat
);
Cec2_AddClausesSuper
(
p
->
pNew
,
pNode
,
p
->
vFanins
,
p
->
pSat
);
Cec2_AddClausesSuper
(
p
Gia
,
pNode
,
vFanins
,
pSat
);
}
}
assert
(
Vec_PtrSize
(
p
->
vFanins
)
>
1
);
assert
(
Vec_PtrSize
(
vFanins
)
>
1
);
}
}
return
Cec2_ObjSatId
(
p
->
pNew
,
pObj
);
return
Cec2_ObjSatId
(
pGia
,
pObj
);
}
int
Cec2_ObjGetCnfVar
(
Cec2_Man_t
*
p
,
int
iObj
)
{
return
Gia_ObjGetCnfVar
(
p
->
pNew
,
iObj
,
p
->
vFrontier
,
p
->
vFanins
,
p
->
pSat
);
}
}
/**Function*************************************************************
/**Function*************************************************************
...
@@ -673,7 +678,7 @@ Cec2_Man_t * Cec2_ManCreate( Gia_Man_t * pAig, Cec2_Par_t * pPars )
...
@@ -673,7 +678,7 @@ Cec2_Man_t * Cec2_ManCreate( Gia_Man_t * pAig, Cec2_Par_t * pPars )
Gia_ManForEachCi
(
pAig
,
pObj
,
i
)
Gia_ManForEachCi
(
pAig
,
pObj
,
i
)
pObj
->
Value
=
Gia_ManAppendCi
(
p
->
pNew
);
pObj
->
Value
=
Gia_ManAppendCi
(
p
->
pNew
);
Gia_ManHashAlloc
(
p
->
pNew
);
Gia_ManHashAlloc
(
p
->
pNew
);
Vec_IntFill
(
&
p
->
pNew
->
vCopies
,
Gia_ManObjNum
(
p
->
pNew
),
-
1
);
Vec_IntFill
(
&
p
->
pNew
->
vCopies
2
,
Gia_ManObjNum
(
p
->
pNew
),
-
1
);
// SAT solving
// SAT solving
memset
(
&
Pars
,
0
,
sizeof
(
satoko_opts_t
)
);
memset
(
&
Pars
,
0
,
sizeof
(
satoko_opts_t
)
);
p
->
pSat
=
satoko_create
();
p
->
pSat
=
satoko_create
();
...
@@ -952,14 +957,14 @@ int Cec2_ManPerformSweeping( Gia_Man_t * p, Cec2_Par_t * pPars, Gia_Man_t ** ppN
...
@@ -952,14 +957,14 @@ int Cec2_ManPerformSweeping( Gia_Man_t * p, Cec2_Par_t * pPars, Gia_Man_t ** ppN
assert
(
!
Gia_ObjProved
(
p
,
i
)
&&
!
Gia_ObjFailed
(
p
,
i
)
);
assert
(
!
Gia_ObjProved
(
p
,
i
)
&&
!
Gia_ObjFailed
(
p
,
i
)
);
// duplicate the node
// duplicate the node
pObj
->
Value
=
Gia_ManHashAnd
(
pMan
->
pNew
,
Gia_ObjFanin0Copy
(
pObj
),
Gia_ObjFanin1Copy
(
pObj
)
);
pObj
->
Value
=
Gia_ManHashAnd
(
pMan
->
pNew
,
Gia_ObjFanin0Copy
(
pObj
),
Gia_ObjFanin1Copy
(
pObj
)
);
if
(
Vec_IntSize
(
&
pMan
->
pNew
->
vCopies
)
==
Abc_Lit2Var
(
pObj
->
Value
)
)
if
(
Vec_IntSize
(
&
pMan
->
pNew
->
vCopies
2
)
==
Abc_Lit2Var
(
pObj
->
Value
)
)
{
{
pObjNew
=
Gia_ManObj
(
pMan
->
pNew
,
Abc_Lit2Var
(
pObj
->
Value
)
);
pObjNew
=
Gia_ManObj
(
pMan
->
pNew
,
Abc_Lit2Var
(
pObj
->
Value
)
);
pObjNew
->
fMark0
=
Gia_ObjIsMuxType
(
pObjNew
);
pObjNew
->
fMark0
=
Gia_ObjIsMuxType
(
pObjNew
);
Gia_ObjSetPhase
(
pMan
->
pNew
,
pObjNew
);
Gia_ObjSetPhase
(
pMan
->
pNew
,
pObjNew
);
Vec_IntPush
(
&
pMan
->
pNew
->
vCopies
,
-
1
);
Vec_IntPush
(
&
pMan
->
pNew
->
vCopies
2
,
-
1
);
}
}
assert
(
Vec_IntSize
(
&
pMan
->
pNew
->
vCopies
)
==
Gia_ManObjNum
(
pMan
->
pNew
)
);
assert
(
Vec_IntSize
(
&
pMan
->
pNew
->
vCopies
2
)
==
Gia_ManObjNum
(
pMan
->
pNew
)
);
pRepr
=
Gia_ObjReprObj
(
p
,
i
);
pRepr
=
Gia_ObjReprObj
(
p
,
i
);
if
(
pRepr
==
NULL
||
!~
pRepr
->
Value
)
if
(
pRepr
==
NULL
||
!~
pRepr
->
Value
)
continue
;
continue
;
...
...
src/proof/cec/cecSatG.c
View file @
5fd6dc0f
...
@@ -73,9 +73,9 @@ struct Cec3_Man_t_
...
@@ -73,9 +73,9 @@ struct Cec3_Man_t_
abctime
timeStart
;
abctime
timeStart
;
};
};
static
inline
int
Cec3_ObjSatId
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Gia_ObjCopyArray
(
p
,
Gia_ObjId
(
p
,
pObj
));
}
static
inline
int
Cec3_ObjSatId
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Gia_ObjCopy
2
Array
(
p
,
Gia_ObjId
(
p
,
pObj
));
}
static
inline
int
Cec3_ObjSetSatId
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
int
Num
)
{
assert
(
Cec3_ObjSatId
(
p
,
pObj
)
==
-
1
);
Gia_ObjSetCopyArray
(
p
,
Gia_ObjId
(
p
,
pObj
),
Num
);
return
Num
;
}
static
inline
int
Cec3_ObjSetSatId
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
int
Num
)
{
assert
(
Cec3_ObjSatId
(
p
,
pObj
)
==
-
1
);
Gia_ObjSetCopy
2
Array
(
p
,
Gia_ObjId
(
p
,
pObj
),
Num
);
return
Num
;
}
static
inline
void
Cec3_ObjCleanSatId
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
assert
(
Cec3_ObjSatId
(
p
,
pObj
)
!=
-
1
);
Gia_ObjSetCopyArray
(
p
,
Gia_ObjId
(
p
,
pObj
),
-
1
);
}
static
inline
void
Cec3_ObjCleanSatId
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
assert
(
Cec3_ObjSatId
(
p
,
pObj
)
!=
-
1
);
Gia_ObjSetCopy
2
Array
(
p
,
Gia_ObjId
(
p
,
pObj
),
-
1
);
}
static
inline
void
satoko_mark_cone
(
bmcg_sat_solver
*
p
,
int
*
pVars
,
int
nVars
)
{}
static
inline
void
satoko_mark_cone
(
bmcg_sat_solver
*
p
,
int
*
pVars
,
int
nVars
)
{}
static
inline
void
satoko_unmark_cone
(
bmcg_sat_solver
*
p
,
int
*
pVars
,
int
nVars
)
{}
static
inline
void
satoko_unmark_cone
(
bmcg_sat_solver
*
p
,
int
*
pVars
,
int
nVars
)
{}
...
@@ -676,7 +676,7 @@ Cec3_Man_t * Cec3_ManCreate( Gia_Man_t * pAig, Cec3_Par_t * pPars )
...
@@ -676,7 +676,7 @@ Cec3_Man_t * Cec3_ManCreate( Gia_Man_t * pAig, Cec3_Par_t * pPars )
Gia_ManForEachCi
(
pAig
,
pObj
,
i
)
Gia_ManForEachCi
(
pAig
,
pObj
,
i
)
pObj
->
Value
=
Gia_ManAppendCi
(
p
->
pNew
);
pObj
->
Value
=
Gia_ManAppendCi
(
p
->
pNew
);
Gia_ManHashAlloc
(
p
->
pNew
);
Gia_ManHashAlloc
(
p
->
pNew
);
Vec_IntFill
(
&
p
->
pNew
->
vCopies
,
Gia_ManObjNum
(
p
->
pNew
),
-
1
);
Vec_IntFill
(
&
p
->
pNew
->
vCopies
2
,
Gia_ManObjNum
(
p
->
pNew
),
-
1
);
// SAT solving
// SAT solving
//memset( &Pars, 0, sizeof(satoko_opts_t) );
//memset( &Pars, 0, sizeof(satoko_opts_t) );
p
->
pSat
=
bmcg_sat_solver_start
();
p
->
pSat
=
bmcg_sat_solver_start
();
...
@@ -965,14 +965,14 @@ int Cec3_ManPerformSweeping( Gia_Man_t * p, Cec3_Par_t * pPars, Gia_Man_t ** ppN
...
@@ -965,14 +965,14 @@ int Cec3_ManPerformSweeping( Gia_Man_t * p, Cec3_Par_t * pPars, Gia_Man_t ** ppN
assert
(
!
Gia_ObjProved
(
p
,
i
)
&&
!
Gia_ObjFailed
(
p
,
i
)
);
assert
(
!
Gia_ObjProved
(
p
,
i
)
&&
!
Gia_ObjFailed
(
p
,
i
)
);
// duplicate the node
// duplicate the node
pObj
->
Value
=
Gia_ManHashAnd
(
pMan
->
pNew
,
Gia_ObjFanin0Copy
(
pObj
),
Gia_ObjFanin1Copy
(
pObj
)
);
pObj
->
Value
=
Gia_ManHashAnd
(
pMan
->
pNew
,
Gia_ObjFanin0Copy
(
pObj
),
Gia_ObjFanin1Copy
(
pObj
)
);
if
(
Vec_IntSize
(
&
pMan
->
pNew
->
vCopies
)
==
Abc_Lit2Var
(
pObj
->
Value
)
)
if
(
Vec_IntSize
(
&
pMan
->
pNew
->
vCopies
2
)
==
Abc_Lit2Var
(
pObj
->
Value
)
)
{
{
pObjNew
=
Gia_ManObj
(
pMan
->
pNew
,
Abc_Lit2Var
(
pObj
->
Value
)
);
pObjNew
=
Gia_ManObj
(
pMan
->
pNew
,
Abc_Lit2Var
(
pObj
->
Value
)
);
pObjNew
->
fMark0
=
Gia_ObjIsMuxType
(
pObjNew
);
pObjNew
->
fMark0
=
Gia_ObjIsMuxType
(
pObjNew
);
Gia_ObjSetPhase
(
pMan
->
pNew
,
pObjNew
);
Gia_ObjSetPhase
(
pMan
->
pNew
,
pObjNew
);
Vec_IntPush
(
&
pMan
->
pNew
->
vCopies
,
-
1
);
Vec_IntPush
(
&
pMan
->
pNew
->
vCopies
2
,
-
1
);
}
}
assert
(
Vec_IntSize
(
&
pMan
->
pNew
->
vCopies
)
==
Gia_ManObjNum
(
pMan
->
pNew
)
);
assert
(
Vec_IntSize
(
&
pMan
->
pNew
->
vCopies
2
)
==
Gia_ManObjNum
(
pMan
->
pNew
)
);
pRepr
=
Gia_ObjReprObj
(
p
,
i
);
pRepr
=
Gia_ObjReprObj
(
p
,
i
);
if
(
pRepr
==
NULL
||
!~
pRepr
->
Value
)
if
(
pRepr
==
NULL
||
!~
pRepr
->
Value
)
continue
;
continue
;
...
...
src/sat/glucose/AbcGlucose.cpp
View file @
5fd6dc0f
...
@@ -911,10 +911,11 @@ abctime clkQuaSynth = 0;
...
@@ -911,10 +911,11 @@ abctime clkQuaSynth = 0;
int
bmcg_sat_solver_quantify2
(
Gia_Man_t
*
p
,
int
iLit
,
int
fHash
,
int
(
*
pFuncCiToKeep
)(
void
*
,
int
),
void
*
pData
,
Vec_Int_t
*
vDLits
)
int
bmcg_sat_solver_quantify2
(
Gia_Man_t
*
p
,
int
iLit
,
int
fHash
,
int
(
*
pFuncCiToKeep
)(
void
*
,
int
),
void
*
pData
,
Vec_Int_t
*
vDLits
)
{
{
int
fSynthesize
=
0
;
abctime
clk
=
Abc_Clock
(),
clkAll
=
Abc_Clock
();
abctime
clk
=
Abc_Clock
(),
clkAll
=
Abc_Clock
();
extern
Gia_Man_t
*
Abc_SopSynthesizeOne
(
char
*
pSop
,
int
fClp
);
extern
Gia_Man_t
*
Abc_SopSynthesizeOne
(
char
*
pSop
,
int
fClp
);
Gia_Man_t
*
pMan
,
*
pNew
,
*
pTemp
;
Vec_Str_t
*
vSop
;
Gia_Man_t
*
pMan
,
*
pNew
,
*
pTemp
;
Vec_Str_t
*
vSop
;
int
i
,
CiId
,
ObjId
,
Res
,
nCubes
,
nNodes
,
Count
=
0
,
iNode
=
Abc_Lit2Var
(
iLit
);
int
i
,
CiId
,
ObjId
,
Res
,
nCubes
=
0
,
nNodes
,
Count
=
0
,
iNode
=
Abc_Lit2Var
(
iLit
);
Vec_Int_t
*
vCisUsed
=
Vec_IntAlloc
(
100
);
Vec_Int_t
*
vCisUsed
=
Vec_IntAlloc
(
100
);
Gia_ManCollectCis
(
p
,
&
iNode
,
1
,
vCisUsed
);
Gia_ManCollectCis
(
p
,
&
iNode
,
1
,
vCisUsed
);
Vec_IntSort
(
vCisUsed
,
0
);
Vec_IntSort
(
vCisUsed
,
0
);
...
@@ -927,6 +928,7 @@ int bmcg_sat_solver_quantify2( Gia_Man_t * p, int iLit, int fHash, int(*pFuncCiT
...
@@ -927,6 +928,7 @@ int bmcg_sat_solver_quantify2( Gia_Man_t * p, int iLit, int fHash, int(*pFuncCiT
// duplicate cone
// duplicate cone
pNew
=
Gia_ManDupConeSupp
(
p
,
iLit
,
vCisUsed
);
pNew
=
Gia_ManDupConeSupp
(
p
,
iLit
,
vCisUsed
);
assert
(
Gia_ManCiNum
(
pNew
)
==
Vec_IntSize
(
vCisUsed
)
);
assert
(
Gia_ManCiNum
(
pNew
)
==
Vec_IntSize
(
vCisUsed
)
);
nNodes
=
Gia_ManAndNum
(
pNew
);
// perform quantification one CI at a time
// perform quantification one CI at a time
assert
(
pFuncCiToKeep
);
assert
(
pFuncCiToKeep
);
...
@@ -947,40 +949,48 @@ int bmcg_sat_solver_quantify2( Gia_Man_t * p, int iLit, int fHash, int(*pFuncCiT
...
@@ -947,40 +949,48 @@ int bmcg_sat_solver_quantify2( Gia_Man_t * p, int iLit, int fHash, int(*pFuncCiT
return
RetValue
;
return
RetValue
;
}
}
clk
=
Abc_Clock
();
if
(
fSynthesize
)
vSop
=
bmcg_sat_solver_sop
(
pNew
,
0
);
nNodes
=
Gia_ManAndNum
(
pNew
);
Gia_ManStop
(
pNew
);
clkQuaSolve
+=
Abc_Clock
()
-
clk
;
clk
=
Abc_Clock
();
pMan
=
Abc_SopSynthesizeOne
(
Vec_StrArray
(
vSop
),
1
);
clkQuaSynth
+=
Abc_Clock
()
-
clk
;
nCubes
=
Vec_StrCountEntry
(
vSop
,
'\n'
);
if
(
vDLits
)
{
{
// convert into object IDs
clk
=
Abc_Clock
();
Vec_Int_t
*
vCisObjs
=
Vec_IntAlloc
(
Vec_IntSize
(
vCisUsed
)
);
vSop
=
bmcg_sat_solver_sop
(
pNew
,
0
);
Vec_IntForEachEntry
(
vCisUsed
,
CiId
,
i
)
Gia_ManStop
(
pNew
);
Vec_IntPush
(
vCisObjs
,
CiId
+
1
);
clkQuaSolve
+=
Abc_Clock
()
-
clk
;
bmcg_sat_generate_dvars
(
vCisObjs
,
vSop
,
vDLits
);
Vec_IntFree
(
vCisObjs
);
clk
=
Abc_Clock
();
pMan
=
Abc_SopSynthesizeOne
(
Vec_StrArray
(
vSop
),
1
);
nCubes
=
Vec_StrCountEntry
(
vSop
,
'\n'
);
clkQuaSynth
+=
Abc_Clock
()
-
clk
;
if
(
vDLits
)
{
// convert into object IDs
Vec_Int_t
*
vCisObjs
=
Vec_IntAlloc
(
Vec_IntSize
(
vCisUsed
)
);
Vec_IntForEachEntry
(
vCisUsed
,
CiId
,
i
)
Vec_IntPush
(
vCisObjs
,
CiId
+
1
);
bmcg_sat_generate_dvars
(
vCisObjs
,
vSop
,
vDLits
);
Vec_IntFree
(
vCisObjs
);
}
Vec_StrFree
(
vSop
);
if
(
Gia_ManPoIsConst
(
pMan
,
0
)
)
{
int
RetValue
=
Gia_ManPoIsConst1
(
pMan
,
0
);
Vec_IntFree
(
vCisUsed
);
Gia_ManStop
(
pMan
);
return
RetValue
;
}
}
}
Vec_StrFree
(
vSop
);
else
if
(
Gia_ManPoIsConst
(
pMan
,
0
)
)
{
{
int
RetValue
=
Gia_ManPoIsConst1
(
pMan
,
0
);
pMan
=
pNew
;
Vec_IntFree
(
vCisUsed
);
Gia_ManStop
(
pMan
);
return
RetValue
;
}
}
Res
=
Gia_ManDupConeBack
(
p
,
pMan
,
vCisUsed
);
Res
=
Gia_ManDupConeBack
(
p
,
pMan
,
vCisUsed
);
// report the result
// report the result
printf
(
"Performed quantification with %5d nodes, %3d keep-vars, %3d quant-vars, resulting in %5d cubes and %5d nodes. "
,
//
printf( "Performed quantification with %5d nodes, %3d keep-vars, %3d quant-vars, resulting in %5d cubes and %5d nodes. ",
nNodes
,
Vec_IntSize
(
vCisUsed
)
-
Count
,
Count
,
nCubes
,
Gia_ManAndNum
(
pMan
)
);
//
nNodes, Vec_IntSize(vCisUsed) - Count, Count, nCubes, Gia_ManAndNum(pMan) );
Abc_PrintTime
(
1
,
"Time"
,
Abc_Clock
()
-
clkAll
);
//
Abc_PrintTime( 1, "Time", Abc_Clock() - clkAll );
Vec_IntFree
(
vCisUsed
);
Vec_IntFree
(
vCisUsed
);
Gia_ManStop
(
pMan
);
Gia_ManStop
(
pMan
);
...
@@ -1162,9 +1172,9 @@ int bmcg_sat_solver_quantify3( bmcg_sat_solver * pSats[], Gia_Man_t * p, int iLi
...
@@ -1162,9 +1172,9 @@ int bmcg_sat_solver_quantify3( bmcg_sat_solver * pSats[], Gia_Man_t * p, int iLi
clkQuaSynth
+=
Abc_Clock
()
-
clk
;
clkQuaSynth
+=
Abc_Clock
()
-
clk
;
// report the result
// report the result
printf
(
"Performed quantification with %5d nodes, %3d keep-vars, %3d quant-vars, resulting in %5d cubes and %5d nodes. "
,
//
printf( "Performed quantification with %5d nodes, %3d keep-vars, %3d quant-vars, resulting in %5d cubes and %5d nodes. ",
Vec_IntSize
(
vObjsUsed
),
Count
,
Vec_IntSize
(
vCiVars
)
-
Count
,
Vec_StrCountEntry
(
vSop
,
'\n'
),
Gia_ManAndNum
(
p
)
-
RetValue
);
//
Vec_IntSize(vObjsUsed), Count, Vec_IntSize(vCiVars) - Count, Vec_StrCountEntry(vSop, '\n'), Gia_ManAndNum(p)-RetValue );
Abc_PrintTime
(
1
,
"Time"
,
Abc_Clock
()
-
clkAll
);
//
Abc_PrintTime( 1, "Time", Abc_Clock() - clkAll );
cleanup:
cleanup:
Vec_IntForEachEntry
(
vObjsUsed
,
iVar
,
i
)
Vec_IntForEachEntry
(
vObjsUsed
,
iVar
,
i
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment