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
5c326464
Commit
5c326464
authored
Nov 03, 2011
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Temporarily added new runtime computation procedures.
parent
f75e55bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
10 deletions
+43
-10
src/aig/saig/saigGlaPba.c
+43
-10
No files found.
src/aig/saig/saigGlaPba.c
View file @
5c326464
...
@@ -57,6 +57,38 @@ struct Aig_Gla2Man_t_
...
@@ -57,6 +57,38 @@ struct Aig_Gla2Man_t_
/// FUNCTION DEFINITIONS ///
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
#define ABC_CPS 1000
/**Function*************************************************************
Synopsis [Procedure returns miliseconds elapsed since the last reset.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_Clock
(
int
Timer
,
int
fReset
)
{
static
Time
[
16
],
Clock
[
16
];
int
Clock2
,
Diff
;
assert
(
Timer
>
0
&&
Timer
<
16
);
if
(
fReset
)
{
Time
[
Timer
]
=
time
(
NULL
);
Clock
[
Timer
]
=
clock
();
return
0
;
}
Clock2
=
clock
();
if
(
Clock2
>
Clock
[
Timer
]
)
Diff
=
(
Clock2
-
Clock
[
Timer
])
%
CLOCKS_PER_SEC
;
else
Diff
=
CLOCKS_PER_SEC
-
(
Clock
[
Timer
]
-
Clock2
)
%
CLOCKS_PER_SEC
;
return
(
time
(
NULL
)
-
Time
[
Timer
])
*
ABC_CPS
+
(
Diff
*
ABC_CPS
)
/
CLOCKS_PER_SEC
;
}
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Adds constant to the solver.]
Synopsis [Adds constant to the solver.]
...
@@ -400,10 +432,11 @@ Vec_Int_t * Saig_AbsSolverUnsatCore( sat_solver * pSat, int nConfMax, int fVerbo
...
@@ -400,10 +432,11 @@ Vec_Int_t * Saig_AbsSolverUnsatCore( sat_solver * pSat, int nConfMax, int fVerbo
Vec_Int_t
*
vCore
;
Vec_Int_t
*
vCore
;
void
*
pSatCnf
;
void
*
pSatCnf
;
Intp_Man_t
*
pManProof
;
Intp_Man_t
*
pManProof
;
int
RetValue
,
clk
=
clock
()
;
int
RetValue
;
if
(
piRetValue
)
if
(
piRetValue
)
*
piRetValue
=
-
1
;
*
piRetValue
=
-
1
;
// solve the problem
// solve the problem
Abc_Clock
(
2
,
1
);
RetValue
=
sat_solver_solve
(
pSat
,
NULL
,
NULL
,
(
ABC_INT64_T
)
nConfMax
,
(
ABC_INT64_T
)
0
,
(
ABC_INT64_T
)
0
,
(
ABC_INT64_T
)
0
);
RetValue
=
sat_solver_solve
(
pSat
,
NULL
,
NULL
,
(
ABC_INT64_T
)
nConfMax
,
(
ABC_INT64_T
)
0
,
(
ABC_INT64_T
)
0
,
(
ABC_INT64_T
)
0
);
if
(
RetValue
==
l_Undef
)
if
(
RetValue
==
l_Undef
)
{
{
...
@@ -420,19 +453,19 @@ Vec_Int_t * Saig_AbsSolverUnsatCore( sat_solver * pSat, int nConfMax, int fVerbo
...
@@ -420,19 +453,19 @@ Vec_Int_t * Saig_AbsSolverUnsatCore( sat_solver * pSat, int nConfMax, int fVerbo
if
(
fVerbose
)
if
(
fVerbose
)
{
{
printf
(
"SAT solver returned UNSAT after %7d conflicts. "
,
pSat
->
stats
.
conflicts
);
printf
(
"SAT solver returned UNSAT after %7d conflicts. "
,
pSat
->
stats
.
conflicts
);
ABC_PRT
(
"Time"
,
clock
()
-
clk
);
ABC_PRT
(
"Time"
,
Abc_Clock
(
2
,
0
)
);
}
}
assert
(
RetValue
==
l_False
);
assert
(
RetValue
==
l_False
);
pSatCnf
=
sat_solver_store_release
(
pSat
);
pSatCnf
=
sat_solver_store_release
(
pSat
);
// derive the UNSAT core
// derive the UNSAT core
clk
=
clock
(
);
Abc_Clock
(
2
,
1
);
pManProof
=
Intp_ManAlloc
();
pManProof
=
Intp_ManAlloc
();
vCore
=
(
Vec_Int_t
*
)
Intp_ManUnsatCore
(
pManProof
,
(
Sto_Man_t
*
)
pSatCnf
,
0
);
vCore
=
(
Vec_Int_t
*
)
Intp_ManUnsatCore
(
pManProof
,
(
Sto_Man_t
*
)
pSatCnf
,
0
);
Intp_ManFree
(
pManProof
);
Intp_ManFree
(
pManProof
);
if
(
fVerbose
)
if
(
fVerbose
)
{
{
printf
(
"SAT core contains %8d clauses (out of %8d). "
,
Vec_IntSize
(
vCore
),
((
Sto_Man_t
*
)
pSatCnf
)
->
nRoots
);
printf
(
"SAT core contains %8d clauses (out of %8d). "
,
Vec_IntSize
(
vCore
),
((
Sto_Man_t
*
)
pSatCnf
)
->
nRoots
);
ABC_PRT
(
"Time"
,
clock
()
-
clk
);
ABC_PRT
(
"Time"
,
Abc_Clock
(
2
,
0
)
);
}
}
Sto_ManFree
(
(
Sto_Man_t
*
)
pSatCnf
);
Sto_ManFree
(
(
Sto_Man_t
*
)
pSatCnf
);
return
vCore
;
return
vCore
;
...
@@ -524,10 +557,10 @@ Vec_Int_t * Aig_Gla2ManTest( Aig_Man_t * pAig, int nStart, int nFramesMax, int n
...
@@ -524,10 +557,10 @@ Vec_Int_t * Aig_Gla2ManTest( Aig_Man_t * pAig, int nStart, int nFramesMax, int n
{
{
Aig_Gla2Man_t
*
p
;
Aig_Gla2Man_t
*
p
;
Vec_Int_t
*
vCore
,
*
vResult
;
Vec_Int_t
*
vCore
,
*
vResult
;
int
clk
,
clkTotal
=
clock
();
int
nTimeToStop
=
time
(
NULL
)
+
TimeLimit
;
int
nTimeToStop
=
time
(
NULL
)
+
TimeLimit
;
assert
(
Saig_ManPoNum
(
pAig
)
==
1
);
assert
(
Saig_ManPoNum
(
pAig
)
==
1
);
Abc_Clock
(
0
,
1
);
if
(
fVerbose
)
if
(
fVerbose
)
{
{
if
(
TimeLimit
)
if
(
TimeLimit
)
...
@@ -537,7 +570,7 @@ Vec_Int_t * Aig_Gla2ManTest( Aig_Man_t * pAig, int nStart, int nFramesMax, int n
...
@@ -537,7 +570,7 @@ Vec_Int_t * Aig_Gla2ManTest( Aig_Man_t * pAig, int nStart, int nFramesMax, int n
}
}
// start the solver
// start the solver
clk
=
clock
();
Abc_Clock
(
1
,
1
);
p
=
Aig_Gla2ManStart
(
pAig
,
nStart
,
nFramesMax
,
fVerbose
);
p
=
Aig_Gla2ManStart
(
pAig
,
nStart
,
nFramesMax
,
fVerbose
);
if
(
!
Aig_Gla2CreateSatSolver
(
p
)
)
if
(
!
Aig_Gla2CreateSatSolver
(
p
)
)
{
{
...
@@ -545,22 +578,22 @@ Vec_Int_t * Aig_Gla2ManTest( Aig_Man_t * pAig, int nStart, int nFramesMax, int n
...
@@ -545,22 +578,22 @@ Vec_Int_t * Aig_Gla2ManTest( Aig_Man_t * pAig, int nStart, int nFramesMax, int n
Aig_Gla2ManStop
(
p
);
Aig_Gla2ManStop
(
p
);
return
NULL
;
return
NULL
;
}
}
p
->
timePre
+=
clock
()
-
clk
;
p
->
timePre
+=
Abc_Clock
(
1
,
0
)
;
// set runtime limit
// set runtime limit
if
(
TimeLimit
)
if
(
TimeLimit
)
sat_solver_set_runtime_limit
(
p
->
pSat
,
nTimeToStop
);
sat_solver_set_runtime_limit
(
p
->
pSat
,
nTimeToStop
);
// compute UNSAT core
// compute UNSAT core
clk
=
clock
();
Abc_Clock
(
1
,
1
);
vCore
=
Saig_AbsSolverUnsatCore
(
p
->
pSat
,
nConfLimit
,
fVerbose
,
NULL
);
vCore
=
Saig_AbsSolverUnsatCore
(
p
->
pSat
,
nConfLimit
,
fVerbose
,
NULL
);
if
(
vCore
==
NULL
)
if
(
vCore
==
NULL
)
{
{
Aig_Gla2ManStop
(
p
);
Aig_Gla2ManStop
(
p
);
return
NULL
;
return
NULL
;
}
}
p
->
timeSat
+=
clock
()
-
clk
;
p
->
timeSat
+=
Abc_Clock
(
1
,
0
)
;
p
->
timeTotal
=
clock
()
-
clkTotal
;
p
->
timeTotal
=
Abc_Clock
(
0
,
0
)
;
// print stats
// print stats
if
(
fVerbose
)
if
(
fVerbose
)
...
...
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