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
5953beb2
Commit
5953beb2
authored
Sep 16, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restructured the code to post-process object used during refinement in &gla.
parent
5a4f1fe4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
313 additions
and
39 deletions
+313
-39
abclib.dsp
+0
-8
src/base/abci/abc.c
+8
-11
src/proof/abs/abs.h
+9
-0
src/proof/abs/absDup.c
+2
-2
src/proof/abs/absGla.c
+2
-8
src/proof/abs/absGlaOld.c
+1
-1
src/proof/abs/absRef.c
+0
-0
src/proof/abs/absRef.h
+68
-6
src/proof/abs/absRefJ.c
+1
-1
src/proof/abs/absRefJ.h
+1
-1
src/proof/abs/absRefSelect.c
+220
-0
src/proof/abs/module.make
+1
-1
No files found.
abclib.dsp
View file @
5953beb2
...
...
@@ -4367,14 +4367,6 @@ SOURCE=.\src\proof\abs\absRef.h
# End Source File
# Begin Source File
SOURCE=.\src\proof\abs\absRef2.c
# End Source File
# Begin Source File
SOURCE=.\src\proof\abs\absRef2.h
# End Source File
# Begin Source File
SOURCE=.\src\proof\abs\absUtil.c
# End Source File
# Begin Source File
...
...
src/base/abci/abc.c
View file @
5953beb2
...
...
@@ -28143,10 +28143,10 @@ usage:
int
Abc_CommandAbc9Gla
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
Abs_Par_t
Pars
,
*
pPars
=
&
Pars
;
int
c
,
f
StartVta
=
0
,
f
NewAlgo
=
1
;
int
c
,
fNewAlgo
=
1
;
Abs_ParSetDefaults
(
pPars
);
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"FSCLDETRPBAt
rfka
dmnscbpqwvh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"FSCLDETRPBAt
far
dmnscbpqwvh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -28272,18 +28272,15 @@ int Abc_CommandAbc9Gla( Abc_Frame_t * pAbc, int argc, char ** argv )
case
't'
:
pPars
->
fUseTermVars
^=
1
;
break
;
case
'r'
:
pPars
->
fUseRollback
^=
1
;
break
;
case
'f'
:
pPars
->
fPropFanout
^=
1
;
break
;
case
'k'
:
fStartVta
^=
1
;
break
;
case
'a'
:
pPars
->
fAddLayer
^=
1
;
break
;
case
'r'
:
pPars
->
fNewRefine
^=
1
;
break
;
case
'd'
:
pPars
->
fDumpVabs
^=
1
;
break
;
...
...
@@ -28350,13 +28347,13 @@ int Abc_CommandAbc9Gla( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
fNewAlgo
)
pAbc
->
Status
=
Gia_ManPerformGla
(
pAbc
->
pGia
,
pPars
);
else
pAbc
->
Status
=
Gia_ManPerformGlaOld
(
pAbc
->
pGia
,
pPars
,
fStartVta
);
pAbc
->
Status
=
Gia_ManPerformGlaOld
(
pAbc
->
pGia
,
pPars
,
0
);
pAbc
->
nFrames
=
pPars
->
iFrame
;
Abc_FrameReplaceCex
(
pAbc
,
&
pAbc
->
pGia
->
pCexSeq
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: &gla [-FSCLDETRPB num] [-A file] [-f
ka
dmnscbpqwvh]
\n
"
);
Abc_Print
(
-
2
,
"usage: &gla [-FSCLDETRPB num] [-A file] [-f
ar
dmnscbpqwvh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
fixed-time-frame gate-level proof- and cex-based abstraction
\n
"
);
Abc_Print
(
-
2
,
"
\t
-F num : the max number of timeframes to unroll [default = %d]
\n
"
,
pPars
->
nFramesMax
);
Abc_Print
(
-
2
,
"
\t
-S num : the starting time frame (0=unused) [default = %d]
\n
"
,
pPars
->
nFramesStart
);
...
...
@@ -28370,8 +28367,8 @@ usage:
Abc_Print
(
-
2
,
"
\t
-B num : the number of stable frames to dump abstraction or call prover (0<=num<=100) [default = %d]
\n
"
,
pPars
->
nFramesNoChangeLim
);
Abc_Print
(
-
2
,
"
\t
-A file : file name for dumping abstrated model [default =
\"
glabs.aig
\"
]
\n
"
);
Abc_Print
(
-
2
,
"
\t
-f : toggle propagating fanout implications [default = %s]
\n
"
,
pPars
->
fPropFanout
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-k : toggle using VTA to kick start GLA for starting frames [default = %s]
\n
"
,
fStartVta
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-a : toggle refinement by adding one layers of gates [default = %s]
\n
"
,
pPars
->
fAddLayer
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-r : toggle using improved refinement heuristics [default = %s]
\n
"
,
pPars
->
fNewRefine
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-d : toggle dumping abstracted model into a file [default = %s]
\n
"
,
pPars
->
fDumpVabs
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-m : toggle dumping abstraction map into a file [default = %s]
\n
"
,
pPars
->
fDumpMabs
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-n : toggle using new algorithms [default = %s]
\n
"
,
fNewAlgo
?
"yes"
:
"no"
);
...
...
src/proof/abs/abs.h
View file @
5953beb2
...
...
@@ -61,6 +61,7 @@ struct Abs_Par_t_
int
fUseRollback
;
// use rollback to the starting number of frames
int
fPropFanout
;
// propagate fanout implications
int
fAddLayer
;
// refinement strategy by adding layers
int
fNewRefine
;
// uses new refinement heuristics
int
fUseSkip
;
// skip proving intermediate timeframes
int
fUseSimple
;
// use simple CNF construction
int
fSkipHash
;
// skip hashing CNF while unrolling
...
...
@@ -81,6 +82,13 @@ struct Abs_Par_t_
/// MACRO DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
static
inline
int
Ga2_ObjOffset
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Vec_IntEntry
(
p
->
vMapping
,
Gia_ObjId
(
p
,
pObj
));
}
static
inline
int
Ga2_ObjLeaveNum
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Vec_IntEntry
(
p
->
vMapping
,
Ga2_ObjOffset
(
p
,
pObj
));
}
static
inline
int
*
Ga2_ObjLeavePtr
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Vec_IntEntryP
(
p
->
vMapping
,
Ga2_ObjOffset
(
p
,
pObj
)
+
1
);
}
static
inline
unsigned
Ga2_ObjTruth
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
(
unsigned
)
Vec_IntEntry
(
p
->
vMapping
,
Ga2_ObjOffset
(
p
,
pObj
)
+
Ga2_ObjLeaveNum
(
p
,
pObj
)
+
1
);
}
static
inline
int
Ga2_ObjRefNum
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
(
unsigned
)
Vec_IntEntry
(
p
->
vMapping
,
Ga2_ObjOffset
(
p
,
pObj
)
+
Ga2_ObjLeaveNum
(
p
,
pObj
)
+
2
);
}
static
inline
Vec_Int_t
*
Ga2_ObjLeaves
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
static
Vec_Int_t
v
;
v
.
nSize
=
Ga2_ObjLeaveNum
(
p
,
pObj
),
v
.
pArray
=
Ga2_ObjLeavePtr
(
p
,
pObj
);
return
&
v
;
}
////////////////////////////////////////////////////////////////////////
/// FUNCTION DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
...
...
@@ -114,6 +122,7 @@ extern Vec_Int_t * Gia_GlaConvertToFla( Gia_Man_t * p, Vec_Int_t * vGla );
extern
int
Gia_GlaCountFlops
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vGla
);
extern
int
Gia_GlaCountNodes
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vGla
);
/*=== absOldCex.c ==========================================================*/
extern
Vec_Int_t
*
Saig_ManCbaFilterFlops
(
Aig_Man_t
*
pAig
,
Abc_Cex_t
*
pAbsCex
,
Vec_Int_t
*
vFlopClasses
,
Vec_Int_t
*
vAbsFfsToAdd
,
int
nFfsToSelect
);
extern
Abc_Cex_t
*
Saig_ManCbaFindCexCareBits
(
Aig_Man_t
*
pAig
,
Abc_Cex_t
*
pCex
,
int
nInputs
,
int
fVerbose
);
...
...
src/proof/abs/absDup.c
View file @
5953beb2
...
...
@@ -53,7 +53,7 @@ void Gia_ManDupAbsFlops_rec( Gia_Man_t * pNew, Gia_Obj_t * pObj )
/**Function*************************************************************
Synopsis [
Performs abstraction of the AIG to preserve the included flops
.]
Synopsis [
Extractes a flop-level abstraction given a flop map
.]
Description []
...
...
@@ -207,7 +207,7 @@ void Gia_ManDupAbsGates_rec( Gia_Man_t * pNew, Gia_Obj_t * pObj )
/**Function*************************************************************
Synopsis [
Performs abstraction of the AIG to preserve the included gates
.]
Synopsis [
Extractes a gate-level abstraction given a gate map
.]
Description [The array contains 1 for those objects (const, RO, AND)
that are included in the abstraction; 0, otherwise.]
...
...
src/proof/abs/absGla.c
View file @
5953beb2
...
...
@@ -78,13 +78,6 @@ struct Ga2_Man_t_
clock_t
timeOther
;
};
static
inline
int
Ga2_ObjOffset
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Vec_IntEntry
(
p
->
vMapping
,
Gia_ObjId
(
p
,
pObj
));
}
static
inline
int
Ga2_ObjLeaveNum
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Vec_IntEntry
(
p
->
vMapping
,
Ga2_ObjOffset
(
p
,
pObj
));
}
static
inline
int
*
Ga2_ObjLeavePtr
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Vec_IntEntryP
(
p
->
vMapping
,
Ga2_ObjOffset
(
p
,
pObj
)
+
1
);
}
static
inline
unsigned
Ga2_ObjTruth
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
(
unsigned
)
Vec_IntEntry
(
p
->
vMapping
,
Ga2_ObjOffset
(
p
,
pObj
)
+
Ga2_ObjLeaveNum
(
p
,
pObj
)
+
1
);
}
static
inline
int
Ga2_ObjRefNum
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
(
unsigned
)
Vec_IntEntry
(
p
->
vMapping
,
Ga2_ObjOffset
(
p
,
pObj
)
+
Ga2_ObjLeaveNum
(
p
,
pObj
)
+
2
);
}
static
inline
Vec_Int_t
*
Ga2_ObjLeaves
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
static
Vec_Int_t
v
;
v
.
nSize
=
Ga2_ObjLeaveNum
(
p
,
pObj
),
v
.
pArray
=
Ga2_ObjLeavePtr
(
p
,
pObj
);
return
&
v
;
}
static
inline
int
Ga2_ObjId
(
Ga2_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Vec_IntEntry
(
p
->
vIds
,
Gia_ObjId
(
p
->
pGia
,
pObj
));
}
static
inline
void
Ga2_ObjSetId
(
Ga2_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
int
i
)
{
Vec_IntWriteEntry
(
p
->
vIds
,
Gia_ObjId
(
p
->
pGia
,
pObj
),
i
);
}
...
...
@@ -1329,7 +1322,7 @@ Vec_Int_t * Ga2_ManRefine( Ga2_Man_t * p )
}
Ga2_GlaPrepareCexAndMap
(
p
,
&
pCex
,
&
vMap
);
// Rf2_ManRefine( p->pRf2, pCex, vMap, p->pPars->fPropFanout, 1 );
vVec
=
Rnm_ManRefine
(
p
->
pRnm
,
pCex
,
vMap
,
p
->
pPars
->
fPropFanout
,
1
,
1
);
vVec
=
Rnm_ManRefine
(
p
->
pRnm
,
pCex
,
vMap
,
p
->
pPars
->
fPropFanout
,
p
->
pPars
->
fNewRefine
,
1
);
// printf( "Refinement %d\n", Vec_IntSize(vVec) );
Abc_CexFree
(
pCex
);
if
(
Vec_IntSize
(
vVec
)
==
0
)
...
...
@@ -1644,6 +1637,7 @@ int Gia_ManPerformGla( Gia_Man_t * pAig, Abs_Par_t * pPars )
// perform refinement
clk2
=
clock
();
Rnm_ManSetRefId
(
p
->
pRnm
,
c
);
vPPis
=
Ga2_ManRefine
(
p
);
p
->
timeCex
+=
clock
()
-
clk2
;
if
(
vPPis
==
NULL
)
...
...
src/proof/abs/absGlaOld.c
View file @
5953beb2
...
...
@@ -503,7 +503,7 @@ Vec_Int_t * Gla_ManRefinement( Gla_Man_t * p )
Gia_Obj_t
*
pObj
;
int
i
;
Gia_GlaPrepareCexAndMap
(
p
,
&
pCex
,
&
vMap
);
vVec
=
Rnm_ManRefine
(
p
->
pRnm
,
pCex
,
vMap
,
p
->
pPars
->
fPropFanout
,
0
,
1
);
vVec
=
Rnm_ManRefine
(
p
->
pRnm
,
pCex
,
vMap
,
p
->
pPars
->
fPropFanout
,
p
->
pPars
->
fNewRefine
,
1
);
Abc_CexFree
(
pCex
);
if
(
Vec_IntSize
(
vVec
)
==
0
)
{
...
...
src/proof/abs/absRef.c
View file @
5953beb2
This diff is collapsed.
Click to expand it.
src/proof/abs/absRef.h
View file @
5953beb2
...
...
@@ -37,28 +37,90 @@ ABC_NAMESPACE_HEADER_START
/// BASIC TYPES ///
////////////////////////////////////////////////////////////////////////
typedef
struct
Rnm_Man_t_
Rnm_Man_t
;
// refinement manager
////////////////////////////////////////////////////////////////////////
/// MACRO DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
typedef
struct
Rnm_Obj_t_
Rnm_Obj_t
;
// refinement object
struct
Rnm_Obj_t_
{
unsigned
Value
:
1
;
// binary value
unsigned
fVisit
:
1
;
// visited object
unsigned
fVisitJ
:
1
;
// justified visited object
unsigned
fPPi
:
1
;
// PPI object
unsigned
Prio
:
24
;
// priority (0 - highest)
};
typedef
struct
Rnm_Man_t_
Rnm_Man_t
;
// refinement manager
struct
Rnm_Man_t_
{
// user data
Gia_Man_t
*
pGia
;
// working AIG manager (it is completely owned by this package)
Abc_Cex_t
*
pCex
;
// counter-example
Vec_Int_t
*
vMap
;
// mapping of CEX inputs into objects (PI + PPI, in any order)
int
fPropFanout
;
// propagate fanouts
int
fVerbose
;
// verbose flag
int
nRefId
;
// refinement ID
// traversing data
Vec_Int_t
*
vObjs
;
// internal objects used in value propagation
// filtering of selected objects
Vec_Str_t
*
vCounts
;
// fanin counters
Vec_Int_t
*
vFanins
;
// fanins
/*
// SAT solver
sat_solver2 * pSat; // incremental SAT solver
Vec_Int_t * vSatVars; // SAT variables
Vec_Int_t * vSat2Ids; // mapping of SAT variables into object IDs
Vec_Int_t * vIsopMem; // memory for ISOP computation
*/
// internal data
Rnm_Obj_t
*
pObjs
;
// refinement objects
int
nObjs
;
// the number of used objects
int
nObjsAlloc
;
// the number of allocated objects
int
nObjsFrame
;
// the number of used objects in each frame
int
nCalls
;
// total number of calls
int
nRefines
;
// total refined objects
int
nVisited
;
// visited during justification
// statistics
clock_t
timeFwd
;
// forward propagation
clock_t
timeBwd
;
// backward propagation
clock_t
timeVer
;
// ternary simulation
clock_t
timeTotal
;
// other time
};
// accessing the refinement object
static
inline
Rnm_Obj_t
*
Rnm_ManObj
(
Rnm_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
int
f
)
{
assert
(
Gia_ObjIsConst0
(
pObj
)
||
pObj
->
Value
);
assert
(
(
int
)
pObj
->
Value
<
p
->
nObjsFrame
);
assert
(
f
>=
0
&&
f
<=
p
->
pCex
->
iFrame
);
return
p
->
pObjs
+
f
*
p
->
nObjsFrame
+
pObj
->
Value
;
}
static
inline
void
Rnm_ManSetRefId
(
Rnm_Man_t
*
p
,
int
RefId
)
{
p
->
nRefId
=
RefId
;
}
static
inline
int
Rnm_ObjCount
(
Rnm_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Vec_StrEntry
(
p
->
vCounts
,
Gia_ObjId
(
p
->
pGia
,
pObj
)
);
}
static
inline
void
Rnm_ObjSetCount
(
Rnm_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
int
c
)
{
Vec_StrWriteEntry
(
p
->
vCounts
,
Gia_ObjId
(
p
->
pGia
,
pObj
),
(
char
)
c
);
}
static
inline
int
Rnm_ObjAddToCount
(
Rnm_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
int
c
=
Rnm_ObjCount
(
p
,
pObj
);
if
(
c
<
16
)
Rnm_ObjSetCount
(
p
,
pObj
,
c
+
1
);
return
c
;
}
static
inline
int
Rnm_ObjIsJust
(
Rnm_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Gia_ObjIsConst0
(
pObj
)
||
(
pObj
->
Value
&&
Rnm_ManObj
(
p
,
pObj
,
0
)
->
fVisitJ
);
}
////////////////////////////////////////////////////////////////////////
/// FUNCTION DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
/*===
giaA
bsRef.c ===========================================================*/
/*===
a
bsRef.c ===========================================================*/
extern
Rnm_Man_t
*
Rnm_ManStart
(
Gia_Man_t
*
pGia
);
extern
void
Rnm_ManStop
(
Rnm_Man_t
*
p
,
int
fProfile
);
extern
double
Rnm_ManMemoryUsage
(
Rnm_Man_t
*
p
);
extern
Vec_Int_t
*
Rnm_ManRefine
(
Rnm_Man_t
*
p
,
Abc_Cex_t
*
pCex
,
Vec_Int_t
*
vMap
,
int
fPropFanout
,
int
fPostProcess
,
int
fVerbose
);
extern
Vec_Int_t
*
Rnm_ManRefine
(
Rnm_Man_t
*
p
,
Abc_Cex_t
*
pCex
,
Vec_Int_t
*
vMap
,
int
fPropFanout
,
int
fNewRefinement
,
int
fVerbose
);
/*=== absRefSelected.c ===========================================================*/
extern
Vec_Int_t
*
Rnm_ManFilterSelected
(
Rnm_Man_t
*
p
,
Vec_Int_t
*
vOldPPis
);
extern
Vec_Int_t
*
Rnm_ManFilterSelectedNew
(
Rnm_Man_t
*
p
,
Vec_Int_t
*
vOldPPis
);
ABC_NAMESPACE_HEADER_END
#endif
////////////////////////////////////////////////////////////////////////
...
...
src/proof/abs/absRef
2
.c
→
src/proof/abs/absRef
J
.c
View file @
5953beb2
...
...
@@ -6,7 +6,7 @@
PackageName [Abstraction package.]
Synopsis [Refinement manager.]
Synopsis [Refinement manager
to compute all justifying subsets
.]
Author [Alan Mishchenko]
...
...
src/proof/abs/absRef
2
.h
→
src/proof/abs/absRef
J
.h
View file @
5953beb2
...
...
@@ -6,7 +6,7 @@
PackageName [Abstraction package.]
Synopsis [Refinement manager.]
Synopsis [Refinement manager
to compute all justifying subsets
.]
Author [Alan Mishchenko]
...
...
src/proof/abs/absRefSelect.c
0 → 100644
View file @
5953beb2
/**CFile****************************************************************
FileName [absRefSelect.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Abstraction package.]
Synopsis [Post-processes the set of selected refinement objects.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - June 20, 2005.]
Revision [$Id: absRefSelect.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
***********************************************************************/
#include "abs.h"
#include "absRef.h"
ABC_NAMESPACE_IMPL_START
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Rnm_ManPrintSelected
(
Rnm_Man_t
*
p
,
Vec_Int_t
*
vNewPPis
)
{
Gia_Obj_t
*
pObj
;
int
i
,
Counter
=
0
;
Gia_ManForEachObjVec
(
p
->
vMap
,
p
->
pGia
,
pObj
,
i
)
if
(
Gia_ObjIsPi
(
p
->
pGia
,
pObj
)
)
printf
(
"-"
);
else
if
(
Vec_IntFind
(
vNewPPis
,
Gia_ObjId
(
p
->
pGia
,
pObj
))
>=
0
)
// this is PPI
printf
(
"1"
),
Counter
++
;
else
printf
(
"0"
);
printf
(
" %3d
\n
"
,
Counter
);
}
/**Function*************************************************************
Synopsis [Perform structural analysis.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Ga2_StructAnalize
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vFront
,
Vec_Int_t
*
vInter
,
Vec_Int_t
*
vNewPPis
)
{
Vec_Int_t
*
vLeaves
;
Gia_Obj_t
*
pObj
,
*
pFanin
;
int
i
,
k
;
// clean labels
Gia_ManForEachObj
(
p
,
pObj
,
i
)
pObj
->
fMark0
=
pObj
->
fMark1
=
0
;
// label frontier
Gia_ManForEachObjVec
(
vFront
,
p
,
pObj
,
i
)
pObj
->
fMark0
=
1
,
pObj
->
fMark1
=
0
;
// label objects
Gia_ManForEachObjVec
(
vInter
,
p
,
pObj
,
i
)
pObj
->
fMark1
=
0
,
pObj
->
fMark1
=
1
;
// label selected
Gia_ManForEachObjVec
(
vNewPPis
,
p
,
pObj
,
i
)
pObj
->
fMark1
=
1
,
pObj
->
fMark1
=
1
;
// explore selected
Gia_ManForEachObjVec
(
vNewPPis
,
p
,
pObj
,
i
)
{
printf
(
"Selected PPI %3d : "
,
i
+
1
);
printf
(
"%6d "
,
Gia_ObjId
(
p
,
pObj
)
);
printf
(
"
\n
"
);
vLeaves
=
Ga2_ObjLeaves
(
p
,
pObj
);
Gia_ManForEachObjVec
(
vLeaves
,
p
,
pFanin
,
k
)
{
printf
(
" "
);
printf
(
"%6d "
,
Gia_ObjId
(
p
,
pFanin
)
);
if
(
pFanin
->
fMark0
&&
pFanin
->
fMark1
)
printf
(
"selected PPI"
);
else
if
(
pFanin
->
fMark0
&&
!
pFanin
->
fMark1
)
printf
(
"frontier (original PI or PPI)"
);
else
if
(
!
pFanin
->
fMark0
&&
pFanin
->
fMark1
)
printf
(
"abstracted node"
);
else
if
(
!
pFanin
->
fMark0
&&
!
pFanin
->
fMark1
)
printf
(
"free variable"
);
printf
(
"
\n
"
);
}
}
}
/**Function*************************************************************
Synopsis [Postprocessing the set of PPIs using structural analysis.]
Description [The following sets are used:
The set of all PI+PPI is in p->vMap.
The set of all abstracted objects is in p->vObjs;
The set of important PPIs is in vOldPPis.
The new set of selected PPIs is in vNewPPis.]
SideEffects []
SeeAlso []
***********************************************************************/
Vec_Int_t
*
Rnm_ManFilterSelected
(
Rnm_Man_t
*
p
,
Vec_Int_t
*
vOldPPis
)
{
int
fVerbose
=
0
;
Vec_Int_t
*
vNewPPis
,
*
vLeaves
;
Gia_Obj_t
*
pObj
,
*
pFanin
;
int
i
,
k
,
RetValue
,
Counters
[
3
]
=
{
0
};
// (0) make sure fanin counters are 0 at the beginning
// Gia_ManForEachObj( p->pGia, pObj, i )
// assert( Rnm_ObjCount(p, pObj) == 0 );
// (1) increment PPI fanin counters
Vec_IntClear
(
p
->
vFanins
);
Gia_ManForEachObjVec
(
vOldPPis
,
p
->
pGia
,
pObj
,
i
)
{
vLeaves
=
Ga2_ObjLeaves
(
p
->
pGia
,
pObj
);
Gia_ManForEachObjVec
(
vLeaves
,
p
->
pGia
,
pFanin
,
k
)
if
(
Rnm_ObjAddToCount
(
p
,
pFanin
)
==
0
)
// fanin counter is 0 -- save it
Vec_IntPush
(
p
->
vFanins
,
Gia_ObjId
(
p
->
pGia
,
pFanin
)
);
}
// (3) select objects with reconvergence, which create potential constraints
// - flop objects
// - objects whose fanin belongs to the justified area
// - objects whose fanins overlap
// (these do not guantee reconvergence, but may potentially have it)
// (other objects cannot have reconvergence, even if they are added)
vNewPPis
=
Vec_IntAlloc
(
100
);
Gia_ManForEachObjVec
(
vOldPPis
,
p
->
pGia
,
pObj
,
i
)
{
if
(
Gia_ObjIsRo
(
p
->
pGia
,
pObj
)
)
{
if
(
fVerbose
)
Counters
[
0
]
++
;
Vec_IntPush
(
vNewPPis
,
Gia_ObjId
(
p
->
pGia
,
pObj
)
);
continue
;
}
vLeaves
=
Ga2_ObjLeaves
(
p
->
pGia
,
pObj
);
Gia_ManForEachObjVec
(
vLeaves
,
p
->
pGia
,
pFanin
,
k
)
{
if
(
Rnm_ObjIsJust
(
p
,
pFanin
)
||
Rnm_ObjCount
(
p
,
pFanin
)
>
1
)
{
if
(
fVerbose
)
Counters
[
1
]
+=
Rnm_ObjIsJust
(
p
,
pFanin
);
if
(
fVerbose
)
Counters
[
2
]
+=
(
Rnm_ObjCount
(
p
,
pFanin
)
>
1
);
Vec_IntPush
(
vNewPPis
,
Gia_ObjId
(
p
->
pGia
,
pObj
)
);
break
;
}
}
}
RetValue
=
Vec_IntUniqify
(
vNewPPis
);
assert
(
RetValue
==
0
);
// (4) clear fanin counters
// this is important for counters to be correctly set in the future iterations -- see step (0)
Gia_ManForEachObjVec
(
p
->
vFanins
,
p
->
pGia
,
pObj
,
i
)
Rnm_ObjSetCount
(
p
,
pObj
,
0
);
// visualize
if
(
fVerbose
)
printf
(
"*** Refinement %3d : PI+PPI =%4d. Old =%4d. New =%4d. FF =%4d. Just =%4d. Shared =%4d.
\n
"
,
p
->
nRefId
,
Vec_IntSize
(
p
->
vMap
),
Vec_IntSize
(
vOldPPis
),
Vec_IntSize
(
vNewPPis
),
Counters
[
0
],
Counters
[
1
],
Counters
[
2
]
);
// Rnm_ManPrintSelected( p, vNewPPis );
// Ga2_StructAnalize( p->pGia, p->vMap, p->vObjs, vNewPPis );
return
vNewPPis
;
}
/**Function*************************************************************
Synopsis [Improved postprocessing the set of PPIs.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Vec_Int_t
*
Rnm_ManFilterSelectedNew
(
Rnm_Man_t
*
p
,
Vec_Int_t
*
vOldPPis
)
{
Vec_Int_t
*
vNewPPis
;
vNewPPis
=
Vec_IntDup
(
vOldPPis
);
return
vNewPPis
;
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_IMPL_END
src/proof/abs/module.make
View file @
5953beb2
...
...
@@ -10,6 +10,6 @@ SRC += src/proof/abs/abs.c \
src/proof/abs/absOut.c
\
src/proof/abs/absPth.c
\
src/proof/abs/absRef.c
\
src/proof/abs/absRef
2
.c
\
src/proof/abs/absRef
Select
.c
\
src/proof/abs/absVta.c
\
src/proof/abs/absUtil.c
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