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
e3e4a987
Commit
e3e4a987
authored
Jul 31, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Scalable gate-level abstraction.
parent
dc56a655
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
23 deletions
+21
-23
src/aig/gia/giaAbsGla2.c
+18
-21
src/aig/gia/giaAbsRef.c
+2
-1
src/sat/bsat/satProof2.h
+1
-1
No files found.
src/aig/gia/giaAbsGla2.c
View file @
e3e4a987
...
...
@@ -554,7 +554,7 @@ Vec_Int_t * Ga2_ManCnfCompute( unsigned uTruth, int nVars, Vec_Int_t * vCover )
SeeAlso []
***********************************************************************/
static
inline
void
Ga2_ManCnfAddDynamic
(
Ga2_Man_t
*
p
,
int
uTruth
,
int
Lits
[],
int
iLitOut
,
int
ProofId
)
static
inline
void
Ga2_ManCnfAddDynamic
(
Ga2_Man_t
*
p
,
int
uTruth
,
int
Lits
[],
int
iLitOut
)
{
int
i
,
k
,
b
,
Cube
,
nClaLits
,
ClaLits
[
6
];
assert
(
uTruth
>
0
&&
uTruth
<
0xffff
);
...
...
@@ -583,7 +583,7 @@ static inline void Ga2_ManCnfAddDynamic( Ga2_Man_t * p, int uTruth, int Lits[],
}
Cube
=
Cube
/
3
;
}
sat_solver2_addclause
(
p
->
pSat
,
ClaLits
,
ClaLits
+
nClaLits
,
ProofId
);
sat_solver2_addclause
(
p
->
pSat
,
ClaLits
,
ClaLits
+
nClaLits
,
-
1
);
}
}
}
...
...
@@ -702,19 +702,11 @@ void Ga2_ManAddAbsClauses( Ga2_Man_t * p, int f )
int
fSimple
=
1
;
Gia_Obj_t
*
pObj
;
int
i
,
Lit
;
/*
Vec_Int_t * vMap = (f < Vec_PtrSize(p->vId2Lit) ? Ga2_MapFrameMap( p, f ) : NULL);
// Ga2_ObjAddLit( p, Gia_ManConst0(p->pGia), f, 0 );
if ( f == 5 )
{
int s = 0;
}
*/
if
(
fSimple
)
{
Lit
=
Ga2_ObjFindOrAddLit
(
p
,
Gia_ManConst0
(
p
->
pGia
),
f
);
Lit
=
Abc_LitNot
(
Lit
);
sat_solver2_addclause
(
p
->
pSat
,
&
Lit
,
&
Lit
+
1
,
0
);
sat_solver2_addclause
(
p
->
pSat
,
&
Lit
,
&
Lit
+
1
,
-
1
);
}
Gia_ManForEachObjVec
(
p
->
vAbs
,
p
->
pGia
,
pObj
,
i
)
if
(
i
>=
p
->
LimAbs
)
...
...
@@ -822,11 +814,7 @@ Vec_Int_t * Ga2_ManAbsTranslate( Ga2_Man_t * p )
if
(
Gia_ObjIsAnd
(
pObj
)
)
Ga2_ManAbsTranslate_rec
(
p
->
pGia
,
pObj
,
vGateClasses
,
1
);
else
if
(
Gia_ObjIsRo
(
p
->
pGia
,
pObj
)
)
{
Vec_IntWriteEntry
(
vGateClasses
,
Gia_ObjId
(
p
->
pGia
,
pObj
),
1
);
pObj
=
Gia_ObjRoToRi
(
p
->
pGia
,
pObj
);
Vec_IntWriteEntry
(
vGateClasses
,
Gia_ObjFaninId0p
(
p
->
pGia
,
pObj
),
1
);
}
else
if
(
!
Gia_ObjIsConst0
(
pObj
)
)
assert
(
0
);
}
...
...
@@ -859,7 +847,7 @@ void Ga2_ManRestart( Ga2_Man_t * p )
if
(
p
->
pSat
)
sat_solver2_delete
(
p
->
pSat
);
p
->
pSat
=
sat_solver2_new
();
// add clause x0 = 0 (lit0 = 1; lit1 = 0)
sat_solver2_addclause
(
p
->
pSat
,
&
Lit
,
&
Lit
+
1
,
0
);
sat_solver2_addclause
(
p
->
pSat
,
&
Lit
,
&
Lit
+
1
,
-
1
);
// remove previous abstraction
Ga2_ManShrinkAbs
(
p
,
1
,
1
,
1
);
// start new abstraction
...
...
@@ -877,7 +865,7 @@ void Ga2_ManRestart( Ga2_Man_t * p )
/**Function*************************************************************
Synopsis [Unrolls one timeframe.]
Synopsis [Unrolls one timeframe.]
`
Description []
...
...
@@ -901,8 +889,8 @@ int Ga2_ManUnroll_rec( Ga2_Man_t * p, Gia_Obj_t * pObj, int f )
Lit
=
Ga2_ObjFindOrAddLit
(
p
,
pObj
,
f
);
Lit
=
Abc_LitNot
(
Lit
);
assert
(
Lit
>
1
);
sat_solver2_addclause
(
p
->
pSat
,
&
Lit
,
&
Lit
+
1
,
Gia_ObjId
(
p
->
pGia
,
pObj
)
);
return
Lit
;
sat_solver2_addclause
(
p
->
pSat
,
&
Lit
,
&
Lit
+
1
,
-
1
);
return
Abc_LitNot
(
Lit
)
;
}
return
0
;
}
...
...
@@ -956,7 +944,10 @@ int Ga2_ManUnroll_rec( Ga2_Man_t * p, Gia_Obj_t * pObj, int f )
// minimize truth table
uTruth
=
Ga2_ObjComputeTruthSpecial
(
p
->
pGia
,
pObj
,
Ga2_ObjLeaves
(
p
->
pGia
,
pObj
),
p
->
vLits
);
if
(
uTruth
==
0
||
uTruth
==
~
0
)
// const 0 / 1
{
Lit
=
(
uTruth
>
0
);
Ga2_ObjAddLit
(
p
,
pObj
,
f
,
Lit
);
}
else
if
(
uTruth
==
0xAAAAAAAA
||
uTruth
==
0x55555555
)
// buffer / inverter
{
Lit
=
Vec_IntEntry
(
p
->
vLits
,
0
);
...
...
@@ -966,6 +957,7 @@ int Ga2_ManUnroll_rec( Ga2_Man_t * p, Gia_Obj_t * pObj, int f )
Lit
=
Ga2_ObjFindOrAddLit
(
p
,
pLeaf
,
f
);
}
Lit
=
Abc_LitNotCond
(
Lit
,
uTruth
==
0x55555555
);
Ga2_ObjAddLit
(
p
,
pObj
,
f
,
Lit
);
}
else
{
...
...
@@ -973,9 +965,8 @@ int Ga2_ManUnroll_rec( Ga2_Man_t * p, Gia_Obj_t * pObj, int f )
// add new node
Lit
=
Ga2_ObjFindOrAddLit
(
p
,
pObj
,
f
);
Ga2_ManCnfAddDynamic
(
p
,
uTruth
,
Vec_IntArray
(
p
->
vLits
),
Lit
,
Gia_ObjId
(
p
->
pGia
,
pObj
)
);
Ga2_ManCnfAddDynamic
(
p
,
uTruth
,
Vec_IntArray
(
p
->
vLits
),
Lit
);
}
Ga2_ObjAddLit
(
p
,
pObj
,
f
,
Lit
);
return
Lit
;
}
...
...
@@ -1014,6 +1005,7 @@ int Vec_IntCheckUnique( Vec_Int_t * p )
static
inline
int
Ga2_ObjSatValue
(
Ga2_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
int
f
)
{
int
Lit
=
Ga2_ObjFindLit
(
p
,
pObj
,
f
);
assert
(
!
Gia_ObjIsConst0
(
pObj
)
);
if
(
Lit
==
-
1
)
return
0
;
return
Abc_LitIsCompl
(
Lit
)
^
sat_solver2_var_value
(
p
->
pSat
,
Abc_Lit2Var
(
Lit
)
);
...
...
@@ -1024,6 +1016,11 @@ void Ga2_GlaPrepareCexAndMap( Ga2_Man_t * p, Abc_Cex_t ** ppCex, Vec_Int_t ** pv
Vec_Int_t
*
vMap
;
Gia_Obj_t
*
pObj
;
int
f
,
i
,
k
,
Id
;
/*
Gia_ManForEachObj( p->pGia, pObj, i )
if ( Ga2_ObjId(p, pObj) >= 0 )
assert( Vec_IntEntry(p->vValues, Ga2_ObjId(p, pObj)) == i );
*/
// find PIs and PPIs
vMap
=
Vec_IntAlloc
(
1000
);
Gia_ManForEachObjVec
(
p
->
vValues
,
p
->
pGia
,
pObj
,
i
)
...
...
src/aig/gia/giaAbsRef.c
View file @
e3e4a987
...
...
@@ -518,6 +518,7 @@ Vec_Int_t * Rnm_ManRefine( Rnm_Man_t * p, Abc_Cex_t * pCex, Vec_Int_t * vMap, in
Vec_Int_t
*
vSelected
=
Vec_IntAlloc
(
100
);
clock_t
clk
,
clk2
=
clock
();
p
->
nCalls
++
;
// Gia_ManCleanValue( p->pGia );
// initialize
p
->
pCex
=
pCex
;
p
->
vMap
=
vMap
;
...
...
@@ -542,7 +543,7 @@ Vec_Int_t * Rnm_ManRefine( Rnm_Man_t * p, Abc_Cex_t * pCex, Vec_Int_t * vMap, in
p
->
timeBwd
+=
clock
()
-
clk
;
}
// clean values
Rnm_ManCleanValues
(
p
);
//
Rnm_ManCleanValues( p );
// verify (empty) refinement
clk
=
clock
();
Rnm_ManVerifyUsingTerSim
(
p
->
pGia
,
p
->
pCex
,
p
->
vMap
,
p
->
vObjs
,
vSelected
);
...
...
src/sat/bsat/satProof2.h
View file @
e3e4a987
...
...
@@ -239,7 +239,7 @@ static inline void Prf_ManChainResolve( Prf_Man_t * p, clause * c )
}
else
// problem clause
{
if
(
clause_id
(
c
)
)
// has proof ID
if
(
clause_id
(
c
)
>=
0
)
// has proof ID
{
int
Entry
;
if
(
p
->
vId2Pr
==
NULL
)
...
...
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