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
6c3363f7
Commit
6c3363f7
authored
Jul 08, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding restart to rarity simulation in sim3 and &sim3.
parent
e80bd69e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
99 additions
and
37 deletions
+99
-37
src/base/abci/abc.c
+55
-14
src/base/abci/abcDar.c
+5
-5
src/proof/ssw/ssw.h
+2
-2
src/proof/ssw/sswRarity.c
+37
-16
No files found.
src/base/abci/abc.c
View file @
6c3363f7
...
...
@@ -16630,21 +16630,23 @@ int Abc_CommandSim3( Abc_Frame_t * pAbc, int argc, char ** argv )
int
nWords
;
int
nBinSize
;
int
nRounds
;
int
nRestart
;
int
nRandSeed
;
int
TimeOut
;
int
fVerbose
;
extern
int
Abc_NtkDarSeqSim3
(
Abc_Ntk_t
*
pNtk
,
int
nFrames
,
int
nWords
,
int
nBinSize
,
int
nRounds
,
int
nRandSeed
,
int
TimeOut
,
int
fVerbose
);
extern
int
Abc_NtkDarSeqSim3
(
Abc_Ntk_t
*
pNtk
,
int
nFrames
,
int
nWords
,
int
nBinSize
,
int
nRounds
,
int
nR
estart
,
int
nR
andSeed
,
int
TimeOut
,
int
fVerbose
);
// set defaults
nFrames
=
20
;
nWords
=
50
;
nBinSize
=
8
;
nRounds
=
80
;
nRounds
=
0
;
nRestart
=
100
;
nRandSeed
=
0
;
TimeOut
=
0
;
fVerbose
=
0
;
// parse command line
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"FWBRNTvh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"FWBR
S
NTvh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -16692,6 +16694,17 @@ int Abc_CommandSim3( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
nRounds
<
0
)
goto
usage
;
break
;
case
'S'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-S
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
nRestart
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nRestart
<
0
)
goto
usage
;
break
;
case
'N'
:
if
(
globalUtilOptind
>=
argc
)
{
...
...
@@ -16734,18 +16747,19 @@ int Abc_CommandSim3( Abc_Frame_t * pAbc, int argc, char ** argv )
return
1
;
}
ABC_FREE
(
pNtk
->
pSeqModel
);
pAbc
->
Status
=
Abc_NtkDarSeqSim3
(
pNtk
,
nFrames
,
nWords
,
nBinSize
,
nRounds
,
nRandSeed
,
TimeOut
,
fVerbose
);
pAbc
->
Status
=
Abc_NtkDarSeqSim3
(
pNtk
,
nFrames
,
nWords
,
nBinSize
,
nRounds
,
nR
estart
,
nR
andSeed
,
TimeOut
,
fVerbose
);
// pAbc->nFrames = pAbc->pCex->iFrame;
Abc_FrameReplaceCex
(
pAbc
,
&
pNtk
->
pSeqModel
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: sim3 [-FWBRNT num] [-vh]
\n
"
);
Abc_Print
(
-
2
,
"usage: sim3 [-FWBR
S
NT num] [-vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
performs random simulation of the sequential miter
\n
"
);
Abc_Print
(
-
2
,
"
\t
-F num : the number of frames to simulate [default = %d]
\n
"
,
nFrames
);
Abc_Print
(
-
2
,
"
\t
-W num : the number of words to simulate [default = %d]
\n
"
,
nWords
);
Abc_Print
(
-
2
,
"
\t
-B num : the number of flops in one bin [default = %d]
\n
"
,
nBinSize
);
Abc_Print
(
-
2
,
"
\t
-R num : the number of simulation rounds [default = %d]
\n
"
,
nRounds
);
Abc_Print
(
-
2
,
"
\t
-S num : the number of rounds before a restart [default = %d]
\n
"
,
nRestart
);
Abc_Print
(
-
2
,
"
\t
-N num : random number seed (1 <= num <= 1000) [default = %d]
\n
"
,
nRandSeed
);
Abc_Print
(
-
2
,
"
\t
-T num : approximate runtime limit in seconds [default = %d]
\n
"
,
TimeOut
);
Abc_Print
(
-
2
,
"
\t
-v : toggle printing verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
...
...
@@ -23257,21 +23271,23 @@ int Abc_CommandAbc9Sim3( Abc_Frame_t * pAbc, int argc, char ** argv )
int
nWords
;
int
nBinSize
;
int
nRounds
;
int
nRestart
;
int
nRandSeed
;
int
TimeOut
;
int
fVerbose
;
extern
int
Ssw_RarSimulateGia
(
Gia_Man_t
*
p
,
int
nFrames
,
int
nWords
,
int
nBinSize
,
int
nRounds
,
int
nRandSeed
,
int
TimeOut
,
int
fVerbose
);
extern
int
Ssw_RarSimulateGia
(
Gia_Man_t
*
p
,
int
nFrames
,
int
nWords
,
int
nBinSize
,
int
nRounds
,
int
nR
estart
,
int
nR
andSeed
,
int
TimeOut
,
int
fVerbose
);
// set defaults
nFrames
=
20
;
nWords
=
50
;
nBinSize
=
8
;
nRounds
=
80
;
nRounds
=
0
;
nRestart
=
100
;
nRandSeed
=
0
;
TimeOut
=
0
;
fVerbose
=
0
;
// parse command line
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"FWBRNTvh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"FWBR
S
NTvh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -23319,6 +23335,17 @@ int Abc_CommandAbc9Sim3( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
nRounds
<
0
)
goto
usage
;
break
;
case
'S'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-S
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
nRestart
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nRestart
<
0
)
goto
usage
;
break
;
case
'N'
:
if
(
globalUtilOptind
>=
argc
)
{
...
...
@@ -23355,7 +23382,7 @@ int Abc_CommandAbc9Sim3( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print
(
-
1
,
"Abc_CommandAbc9Sim3(): There is no AIG.
\n
"
);
return
1
;
}
pAbc
->
Status
=
Ssw_RarSimulateGia
(
pAbc
->
pGia
,
nFrames
,
nWords
,
nBinSize
,
nRounds
,
nRandSeed
,
TimeOut
,
fVerbose
);
pAbc
->
Status
=
Ssw_RarSimulateGia
(
pAbc
->
pGia
,
nFrames
,
nWords
,
nBinSize
,
nRounds
,
nR
estart
,
nR
andSeed
,
TimeOut
,
fVerbose
);
// pAbc->nFrames = pAbc->pGia->pCexSeq->iFrame;
Abc_FrameReplaceCex
(
pAbc
,
&
pAbc
->
pGia
->
pCexSeq
);
return
0
;
...
...
@@ -23367,6 +23394,7 @@ usage:
Abc_Print
(
-
2
,
"
\t
-W num : the number of words to simulate [default = %d]
\n
"
,
nWords
);
Abc_Print
(
-
2
,
"
\t
-B num : the number of flops in one bin [default = %d]
\n
"
,
nBinSize
);
Abc_Print
(
-
2
,
"
\t
-R num : the number of simulation rounds [default = %d]
\n
"
,
nRounds
);
Abc_Print
(
-
2
,
"
\t
-S num : the number of rounds before a restart [default = %d]
\n
"
,
nRestart
);
Abc_Print
(
-
2
,
"
\t
-N num : random number seed (1 <= num <= 1000) [default = %d]
\n
"
,
nRandSeed
);
Abc_Print
(
-
2
,
"
\t
-T num : approximate runtime limit in seconds [default = %d]
\n
"
,
TimeOut
);
Abc_Print
(
-
2
,
"
\t
-v : toggle printing verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
...
...
@@ -23799,12 +23827,13 @@ usage:
int
Abc_CommandAbc9Equiv3
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
// extern int Ssw_RarSignalFilterGia2( Gia_Man_t * p, int nFrames, int nWords, int nBinSize, int nRounds, int TimeOut, Abc_Cex_t * pCex, int fLatchOnly, int fVerbose );
extern
int
Ssw_RarSignalFilterGia
(
Gia_Man_t
*
p
,
int
nFrames
,
int
nWords
,
int
nBinSize
,
int
nRounds
,
int
nRandSeed
,
int
TimeOut
,
int
fMiter
,
Abc_Cex_t
*
pCex
,
int
fLatchOnly
,
int
fVerbose
);
extern
int
Ssw_RarSignalFilterGia
(
Gia_Man_t
*
p
,
int
nFrames
,
int
nWords
,
int
nBinSize
,
int
nRounds
,
int
nR
estart
,
int
nR
andSeed
,
int
TimeOut
,
int
fMiter
,
Abc_Cex_t
*
pCex
,
int
fLatchOnly
,
int
fVerbose
);
int
c
;
int
nFrames
=
20
;
int
nWords
=
50
;
int
nBinSize
=
8
;
int
nRounds
=
80
;
int
nRounds
=
0
;
int
nRestart
=
100
;
int
nRandSeed
=
0
;
int
TimeOut
=
0
;
int
fMiter
=
0
;
...
...
@@ -23813,7 +23842,7 @@ int Abc_CommandAbc9Equiv3( Abc_Frame_t * pAbc, int argc, char ** argv )
int
fNewAlgo
=
1
;
int
fVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"FWBRNTmxlavh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"FWBR
S
NTmxlavh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -23861,6 +23890,17 @@ int Abc_CommandAbc9Equiv3( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
nRounds
<
0
)
goto
usage
;
break
;
case
'S'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-S
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
nRestart
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nRestart
<
0
)
goto
usage
;
break
;
case
'N'
:
if
(
globalUtilOptind
>=
argc
)
{
...
...
@@ -23934,7 +23974,7 @@ int Abc_CommandAbc9Equiv3( Abc_Frame_t * pAbc, int argc, char ** argv )
}
}
// if ( fNewAlgo )
pAbc
->
Status
=
Ssw_RarSignalFilterGia
(
pAbc
->
pGia
,
nFrames
,
nWords
,
nBinSize
,
nRounds
,
nRandSeed
,
TimeOut
,
fMiter
,
fUseCex
?
pAbc
->
pCex
:
NULL
,
fLatchOnly
,
fVerbose
);
pAbc
->
Status
=
Ssw_RarSignalFilterGia
(
pAbc
->
pGia
,
nFrames
,
nWords
,
nBinSize
,
nRounds
,
nR
estart
,
nR
andSeed
,
TimeOut
,
fMiter
,
fUseCex
?
pAbc
->
pCex
:
NULL
,
fLatchOnly
,
fVerbose
);
// else
// pAbc->Status = Ssw_RarSignalFilterGia2( pAbc->pGia, nFrames, nWords, nBinSize, nRounds, TimeOut, fUseCex? pAbc->pCex: NULL, fLatchOnly, fVerbose );
// pAbc->nFrames = pAbc->pGia->pCexSeq->iFrame;
...
...
@@ -23942,12 +23982,13 @@ int Abc_CommandAbc9Equiv3( Abc_Frame_t * pAbc, int argc, char ** argv )
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: &equiv3 [-FWRNT num] [-mxlvh]
\n
"
);
Abc_Print
(
-
2
,
"usage: &equiv3 [-FWR
S
NT num] [-mxlvh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
computes candidate equivalence classes
\n
"
);
Abc_Print
(
-
2
,
"
\t
-F num : the max number of frames for BMC [default = %d]
\n
"
,
nFrames
);
Abc_Print
(
-
2
,
"
\t
-W num : the number of words to simulate [default = %d]
\n
"
,
nWords
);
// Abc_Print( -2, "\t-B num : the number of flops in one bin [default = %d]\n", nBinSize );
Abc_Print
(
-
2
,
"
\t
-R num : the max number of simulation rounds [default = %d]
\n
"
,
nRounds
);
Abc_Print
(
-
2
,
"
\t
-S num : the number of rounds before a restart [default = %d]
\n
"
,
nRestart
);
Abc_Print
(
-
2
,
"
\t
-N num : random number seed (1 <= num <= 1000) [default = %d]
\n
"
,
nRandSeed
);
Abc_Print
(
-
2
,
"
\t
-T num : runtime limit in seconds for all rounds [default = %d]
\n
"
,
TimeOut
);
Abc_Print
(
-
2
,
"
\t
-m : toggle miter vs. any circuit [default = %s]
\n
"
,
fMiter
?
"miter"
:
"circuit"
);
...
...
src/base/abci/abcDar.c
View file @
6c3363f7
...
...
@@ -3199,7 +3199,7 @@ int Abc_NtkDarSeqSim( Abc_Ntk_t * pNtk, int nFrames, int nWords, int TimeOut, in
SeeAlso []
***********************************************************************/
int
Abc_NtkDarSeqSim3
(
Abc_Ntk_t
*
pNtk
,
int
nFrames
,
int
nWords
,
int
nBinSize
,
int
nRounds
,
int
nRandSeed
,
int
TimeOut
,
int
fVerbose
)
int
Abc_NtkDarSeqSim3
(
Abc_Ntk_t
*
pNtk
,
int
nFrames
,
int
nWords
,
int
nBinSize
,
int
nRounds
,
int
nR
estart
,
int
nR
andSeed
,
int
TimeOut
,
int
fVerbose
)
{
Aig_Man_t
*
pMan
;
int
status
,
RetValue
=
-
1
;
...
...
@@ -3210,12 +3210,12 @@ int Abc_NtkDarSeqSim3( Abc_Ntk_t * pNtk, int nFrames, int nWords, int nBinSize,
Abc_AigCleanup
((
Abc_Aig_t
*
)
pNtk
->
pManFunc
);
}
pMan
=
Abc_NtkToDar
(
pNtk
,
0
,
1
);
if
(
Ssw_RarSimulate
(
pMan
,
nFrames
,
nWords
,
nBinSize
,
nRounds
,
nRandSeed
,
TimeOut
,
fVerbose
)
==
0
)
if
(
Ssw_RarSimulate
(
pMan
,
nFrames
,
nWords
,
nBinSize
,
nRounds
,
nR
estart
,
nR
andSeed
,
TimeOut
,
fVerbose
)
==
0
)
{
if
(
pMan
->
pSeqModel
)
{
Abc_Print
(
1
,
"Simulation of %d frames with %d words asserted output %d in frame %d. "
,
nFrames
,
nWords
,
pMan
->
pSeqModel
->
iPo
,
pMan
->
pSeqModel
->
iFrame
);
//
Abc_Print( 1, "Simulation of %d frames with %d words asserted output %d in frame %d. ",
//
nFrames, nWords, pMan->pSeqModel->iPo, pMan->pSeqModel->iFrame );
status
=
Saig_ManVerifyCex
(
pMan
,
pMan
->
pSeqModel
);
if
(
status
==
0
)
Abc_Print
(
1
,
"Abc_NtkDarSeqSim(): Counter-example verification has FAILED.
\n
"
);
...
...
@@ -3230,7 +3230,7 @@ int Abc_NtkDarSeqSim3( Abc_Ntk_t * pNtk, int nFrames, int nWords, int nBinSize,
// Abc_Print( 1, "Simulation of %d frames with %d words did not assert the outputs. ",
// nFrames, nWords );
}
ABC_PRT
(
"Time"
,
clock
()
-
clk
);
//
ABC_PRT( "Time", clock() - clk );
Aig_ManStop
(
pMan
);
return
RetValue
;
}
...
...
src/proof/ssw/ssw.h
View file @
6c3363f7
...
...
@@ -116,8 +116,8 @@ extern int Ssw_SecWithPairs( Aig_Man_t * pAig1, Aig_Man_t * pAig2, Vec
extern
int
Ssw_SecGeneral
(
Aig_Man_t
*
pAig1
,
Aig_Man_t
*
pAig2
,
Ssw_Pars_t
*
pPars
);
extern
int
Ssw_SecGeneralMiter
(
Aig_Man_t
*
pMiter
,
Ssw_Pars_t
*
pPars
);
/*=== sswRarity.c ===================================================*/
extern
int
Ssw_RarSignalFilter
(
Aig_Man_t
*
pAig
,
int
nFrames
,
int
nWords
,
int
nBinSize
,
int
nRounds
,
int
nRandSeed
,
int
TimeOut
,
int
fMiter
,
Abc_Cex_t
*
pCex
,
int
fLatchOnly
,
int
fVerbose
);
extern
int
Ssw_RarSimulate
(
Aig_Man_t
*
pAig
,
int
nFrames
,
int
nWords
,
int
nBinSize
,
int
nRounds
,
int
nRandSeed
,
int
TimeOut
,
int
fVerbose
);
extern
int
Ssw_RarSignalFilter
(
Aig_Man_t
*
pAig
,
int
nFrames
,
int
nWords
,
int
nBinSize
,
int
nRounds
,
int
nR
estart
,
int
nR
andSeed
,
int
TimeOut
,
int
fMiter
,
Abc_Cex_t
*
pCex
,
int
fLatchOnly
,
int
fVerbose
);
extern
int
Ssw_RarSimulate
(
Aig_Man_t
*
pAig
,
int
nFrames
,
int
nWords
,
int
nBinSize
,
int
nRounds
,
int
nR
estart
,
int
nR
andSeed
,
int
TimeOut
,
int
fVerbose
);
/*=== sswSim.c ===================================================*/
extern
Ssw_Sml_t
*
Ssw_SmlSimulateComb
(
Aig_Man_t
*
pAig
,
int
nWords
);
extern
Ssw_Sml_t
*
Ssw_SmlSimulateSeq
(
Aig_Man_t
*
pAig
,
int
nPref
,
int
nFrames
,
int
nWords
);
...
...
src/proof/ssw/sswRarity.c
View file @
6c3363f7
...
...
@@ -17,7 +17,7 @@
Revision [$Id: sswRarity.c,v 1.00 2008/09/01 00:00:00 alanmi Exp $]
***********************************************************************/
#include "sswInt.h"
#include "aig/gia/giaAig.h"
#include "base/main/main.h"
...
...
@@ -191,8 +191,6 @@ Abc_Cex_t * Ssw_RarDeriveCex( Ssw_RarMan_t * p, int iFrame, int iPo, int iPatFin
else
{
// printf( "Counter-example verification is successful.\n" );
if
(
fVerbose
)
printf
(
"Output %d was asserted in frame %d (use
\"
write_counter
\"
to dump a witness).
\n
"
,
pCex
->
iPo
,
pCex
->
iFrame
);
}
return
pCex
;
}
...
...
@@ -892,7 +890,7 @@ int Ssw_RarCheckTrivial( Aig_Man_t * pAig, int fVerbose )
SeeAlso []
***********************************************************************/
int
Ssw_RarSimulate
(
Aig_Man_t
*
pAig
,
int
nFrames
,
int
nWords
,
int
nBinSize
,
int
nRounds
,
int
nRandSeed
,
int
TimeOut
,
int
fVerbose
)
int
Ssw_RarSimulate
(
Aig_Man_t
*
pAig
,
int
nFrames
,
int
nWords
,
int
nBinSize
,
int
nRounds
,
int
nR
estart
,
int
nR
andSeed
,
int
TimeOut
,
int
fVerbose
)
{
int
fTryBmc
=
0
;
int
fMiter
=
1
;
...
...
@@ -900,6 +898,8 @@ int Ssw_RarSimulate( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSize, in
int
r
,
f
=
-
1
;
clock_t
clk
,
clkTotal
=
clock
();
clock_t
nTimeToStop
=
TimeOut
?
TimeOut
*
CLOCKS_PER_SEC
+
clock
()
:
0
;
int
nNumRestart
=
0
;
int
nSavedSeed
=
nRandSeed
;
int
RetValue
=
-
1
;
int
iFrameFail
=
-
1
;
assert
(
Aig_ManRegNum
(
pAig
)
>
0
);
...
...
@@ -914,14 +914,14 @@ int Ssw_RarSimulate( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSize, in
printf
(
"Rarity simulation with %d words, %d frames, %d rounds, %d seed, and %d sec timeout.
\n
"
,
nWords
,
nFrames
,
nRounds
,
nRandSeed
,
TimeOut
);
// reset random numbers
Ssw_RarManPrepareRandom
(
n
Ran
dSeed
);
Ssw_RarManPrepareRandom
(
n
Save
dSeed
);
// create manager
p
=
Ssw_RarManStart
(
pAig
,
nWords
,
nFrames
,
nBinSize
,
fVerbose
);
p
->
vInits
=
Vec_IntStart
(
Aig_ManRegNum
(
pAig
)
*
nWords
);
// perform simulation rounds
for
(
r
=
0
;
r
<
nRounds
;
r
++
)
for
(
r
=
0
;
!
nRounds
||
(
nNumRestart
*
nRestart
+
r
<
nRounds
)
;
r
++
)
{
clk
=
clock
();
if
(
fTryBmc
)
...
...
@@ -940,9 +940,14 @@ int Ssw_RarSimulate( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSize, in
{
if
(
fVerbose
)
printf
(
"
\n
"
);
// printf( "Simulation asserted a PO in frame f: %d <= f < %d.\n", r * nFrames, (r+1) * nFrames );
Ssw_RarManPrepareRandom
(
n
Ran
dSeed
);
Ssw_RarManPrepareRandom
(
n
Save
dSeed
);
ABC_FREE
(
pAig
->
pSeqModel
);
if
(
fVerbose
)
printf
(
"Simulated %d frames for %d rounds with %d restarts.
\n
"
,
nFrames
,
nNumRestart
*
nRestart
+
r
,
nNumRestart
);
pAig
->
pSeqModel
=
Ssw_RarDeriveCex
(
p
,
r
*
p
->
nFrames
+
f
,
p
->
iFailPo
,
p
->
iFailPat
,
fVerbose
);
// print final report
printf
(
"Output %d was asserted in frame %d (use
\"
write_counter
\"
to dump a witness). "
,
pAig
->
pSeqModel
->
iPo
,
pAig
->
pSeqModel
->
iFrame
);
Abc_PrintTime
(
1
,
"Time"
,
clock
()
-
clkTotal
);
RetValue
=
0
;
goto
finish
;
}
...
...
@@ -950,12 +955,25 @@ int Ssw_RarSimulate( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSize, in
if
(
TimeOut
&&
clock
()
>
nTimeToStop
)
{
if
(
fVerbose
)
printf
(
"
\n
"
);
printf
(
"Reached timeout (%d seconds).
\n
"
,
TimeOut
);
printf
(
"Simulated %d frames for %d rounds with %d restarts. "
,
nFrames
,
nNumRestart
*
nRestart
+
r
,
nNumRestart
);
printf
(
"Reached timeout (%d sec).
\n
"
,
TimeOut
);
goto
finish
;
}
}
// get initialization patterns
Ssw_RarTransferPatterns
(
p
,
p
->
vInits
);
if
(
r
==
nRestart
)
{
r
=
-
1
;
nSavedSeed
=
(
nSavedSeed
+
1
)
%
1000
;
Ssw_RarManPrepareRandom
(
nSavedSeed
);
Vec_IntFill
(
p
->
vInits
,
Aig_ManRegNum
(
pAig
)
*
nWords
,
0
);
nNumRestart
++
;
Vec_IntClear
(
p
->
vPatBests
);
// clean rarity info
// memset( p->pRarity, 0, sizeof(int) * (1 << nBinSize) * p->nGroups );
}
else
Ssw_RarTransferPatterns
(
p
,
p
->
vInits
);
// printout
if
(
fVerbose
)
{
...
...
@@ -988,12 +1006,12 @@ finish:
SeeAlso []
***********************************************************************/
int
Ssw_RarSimulateGia
(
Gia_Man_t
*
p
,
int
nFrames
,
int
nWords
,
int
nBinSize
,
int
nRounds
,
int
nRandSeed
,
int
TimeOut
,
int
fVerbose
)
int
Ssw_RarSimulateGia
(
Gia_Man_t
*
p
,
int
nFrames
,
int
nWords
,
int
nBinSize
,
int
nRounds
,
int
nR
estart
,
int
nR
andSeed
,
int
TimeOut
,
int
fVerbose
)
{
Aig_Man_t
*
pAig
;
int
RetValue
;
pAig
=
Gia_ManToAigSimple
(
p
);
RetValue
=
Ssw_RarSimulate
(
pAig
,
nFrames
,
nWords
,
nBinSize
,
nRounds
,
nRandSeed
,
TimeOut
,
fVerbose
);
RetValue
=
Ssw_RarSimulate
(
pAig
,
nFrames
,
nWords
,
nBinSize
,
nRounds
,
nR
estart
,
nR
andSeed
,
TimeOut
,
fVerbose
);
// save counter-example
Abc_CexFree
(
p
->
pCexSeq
);
p
->
pCexSeq
=
pAig
->
pSeqModel
;
pAig
->
pSeqModel
=
NULL
;
...
...
@@ -1012,7 +1030,7 @@ int Ssw_RarSimulateGia( Gia_Man_t * p, int nFrames, int nWords, int nBinSize, in
SeeAlso []
***********************************************************************/
int
Ssw_RarSignalFilter
(
Aig_Man_t
*
pAig
,
int
nFrames
,
int
nWords
,
int
nBinSize
,
int
nRounds
,
int
nRandSeed
,
int
TimeOut
,
int
fMiter
,
Abc_Cex_t
*
pCex
,
int
fLatchOnly
,
int
fVerbose
)
int
Ssw_RarSignalFilter
(
Aig_Man_t
*
pAig
,
int
nFrames
,
int
nWords
,
int
nBinSize
,
int
nRounds
,
int
nR
estart
,
int
nR
andSeed
,
int
TimeOut
,
int
fMiter
,
Abc_Cex_t
*
pCex
,
int
fLatchOnly
,
int
fVerbose
)
{
Ssw_RarMan_t
*
p
;
int
r
,
f
=
-
1
,
i
,
k
;
...
...
@@ -1063,7 +1081,7 @@ int Ssw_RarSignalFilter( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSize
Ssw_ClassesPrint
(
p
->
ppClasses
,
0
);
}
// refine classes using BMC
for
(
r
=
0
;
r
<
nRounds
;
r
++
)
for
(
r
=
0
;
!
nRounds
||
r
<
nRounds
;
r
++
)
{
// start filtering equivalence classes
if
(
Ssw_ClassesCand1Num
(
p
->
ppClasses
)
==
0
&&
Ssw_ClassesClassNum
(
p
->
ppClasses
)
==
0
)
...
...
@@ -1083,6 +1101,9 @@ int Ssw_RarSignalFilter( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSize
Ssw_RarManPrepareRandom
(
nRandSeed
);
Abc_CexFree
(
pAig
->
pSeqModel
);
pAig
->
pSeqModel
=
Ssw_RarDeriveCex
(
p
,
r
*
p
->
nFrames
+
f
,
p
->
iFailPo
,
p
->
iFailPat
,
1
);
// print final report
printf
(
"Output %d was asserted in frame %d (use
\"
write_counter
\"
to dump a witness). "
,
pAig
->
pSeqModel
->
iPo
,
pAig
->
pSeqModel
->
iFrame
);
Abc_PrintTime
(
1
,
"Time"
,
clock
()
-
clkTotal
);
RetValue
=
0
;
goto
finish
;
}
...
...
@@ -1090,7 +1111,7 @@ int Ssw_RarSignalFilter( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSize
if
(
TimeOut
&&
clock
()
>
nTimeToStop
)
{
if
(
fVerbose
)
printf
(
"
\n
"
);
printf
(
"Reached timeout (%d sec
onds
).
\n
"
,
TimeOut
);
printf
(
"Reached timeout (%d sec).
\n
"
,
TimeOut
);
goto
finish
;
}
}
...
...
@@ -1132,7 +1153,7 @@ finish:
SeeAlso []
***********************************************************************/
int
Ssw_RarSignalFilterGia
(
Gia_Man_t
*
p
,
int
nFrames
,
int
nWords
,
int
nBinSize
,
int
nRounds
,
int
nRandSeed
,
int
TimeOut
,
int
fMiter
,
Abc_Cex_t
*
pCex
,
int
fLatchOnly
,
int
fVerbose
)
int
Ssw_RarSignalFilterGia
(
Gia_Man_t
*
p
,
int
nFrames
,
int
nWords
,
int
nBinSize
,
int
nRounds
,
int
nR
estart
,
int
nR
andSeed
,
int
TimeOut
,
int
fMiter
,
Abc_Cex_t
*
pCex
,
int
fLatchOnly
,
int
fVerbose
)
{
Aig_Man_t
*
pAig
;
int
RetValue
;
...
...
@@ -1143,7 +1164,7 @@ int Ssw_RarSignalFilterGia( Gia_Man_t * p, int nFrames, int nWords, int nBinSize
ABC_FREE
(
p
->
pReprs
);
ABC_FREE
(
p
->
pNexts
);
}
RetValue
=
Ssw_RarSignalFilter
(
pAig
,
nFrames
,
nWords
,
nBinSize
,
nRounds
,
nRandSeed
,
TimeOut
,
fMiter
,
pCex
,
fLatchOnly
,
fVerbose
);
RetValue
=
Ssw_RarSignalFilter
(
pAig
,
nFrames
,
nWords
,
nBinSize
,
nRounds
,
nR
estart
,
nR
andSeed
,
TimeOut
,
fMiter
,
pCex
,
fLatchOnly
,
fVerbose
);
Gia_ManReprFromAigRepr
(
pAig
,
p
);
// save counter-example
Abc_CexFree
(
p
->
pCexSeq
);
...
...
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