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
03f772d5
Commit
03f772d5
authored
Jan 08, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backward reachability using circuit cofactoring.
parent
d1450e77
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
5 deletions
+31
-5
src/aig/gia/giaCCof.c
+31
-5
No files found.
src/aig/gia/giaCCof.c
View file @
03f772d5
...
@@ -130,6 +130,7 @@ void Gia_ManCofExtendSolver( Ccf_Man_t * p )
...
@@ -130,6 +130,7 @@ void Gia_ManCofExtendSolver( Ccf_Man_t * p )
Gia_ObjFaninC0
(
pObj
),
Gia_ObjFaninC0
(
pObj
),
Gia_ObjFaninC1
(
pObj
)
);
Gia_ObjFaninC1
(
pObj
)
);
}
}
sat_solver_setnvars
(
p
->
pSat
,
Gia_ManObjNum
(
p
->
pFrames
)
);
}
}
static
inline
int
Gia_Obj0Copy
(
Vec_Int_t
*
vCopies
,
int
Fan0
,
int
fCompl0
)
static
inline
int
Gia_Obj0Copy
(
Vec_Int_t
*
vCopies
,
int
Fan0
,
int
fCompl0
)
...
@@ -262,15 +263,22 @@ int Gia_ManCofGetReachable( Ccf_Man_t * p, int Lit )
...
@@ -262,15 +263,22 @@ int Gia_ManCofGetReachable( Ccf_Man_t * p, int Lit )
***********************************************************************/
***********************************************************************/
Gia_Man_t
*
Gia_ManCofTest
(
Gia_Man_t
*
pGia
,
int
nFrameMax
,
int
nConfMax
,
int
nTimeMax
,
int
fVerbose
)
Gia_Man_t
*
Gia_ManCofTest
(
Gia_Man_t
*
pGia
,
int
nFrameMax
,
int
nConfMax
,
int
nTimeMax
,
int
fVerbose
)
{
{
Gia_Man_t
*
pNew
;
Gia_Man_t
*
pNew
;
Ccf_Man_t
*
p
;
Ccf_Man_t
*
p
;
int
f
,
Lit
,
RetValue
;
Gia_Obj_t
*
pObj
;
int
f
,
i
,
Lit
,
RetValue
,
fFailed
=
0
;
int
nTimeToStop
=
time
(
NULL
)
+
nTimeMax
;
int
clk
=
clock
();
int
clk
=
clock
();
assert
(
Gia_ManPoNum
(
pGia
)
==
1
);
assert
(
Gia_ManPoNum
(
pGia
)
==
1
);
// create reachability manager
// create reachability manager
p
=
Ccf_ManStart
(
pGia
,
nFrameMax
,
nConfMax
,
nTimeMax
,
fVerbose
);
p
=
Ccf_ManStart
(
pGia
,
nFrameMax
,
nConfMax
,
nTimeMax
,
fVerbose
);
// set runtime limit
if
(
nTimeMax
)
sat_solver_set_runtime_limit
(
p
->
pSat
,
nTimeToStop
);
// perform backward image computation
// perform backward image computation
for
(
f
=
0
;
f
<
nFrameMax
;
f
++
)
for
(
f
=
0
;
f
<
nFrameMax
;
f
++
)
{
{
...
@@ -286,9 +294,24 @@ Gia_Man_t * Gia_ManCofTest( Gia_Man_t * pGia, int nFrameMax, int nConfMax, int n
...
@@ -286,9 +294,24 @@ Gia_Man_t * Gia_ManCofTest( Gia_Man_t * pGia, int nFrameMax, int nConfMax, int n
RetValue
=
Gia_ManCofGetReachable
(
p
,
Lit
);
RetValue
=
Gia_ManCofGetReachable
(
p
,
Lit
);
if
(
RetValue
)
if
(
RetValue
)
break
;
break
;
// check the property output
Gia_ManSetPhase
(
p
->
pFrames
);
Gia_ManForEachPo
(
p
->
pFrames
,
pObj
,
i
)
if
(
pObj
->
fPhase
)
{
printf
(
"Property failed in frame %d.
\n
"
,
f
);
fFailed
=
1
;
break
;
}
if
(
i
<
Gia_ManPoNum
(
p
->
pFrames
)
)
break
;
}
}
// report the result
// report the result
if
(
f
==
nFrameMax
)
if
(
nTimeToStop
&&
time
(
NULL
)
>
nTimeToStop
)
printf
(
"Runtime limit (%d sec) is reached after %d frames. "
,
nTimeMax
,
f
);
else
if
(
f
==
nFrameMax
)
printf
(
"Completed %d frames without converging. "
,
f
);
printf
(
"Completed %d frames without converging. "
,
f
);
else
if
(
RetValue
==
1
)
else
if
(
RetValue
==
1
)
printf
(
"Backward reachability converged after %d iterations. "
,
f
-
1
);
printf
(
"Backward reachability converged after %d iterations. "
,
f
-
1
);
...
@@ -296,6 +319,11 @@ Gia_Man_t * Gia_ManCofTest( Gia_Man_t * pGia, int nFrameMax, int nConfMax, int n
...
@@ -296,6 +319,11 @@ Gia_Man_t * Gia_ManCofTest( Gia_Man_t * pGia, int nFrameMax, int nConfMax, int n
printf
(
"Conflict limit or timeout is reached after %d frames. "
,
f
-
1
);
printf
(
"Conflict limit or timeout is reached after %d frames. "
,
f
-
1
);
Abc_PrintTime
(
1
,
"Runtime"
,
clock
()
-
clk
);
Abc_PrintTime
(
1
,
"Runtime"
,
clock
()
-
clk
);
if
(
!
fFailed
&&
RetValue
==
1
)
printf
(
"Property holds.
\n
"
);
else
if
(
!
fFailed
)
printf
(
"Property is undecided.
\n
"
);
// get the resulting AIG manager
// get the resulting AIG manager
Gia_ManHashStop
(
p
->
pFrames
);
Gia_ManHashStop
(
p
->
pFrames
);
pNew
=
p
->
pFrames
;
p
->
pFrames
=
NULL
;
pNew
=
p
->
pFrames
;
p
->
pFrames
=
NULL
;
...
@@ -304,10 +332,8 @@ Gia_Man_t * Gia_ManCofTest( Gia_Man_t * pGia, int nFrameMax, int nConfMax, int n
...
@@ -304,10 +332,8 @@ Gia_Man_t * Gia_ManCofTest( Gia_Man_t * pGia, int nFrameMax, int nConfMax, int n
// cleanup
// cleanup
// if ( fVerbose )
// if ( fVerbose )
// Gia_ManPrintStats( pNew, 0 );
// Gia_ManPrintStats( pNew, 0 );
pNew
=
Gia_ManCleanup
(
pGia
=
pNew
);
pNew
=
Gia_ManCleanup
(
pGia
=
pNew
);
Gia_ManStop
(
pGia
);
Gia_ManStop
(
pGia
);
// if ( fVerbose )
// if ( fVerbose )
// Gia_ManPrintStats( pNew, 0 );
// Gia_ManPrintStats( pNew, 0 );
return
pNew
;
return
pNew
;
...
...
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