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
a3b8b0a5
Commit
a3b8b0a5
authored
Mar 13, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing gap timeout in 'bmc3'.
parent
bf795e57
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
6 deletions
+40
-6
src/sat/bmc/bmcBmc3.c
+40
-6
No files found.
src/sat/bmc/bmcBmc3.c
View file @
a3b8b0a5
...
...
@@ -1314,6 +1314,30 @@ void Saig_ParBmcSetDefaultParams( Saig_ParBmc_t * p )
/**Function*************************************************************
Synopsis [Returns time to stop.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
clock_t
Saig_ManBmcTimeToStop
(
Saig_ParBmc_t
*
pPars
,
clock_t
nTimeToStopNG
)
{
clock_t
nTimeToStopGap
=
pPars
->
nTimeOutGap
?
pPars
->
nTimeOutGap
*
CLOCKS_PER_SEC
+
clock
()
:
0
;
clock_t
nTimeToStop
=
0
;
if
(
nTimeToStopNG
&&
nTimeToStopGap
)
nTimeToStop
=
Abc_MinInt
(
nTimeToStopNG
,
nTimeToStopGap
);
else
if
(
nTimeToStopNG
)
nTimeToStop
=
nTimeToStopNG
;
else
if
(
nTimeToStopGap
)
nTimeToStop
=
nTimeToStopGap
;
return
nTimeToStop
;
}
/**Function*************************************************************
Synopsis [Bounded model checking engine.]
Description []
...
...
@@ -1332,7 +1356,9 @@ int Saig_ManBmcScalable( Aig_Man_t * pAig, Saig_ParBmc_t * pPars )
int
nOutDigits
=
Abc_Base10Log
(
Saig_ManPoNum
(
pAig
)
);
int
i
,
f
,
k
,
Lit
,
status
;
clock_t
clk
,
clk2
,
clkOther
=
0
,
clkTotal
=
clock
();
clock_t
nTimeToStop
=
pPars
->
nTimeOut
?
pPars
->
nTimeOut
*
CLOCKS_PER_SEC
+
clock
()
:
0
;
clock_t
nTimeToStopNG
=
pPars
->
nTimeOut
?
pPars
->
nTimeOut
*
CLOCKS_PER_SEC
+
clock
()
:
0
;
clock_t
nTimeToStop
=
Saig_ManBmcTimeToStop
(
pPars
,
nTimeToStopNG
);
// create BMC manager
p
=
Saig_Bmc3ManStart
(
pAig
);
p
->
pPars
=
pPars
;
if
(
pPars
->
fVerbose
)
...
...
@@ -1345,7 +1371,7 @@ int Saig_ManBmcScalable( Aig_Man_t * pAig, Saig_ParBmc_t * pPars )
}
pPars
->
nFramesMax
=
pPars
->
nFramesMax
?
pPars
->
nFramesMax
:
ABC_INFINITY
;
// set runtime limit
if
(
p
->
pPars
->
nTimeOut
)
if
(
nTimeToStop
)
sat_solver_set_runtime_limit
(
p
->
pSat
,
nTimeToStop
);
// perform frames
Aig_ManRandom
(
1
);
...
...
@@ -1402,15 +1428,15 @@ int Saig_ManBmcScalable( Aig_Man_t * pAig, Saig_ParBmc_t * pPars )
if
(
i
>=
Saig_ManPoNum
(
pAig
)
)
break
;
// check for timeout
if
(
pPars
->
nTimeOut
&&
clock
()
>
nTimeToStop
)
if
(
pPars
->
nTimeOut
Gap
&&
pPars
->
timeLastSolved
&&
clock
()
>
pPars
->
timeLastSolved
+
pPars
->
nTimeOutGap
*
CLOCKS_PER_SEC
)
{
printf
(
"Reached
timeout (%d seconds).
\n
"
,
pPars
->
nTimeOut
);
printf
(
"Reached
gap timeout (%d seconds).
\n
"
,
pPars
->
nTimeOutGap
);
Saig_Bmc3ManStop
(
p
);
return
RetValue
;
}
if
(
pPars
->
nTimeOutGap
&&
pPars
->
timeLastSolved
&&
clock
()
>
pPars
->
timeLastSolved
+
pPars
->
nTimeOutGap
*
CLOCKS_PER_SEC
)
if
(
nTimeToStop
&&
clock
()
>
nTimeToStop
)
{
printf
(
"Reached
gap timeout (%d seconds).
\n
"
,
pPars
->
nTimeOutGap
);
printf
(
"Reached
timeout (%d seconds).
\n
"
,
pPars
->
nTimeOut
);
Saig_Bmc3ManStop
(
p
);
return
RetValue
;
}
...
...
@@ -1442,7 +1468,11 @@ clkOther += clock() - clk2;
p
->
vCexes
=
Vec_PtrStart
(
Saig_ManPoNum
(
pAig
)
);
Vec_PtrWriteEntry
(
p
->
vCexes
,
i
,
(
void
*
)(
ABC_PTRINT_T
)
1
);
RetValue
=
0
;
// reset the timeout
pPars
->
timeLastSolved
=
clock
();
nTimeToStop
=
Saig_ManBmcTimeToStop
(
pPars
,
nTimeToStopNG
);
if
(
nTimeToStop
)
sat_solver_set_runtime_limit
(
p
->
pSat
,
nTimeToStop
);
continue
;
}
// solve th is output
...
...
@@ -1517,7 +1547,11 @@ clkOther += clock() - clk2;
p
->
vCexes
=
Vec_PtrStart
(
Saig_ManPoNum
(
pAig
)
);
Vec_PtrWriteEntry
(
p
->
vCexes
,
i
,
(
void
*
)(
ABC_PTRINT_T
)
1
);
RetValue
=
0
;
// reset the timeout
pPars
->
timeLastSolved
=
clock
();
nTimeToStop
=
Saig_ManBmcTimeToStop
(
pPars
,
nTimeToStopNG
);
if
(
nTimeToStop
)
sat_solver_set_runtime_limit
(
p
->
pSat
,
nTimeToStop
);
}
else
{
...
...
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