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
dd96bb74
Commit
dd96bb74
authored
Feb 10, 2017
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding PDR with abstraction.
parent
5d717256
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
13 deletions
+39
-13
src/proof/pdr/pdrCore.c
+8
-5
src/proof/pdr/pdrInt.h
+3
-0
src/proof/pdr/pdrInv.c
+5
-3
src/proof/pdr/pdrMan.c
+7
-4
src/proof/pdr/pdrTsim.c
+16
-1
No files found.
src/proof/pdr/pdrCore.c
View file @
dd96bb74
...
@@ -861,7 +861,8 @@ int Pdr_ManSolveInt( Pdr_Man_t * p )
...
@@ -861,7 +861,8 @@ int Pdr_ManSolveInt( Pdr_Man_t * p )
Pdr_ManCreateSolver
(
p
,
(
iFrame
=
0
)
);
Pdr_ManCreateSolver
(
p
,
(
iFrame
=
0
)
);
while
(
1
)
while
(
1
)
{
{
if
(
p
->
pPars
->
fUseAbs
&&
iFrame
==
2
)
int
fRefined
=
0
;
if
(
p
->
pPars
->
fUseAbs
&&
iFrame
==
3
)
{
{
int
i
,
Prio
;
int
i
,
Prio
;
assert
(
p
->
vAbsFlops
==
NULL
);
assert
(
p
->
vAbsFlops
==
NULL
);
...
@@ -872,9 +873,8 @@ int Pdr_ManSolveInt( Pdr_Man_t * p )
...
@@ -872,9 +873,8 @@ int Pdr_ManSolveInt( Pdr_Man_t * p )
if
(
Prio
>>
p
->
nPrioShift
)
if
(
Prio
>>
p
->
nPrioShift
)
Vec_IntWriteEntry
(
p
->
vAbsFlops
,
i
,
1
);
Vec_IntWriteEntry
(
p
->
vAbsFlops
,
i
,
1
);
}
}
if
(
p
->
pPars
->
fUseAbs
&&
p
->
vAbsFlops
)
//if ( p->pPars->fUseAbs && p->vAbsFlops )
printf
(
"Starting frame %d with %d flops.
\n
"
,
iFrame
,
Vec_IntCountPositive
(
p
->
vAbsFlops
)
);
// printf( "Starting frame %d with %d flops.\n", iFrame, Vec_IntCountPositive(p->vAbsFlops) );
p
->
nFrames
=
iFrame
;
p
->
nFrames
=
iFrame
;
assert
(
iFrame
==
Vec_PtrSize
(
p
->
vSolvers
)
-
1
);
assert
(
iFrame
==
Vec_PtrSize
(
p
->
vSolvers
)
-
1
);
p
->
iUseFrame
=
Abc_MaxInt
(
iFrame
,
1
);
p
->
iUseFrame
=
Abc_MaxInt
(
iFrame
,
1
);
...
@@ -1000,12 +1000,15 @@ int Pdr_ManSolveInt( Pdr_Man_t * p )
...
@@ -1000,12 +1000,15 @@ int Pdr_ManSolveInt( Pdr_Man_t * p )
p
->
pPars
->
iFrame
=
iFrame
;
p
->
pPars
->
iFrame
=
iFrame
;
if
(
!
p
->
pPars
->
fSolveAll
)
if
(
!
p
->
pPars
->
fSolveAll
)
{
{
abctime
clk
=
Abc_Clock
();
Abc_Cex_t
*
pCex
=
Pdr_ManDeriveCexAbs
(
p
);
Abc_Cex_t
*
pCex
=
Pdr_ManDeriveCexAbs
(
p
);
p
->
tAbs
+=
Abc_Clock
()
-
clk
;
if
(
pCex
==
NULL
)
if
(
pCex
==
NULL
)
{
{
assert
(
p
->
pPars
->
fUseAbs
);
assert
(
p
->
pPars
->
fUseAbs
);
Pdr_QueueClean
(
p
);
Pdr_QueueClean
(
p
);
pCube
=
NULL
;
pCube
=
NULL
;
fRefined
=
1
;
break
;
// keep solving
break
;
// keep solving
}
}
p
->
pAig
->
pSeqModel
=
pCex
;
p
->
pAig
->
pSeqModel
=
pCex
;
...
@@ -1058,7 +1061,7 @@ int Pdr_ManSolveInt( Pdr_Man_t * p )
...
@@ -1058,7 +1061,7 @@ int Pdr_ManSolveInt( Pdr_Man_t * p )
}
}
if
(
p
->
pPars
->
fVerbose
)
if
(
p
->
pPars
->
fVerbose
)
Pdr_ManPrintProgress
(
p
,
1
,
Abc_Clock
()
-
clkStart
);
Pdr_ManPrintProgress
(
p
,
!
fRefined
,
Abc_Clock
()
-
clkStart
);
// open a new timeframe
// open a new timeframe
p
->
nQueLim
=
p
->
pPars
->
nRestLimit
;
p
->
nQueLim
=
p
->
pPars
->
nRestLimit
;
assert
(
pCube
==
NULL
);
assert
(
pCube
==
NULL
);
...
...
src/proof/pdr/pdrInt.h
View file @
dd96bb74
...
@@ -96,6 +96,8 @@ struct Pdr_Man_t_
...
@@ -96,6 +96,8 @@ struct Pdr_Man_t_
Vec_Int_t
*
vAbsFlops
;
// flops currently used
Vec_Int_t
*
vAbsFlops
;
// flops currently used
Vec_Int_t
*
vMapFf2Ppi
;
Vec_Int_t
*
vMapFf2Ppi
;
Vec_Int_t
*
vMapPpi2Ff
;
Vec_Int_t
*
vMapPpi2Ff
;
int
nCexes
;
int
nCexesTotal
;
// terminary simulation
// terminary simulation
Txs_Man_t
*
pTxs
;
Txs_Man_t
*
pTxs
;
// internal use
// internal use
...
@@ -142,6 +144,7 @@ struct Pdr_Man_t_
...
@@ -142,6 +144,7 @@ struct Pdr_Man_t_
abctime
tTsim
;
abctime
tTsim
;
abctime
tContain
;
abctime
tContain
;
abctime
tCnf
;
abctime
tCnf
;
abctime
tAbs
;
abctime
tTotal
;
abctime
tTotal
;
};
};
...
...
src/proof/pdr/pdrInv.c
View file @
dd96bb74
...
@@ -80,8 +80,10 @@ void Pdr_ManPrintProgress( Pdr_Man_t * p, int fClose, abctime Time )
...
@@ -80,8 +80,10 @@ void Pdr_ManPrintProgress( Pdr_Man_t * p, int fClose, abctime Time )
}
}
for
(
i
=
ThisSize
;
i
<
70
;
i
++
)
for
(
i
=
ThisSize
;
i
<
70
;
i
++
)
Abc_Print
(
1
,
" "
);
Abc_Print
(
1
,
" "
);
Abc_Print
(
1
,
"%6d"
,
p
->
nQueMax
);
Abc_Print
(
1
,
"%5d"
,
p
->
nQueMax
);
Abc_Print
(
1
,
"%6d"
,
p
->
nAbsFlops
);
Abc_Print
(
1
,
"%5d"
,
p
->
vAbsFlops
?
Vec_IntCountPositive
(
p
->
vAbsFlops
)
:
p
->
nAbsFlops
);
if
(
p
->
pPars
->
fUseAbs
)
Abc_Print
(
1
,
"%5d"
,
p
->
nCexes
);
Abc_Print
(
1
,
"%10.2f sec"
,
1
.
0
*
Time
/
CLOCKS_PER_SEC
);
Abc_Print
(
1
,
"%10.2f sec"
,
1
.
0
*
Time
/
CLOCKS_PER_SEC
);
if
(
p
->
pPars
->
fSolveAll
)
if
(
p
->
pPars
->
fSolveAll
)
Abc_Print
(
1
,
" CEX =%4d"
,
p
->
pPars
->
nFailOuts
);
Abc_Print
(
1
,
" CEX =%4d"
,
p
->
pPars
->
nFailOuts
);
...
@@ -89,7 +91,7 @@ void Pdr_ManPrintProgress( Pdr_Man_t * p, int fClose, abctime Time )
...
@@ -89,7 +91,7 @@ void Pdr_ManPrintProgress( Pdr_Man_t * p, int fClose, abctime Time )
Abc_Print
(
1
,
" T/O =%3d"
,
p
->
pPars
->
nDropOuts
);
Abc_Print
(
1
,
" T/O =%3d"
,
p
->
pPars
->
nDropOuts
);
Abc_Print
(
1
,
"%s"
,
fClose
?
"
\n
"
:
"
\r
"
);
Abc_Print
(
1
,
"%s"
,
fClose
?
"
\n
"
:
"
\r
"
);
if
(
fClose
)
if
(
fClose
)
p
->
nQueMax
=
0
;
p
->
nQueMax
=
0
,
p
->
nCexes
=
0
;
fflush
(
stdout
);
fflush
(
stdout
);
}
}
...
...
src/proof/pdr/pdrMan.c
View file @
dd96bb74
...
@@ -324,8 +324,8 @@ void Pdr_ManStop( Pdr_Man_t * p )
...
@@ -324,8 +324,8 @@ void Pdr_ManStop( Pdr_Man_t * p )
Aig_ManCleanMarkAB
(
p
->
pAig
);
Aig_ManCleanMarkAB
(
p
->
pAig
);
if
(
p
->
pPars
->
fVerbose
)
if
(
p
->
pPars
->
fVerbose
)
{
{
Abc_Print
(
1
,
"Block =%5d Oblig =%6d Clause =%6d Call =%6d (sat=%.1f%%) Start =%4d
\n
"
,
Abc_Print
(
1
,
"Block =%5d Oblig =%6d Clause =%6d Call =%6d (sat=%.1f%%)
Cex =%4d
Start =%4d
\n
"
,
p
->
nBlocks
,
p
->
nObligs
,
p
->
nCubes
,
p
->
nCalls
,
100
.
0
*
p
->
nCallsS
/
p
->
nCalls
,
p
->
nStarts
);
p
->
nBlocks
,
p
->
nObligs
,
p
->
nCubes
,
p
->
nCalls
,
100
.
0
*
p
->
nCallsS
/
p
->
nCalls
,
p
->
n
CexesTotal
,
p
->
n
Starts
);
ABC_PRTP
(
"SAT solving"
,
p
->
tSat
,
p
->
tTotal
);
ABC_PRTP
(
"SAT solving"
,
p
->
tSat
,
p
->
tTotal
);
ABC_PRTP
(
" unsat "
,
p
->
tSatUnsat
,
p
->
tTotal
);
ABC_PRTP
(
" unsat "
,
p
->
tSatUnsat
,
p
->
tTotal
);
ABC_PRTP
(
" sat "
,
p
->
tSatSat
,
p
->
tTotal
);
ABC_PRTP
(
" sat "
,
p
->
tSatSat
,
p
->
tTotal
);
...
@@ -334,6 +334,7 @@ void Pdr_ManStop( Pdr_Man_t * p )
...
@@ -334,6 +334,7 @@ void Pdr_ManStop( Pdr_Man_t * p )
ABC_PRTP
(
"Ternary sim"
,
p
->
tTsim
,
p
->
tTotal
);
ABC_PRTP
(
"Ternary sim"
,
p
->
tTsim
,
p
->
tTotal
);
ABC_PRTP
(
"Containment"
,
p
->
tContain
,
p
->
tTotal
);
ABC_PRTP
(
"Containment"
,
p
->
tContain
,
p
->
tTotal
);
ABC_PRTP
(
"CNF compute"
,
p
->
tCnf
,
p
->
tTotal
);
ABC_PRTP
(
"CNF compute"
,
p
->
tCnf
,
p
->
tTotal
);
ABC_PRTP
(
"Refinement "
,
p
->
tAbs
,
p
->
tTotal
);
ABC_PRTP
(
"TOTAL "
,
p
->
tTotal
,
p
->
tTotal
);
ABC_PRTP
(
"TOTAL "
,
p
->
tTotal
,
p
->
tTotal
);
fflush
(
stdout
);
fflush
(
stdout
);
}
}
...
@@ -503,7 +504,7 @@ Abc_Cex_t * Pdr_ManDeriveCexAbs( Pdr_Man_t * p )
...
@@ -503,7 +504,7 @@ Abc_Cex_t * Pdr_ManDeriveCexAbs( Pdr_Man_t * p )
assert
(
f
==
nFrames
);
assert
(
f
==
nFrames
);
// perform CEX minimization
// perform CEX minimization
pAbs
=
Gia_ManDupAbs
(
p
->
pGia
,
p
->
vMapPpi2Ff
,
p
->
vMapFf2Ppi
);
pAbs
=
Gia_ManDupAbs
(
p
->
pGia
,
p
->
vMapPpi2Ff
,
p
->
vMapFf2Ppi
);
pCexCare
=
Bmc_CexCareMinimizeAig
(
pAbs
,
nPis
,
pCex
,
1
,
1
,
1
);
pCexCare
=
Bmc_CexCareMinimizeAig
(
pAbs
,
nPis
,
pCex
,
1
,
0
,
0
);
Gia_ManStop
(
pAbs
);
Gia_ManStop
(
pAbs
);
assert
(
pCexCare
->
nPis
==
pCex
->
nPis
);
assert
(
pCexCare
->
nPis
==
pCex
->
nPis
);
Abc_CexFree
(
pCex
);
Abc_CexFree
(
pCex
);
...
@@ -520,7 +521,9 @@ Abc_Cex_t * Pdr_ManDeriveCexAbs( Pdr_Man_t * p )
...
@@ -520,7 +521,9 @@ Abc_Cex_t * Pdr_ManDeriveCexAbs( Pdr_Man_t * p )
Abc_CexFree
(
pCexCare
);
Abc_CexFree
(
pCexCare
);
if
(
nFfRefined
==
0
)
// no refinement -- this is a real CEX
if
(
nFfRefined
==
0
)
// no refinement -- this is a real CEX
return
Pdr_ManDeriveCex
(
p
);
return
Pdr_ManDeriveCex
(
p
);
printf
(
"CEX-based refinement refined %d flops.
\n
"
,
nFfRefined
);
//printf( "CEX-based refinement refined %d flops.\n", nFfRefined );
p
->
nCexesTotal
++
;
p
->
nCexes
++
;
return
NULL
;
return
NULL
;
}
}
...
...
src/proof/pdr/pdrTsim.c
View file @
dd96bb74
...
@@ -476,7 +476,7 @@ Pdr_ManPrintCex( p->pAig, vCiObjs, vCiVals, vCi2Rem );
...
@@ -476,7 +476,7 @@ Pdr_ManPrintCex( p->pAig, vCiObjs, vCiVals, vCi2Rem );
// move abstracted literals from flops to inputs
// move abstracted literals from flops to inputs
if
(
p
->
pPars
->
fUseAbs
&&
p
->
vAbsFlops
)
if
(
p
->
pPars
->
fUseAbs
&&
p
->
vAbsFlops
)
{
{
int
i
,
iLit
,
k
=
0
,
fAllNegs
=
1
;
int
i
,
iLit
,
Used
,
k
=
0
,
fAllNegs
=
1
;
Vec_IntForEachEntry
(
vRes
,
iLit
,
i
)
Vec_IntForEachEntry
(
vRes
,
iLit
,
i
)
{
{
if
(
Vec_IntEntry
(
p
->
vAbsFlops
,
Abc_Lit2Var
(
iLit
))
)
// used flop
if
(
Vec_IntEntry
(
p
->
vAbsFlops
,
Abc_Lit2Var
(
iLit
))
)
// used flop
...
@@ -501,6 +501,21 @@ Pdr_ManPrintCex( p->pAig, vCiObjs, vCiVals, vCi2Rem );
...
@@ -501,6 +501,21 @@ Pdr_ManPrintCex( p->pAig, vCiObjs, vCiVals, vCi2Rem );
break
;
break
;
}
}
}
}
// add any flop that is not in the cone
if
(
i
==
Vec_IntSize
(
vCiObjs
)
)
{
Vec_IntForEachEntry
(
p
->
vAbsFlops
,
Used
,
i
)
{
if
(
!
Used
)
continue
;
if
(
Vec_IntFind
(
vRes
,
Abc_Var2Lit
(
i
,
1
)
)
>=
0
)
continue
;
Vec_IntPush
(
vRes
,
Abc_Var2Lit
(
i
,
0
)
);
//Vec_IntPrint( vRes );
break
;
}
assert
(
i
<
Vec_IntSize
(
p
->
vAbsFlops
)
);
}
}
}
}
}
pRes
=
Pdr_SetCreate
(
vRes
,
vPiLits
);
pRes
=
Pdr_SetCreate
(
vRes
,
vPiLits
);
...
...
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