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
255f171f
Commit
255f171f
authored
Sep 23, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improving computation of choices from equivalence classes.
parent
40d9b585
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
41 additions
and
150 deletions
+41
-150
abclib.dsp
+4
-0
src/aig/gia/gia.h
+7
-5
src/aig/gia/giaAig.c
+22
-13
src/aig/gia/giaAig.h
+1
-0
src/aig/gia/giaChoice.c
+0
-0
src/aig/gia/giaEquiv.c
+0
-83
src/aig/gia/giaUtil.c
+0
-49
src/aig/gia/module.make
+1
-0
src/proof/dch/dchCore.c
+6
-0
No files found.
abclib.dsp
View file @
255f171f
...
...
@@ -3411,6 +3411,10 @@ SOURCE=.\src\aig\gia\giaCexMin.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaChoice.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaCof.c
# End Source File
# Begin Source File
...
...
src/aig/gia/gia.h
View file @
255f171f
...
...
@@ -271,6 +271,7 @@ static inline Gia_Obj_t * Gia_Not( Gia_Obj_t * p ) { return (Gia_Obj
static
inline
Gia_Obj_t
*
Gia_NotCond
(
Gia_Obj_t
*
p
,
int
c
)
{
return
(
Gia_Obj_t
*
)((
ABC_PTRUINT_T
)(
p
)
^
(
c
));
}
static
inline
int
Gia_IsComplement
(
Gia_Obj_t
*
p
)
{
return
(
int
)((
ABC_PTRUINT_T
)(
p
)
&
01
);
}
static
inline
char
*
Gia_ManName
(
Gia_Man_t
*
p
)
{
return
p
->
pName
;
}
static
inline
int
Gia_ManCiNum
(
Gia_Man_t
*
p
)
{
return
Vec_IntSize
(
p
->
vCis
);
}
static
inline
int
Gia_ManCoNum
(
Gia_Man_t
*
p
)
{
return
Vec_IntSize
(
p
->
vCos
);
}
static
inline
int
Gia_ManPiNum
(
Gia_Man_t
*
p
)
{
return
Vec_IntSize
(
p
->
vCis
)
-
p
->
nRegs
;
}
...
...
@@ -356,9 +357,10 @@ static inline Gia_Obj_t * Gia_ObjFromLit( Gia_Man_t * p, int iLit ) {
static
inline
int
Gia_ObjToLit
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Abc_Var2Lit
(
Gia_ObjId
(
p
,
Gia_Regular
(
pObj
)),
Gia_IsComplement
(
pObj
)
);
}
static
inline
int
Gia_ObjPhaseRealLit
(
Gia_Man_t
*
p
,
int
iLit
)
{
return
Gia_ObjPhaseReal
(
Gia_ObjFromLit
(
p
,
iLit
)
);
}
static
inline
int
Gia_ObjLevel
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Vec_IntGetEntry
(
p
->
vLevels
,
Gia_ObjId
(
p
,
pObj
));
}
static
inline
int
Gia_ObjLevelId
(
Gia_Man_t
*
p
,
int
Id
)
{
return
Vec_IntGetEntry
(
p
->
vLevels
,
Id
);
}
static
inline
void
Gia_ObjSetLevel
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
int
l
)
{
Vec_IntSetEntry
(
p
->
vLevels
,
Gia_ObjId
(
p
,
pObj
),
l
);
}
static
inline
int
Gia_ObjLevel
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Gia_ObjLevelId
(
p
,
Gia_ObjId
(
p
,
pObj
)
);
}
static
inline
void
Gia_ObjSetLevelId
(
Gia_Man_t
*
p
,
int
Id
,
int
l
)
{
Vec_IntSetEntry
(
p
->
vLevels
,
Id
,
l
);
}
static
inline
void
Gia_ObjSetLevel
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
int
l
)
{
Gia_ObjSetLevelId
(
p
,
Gia_ObjId
(
p
,
pObj
),
l
);
}
static
inline
void
Gia_ObjSetCoLevel
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
assert
(
Gia_ObjIsCo
(
pObj
)
);
Gia_ObjSetLevel
(
p
,
pObj
,
Gia_ObjLevel
(
p
,
Gia_ObjFanin0
(
pObj
))
);
}
static
inline
void
Gia_ObjSetAndLevel
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
assert
(
Gia_ObjIsAnd
(
pObj
)
);
Gia_ObjSetLevel
(
p
,
pObj
,
1
+
Abc_MaxInt
(
Gia_ObjLevel
(
p
,
Gia_ObjFanin0
(
pObj
)),
Gia_ObjLevel
(
p
,
Gia_ObjFanin1
(
pObj
)))
);
}
...
...
@@ -596,7 +598,6 @@ static inline int Gia_ObjNext( Gia_Man_t * p, int Id ) { r
static
inline
void
Gia_ObjSetNext
(
Gia_Man_t
*
p
,
int
Id
,
int
Num
)
{
p
->
pNexts
[
Id
]
=
Num
;
}
static
inline
int
Gia_ObjIsConst
(
Gia_Man_t
*
p
,
int
Id
)
{
return
Gia_ObjRepr
(
p
,
Id
)
==
0
;
}
static
inline
int
Gia_ObjIsUsed
(
Gia_Man_t
*
p
,
int
Id
)
{
return
Gia_ObjRepr
(
p
,
Id
)
!=
GIA_VOID
&&
Gia_ObjNext
(
p
,
Id
)
>
0
;
}
static
inline
int
Gia_ObjIsHead
(
Gia_Man_t
*
p
,
int
Id
)
{
return
Gia_ObjRepr
(
p
,
Id
)
==
GIA_VOID
&&
Gia_ObjNext
(
p
,
Id
)
>
0
;
}
static
inline
int
Gia_ObjIsNone
(
Gia_Man_t
*
p
,
int
Id
)
{
return
Gia_ObjRepr
(
p
,
Id
)
==
GIA_VOID
&&
Gia_ObjNext
(
p
,
Id
)
==
0
;
}
static
inline
int
Gia_ObjIsTail
(
Gia_Man_t
*
p
,
int
Id
)
{
return
(
Gia_ObjRepr
(
p
,
Id
)
>
0
&&
Gia_ObjRepr
(
p
,
Id
)
!=
GIA_VOID
)
&&
Gia_ObjNext
(
p
,
Id
)
==
0
;
}
...
...
@@ -699,6 +700,9 @@ extern int Gia_ManFindFailedPoCex( Gia_Man_t * pAig, Abc_Cex_t *
extern
void
Gia_ManCounterExampleValueStart
(
Gia_Man_t
*
pGia
,
Abc_Cex_t
*
pCex
);
extern
void
Gia_ManCounterExampleValueStop
(
Gia_Man_t
*
pGia
);
extern
int
Gia_ManCounterExampleValueLookup
(
Gia_Man_t
*
pGia
,
int
Id
,
int
iFrame
);
/*=== giaChoice.c ============================================================*/
extern
void
Gia_ManVerifyChoices
(
Gia_Man_t
*
p
);
extern
void
Gia_ManReverseClasses
(
Gia_Man_t
*
p
,
int
fNowIncreasing
);
/*=== giaCsatOld.c ============================================================*/
extern
Vec_Int_t
*
Cbs_ManSolveMiter
(
Gia_Man_t
*
pGia
,
int
nConfs
,
Vec_Str_t
**
pvStatus
,
int
fVerbose
);
/*=== giaCsat.c ============================================================*/
...
...
@@ -760,7 +764,6 @@ extern int Gia_ManEquivCountLitsAll( Gia_Man_t * p );
extern
int
Gia_ManEquivCountClasses
(
Gia_Man_t
*
p
);
extern
void
Gia_ManEquivPrintOne
(
Gia_Man_t
*
p
,
int
i
,
int
Counter
);
extern
void
Gia_ManEquivPrintClasses
(
Gia_Man_t
*
p
,
int
fVerbose
,
float
Mem
);
extern
void
Gia_ManReverseClasses
(
Gia_Man_t
*
p
,
int
fNowIncreasing
);
extern
Gia_Man_t
*
Gia_ManEquivReduce
(
Gia_Man_t
*
p
,
int
fUseAll
,
int
fDualOut
,
int
fVerbose
);
extern
Gia_Man_t
*
Gia_ManEquivReduceAndRemap
(
Gia_Man_t
*
p
,
int
fSeq
,
int
fMiterPairs
);
extern
int
Gia_ManEquivSetColors
(
Gia_Man_t
*
p
,
int
fVerbose
);
...
...
@@ -912,7 +915,6 @@ extern int Gia_ObjRecognizeExor( Gia_Obj_t * pObj, Gia_Obj_t **
extern
Gia_Obj_t
*
Gia_ObjRecognizeMux
(
Gia_Obj_t
*
pNode
,
Gia_Obj_t
**
ppNodeT
,
Gia_Obj_t
**
ppNodeE
);
extern
int
Gia_NodeMffcSize
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pNode
);
extern
int
Gia_ManHasChoices
(
Gia_Man_t
*
p
);
extern
void
Gia_ManVerifyChoices
(
Gia_Man_t
*
p
);
extern
int
Gia_ManHasDangling
(
Gia_Man_t
*
p
);
extern
int
Gia_ManMarkDangling
(
Gia_Man_t
*
p
);
extern
Vec_Int_t
*
Gia_ManGetDangling
(
Gia_Man_t
*
p
);
...
...
src/aig/gia/giaAig.c
View file @
255f171f
...
...
@@ -419,18 +419,6 @@ void Gia_ManReprToAigRepr( Aig_Man_t * pAig, Gia_Man_t * pGia )
Aig_ObjCreateRepr
(
pAig
,
Aig_ManObj
(
pAig
,
pGiaRepr
->
Value
),
Aig_ManObj
(
pAig
,
pGiaObj
->
Value
)
);
}
}
/**Function*************************************************************
Synopsis [Transfers representatives from pGia to pAig.]
Description [Assumes that pAig was created from pGia.]
SideEffects []
SeeAlso []
***********************************************************************/
void
Gia_ManReprToAigRepr2
(
Aig_Man_t
*
pAig
,
Gia_Man_t
*
pGia
)
{
Gia_Obj_t
*
pGiaObj
,
*
pGiaRepr
;
...
...
@@ -470,9 +458,9 @@ void Gia_ManReprFromAigRepr( Aig_Man_t * pAig, Gia_Man_t * pGia )
pGia
->
pReprs
=
ABC_CALLOC
(
Gia_Rpr_t
,
Gia_ManObjNum
(
pGia
)
);
for
(
i
=
0
;
i
<
Gia_ManObjNum
(
pGia
);
i
++
)
Gia_ObjSetRepr
(
pGia
,
i
,
GIA_VOID
);
// move pointers from GIA to AIG
Gia_ManForEachObj
(
pGia
,
pObjGia
,
i
)
{
// Abc_Print( 1, "%d -> %d %d\n", i, Gia_ObjValue(pObjGia), Gia_ObjValue(pObjGia)/2 );
if
(
Gia_ObjIsCo
(
pObjGia
)
)
continue
;
assert
(
i
==
0
||
!
Abc_LitIsCompl
(
Gia_ObjValue
(
pObjGia
))
);
...
...
@@ -490,6 +478,27 @@ void Gia_ManReprFromAigRepr( Aig_Man_t * pAig, Gia_Man_t * pGia )
}
pGia
->
pNexts
=
Gia_ManDeriveNexts
(
pGia
);
}
void
Gia_ManReprFromAigRepr2
(
Aig_Man_t
*
pAig
,
Gia_Man_t
*
pGia
)
{
Aig_Obj_t
*
pObjAig
,
*
pReprAig
;
int
i
;
assert
(
pAig
->
pReprs
!=
NULL
);
assert
(
pGia
->
pReprs
==
NULL
);
assert
(
Gia_ManObjNum
(
pGia
)
-
Gia_ManCoNum
(
pGia
)
==
Aig_ManObjNum
(
pAig
)
-
Aig_ManCoNum
(
pAig
)
);
pGia
->
pReprs
=
ABC_CALLOC
(
Gia_Rpr_t
,
Gia_ManObjNum
(
pGia
)
);
for
(
i
=
0
;
i
<
Gia_ManObjNum
(
pGia
);
i
++
)
Gia_ObjSetRepr
(
pGia
,
i
,
GIA_VOID
);
Aig_ManForEachObj
(
pAig
,
pObjAig
,
i
)
{
if
(
Aig_ObjIsCo
(
pObjAig
)
)
continue
;
if
(
pAig
->
pReprs
[
i
]
==
NULL
)
continue
;
pReprAig
=
pAig
->
pReprs
[
i
];
Gia_ObjSetRepr
(
pGia
,
Abc_Lit2Var
(
pObjAig
->
iData
),
Abc_Lit2Var
(
pReprAig
->
iData
)
);
}
pGia
->
pNexts
=
Gia_ManDeriveNexts
(
pGia
);
}
/**Function*************************************************************
...
...
src/aig/gia/giaAig.h
View file @
255f171f
...
...
@@ -59,6 +59,7 @@ extern Aig_Man_t * Gia_ManToAigSimple( Gia_Man_t * p );
extern
void
Gia_ManReprToAigRepr
(
Aig_Man_t
*
pAig
,
Gia_Man_t
*
pGia
);
extern
void
Gia_ManReprToAigRepr2
(
Aig_Man_t
*
pAig
,
Gia_Man_t
*
pGia
);
extern
void
Gia_ManReprFromAigRepr
(
Aig_Man_t
*
pAig
,
Gia_Man_t
*
pGia
);
extern
void
Gia_ManReprFromAigRepr2
(
Aig_Man_t
*
pAig
,
Gia_Man_t
*
pGia
);
extern
Gia_Man_t
*
Gia_ManCompress2
(
Gia_Man_t
*
p
,
int
fUpdateLevel
,
int
fVerbose
);
extern
Gia_Man_t
*
Gia_ManPerformDch
(
Gia_Man_t
*
p
,
void
*
pPars
);
extern
Gia_Man_t
*
Gia_ManAbstraction
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vFlops
);
...
...
src/aig/gia/giaChoice.c
0 → 100644
View file @
255f171f
This diff is collapsed.
Click to expand it.
src/aig/gia/giaEquiv.c
View file @
255f171f
...
...
@@ -347,89 +347,6 @@ void Gia_ManEquivPrintClasses( Gia_Man_t * p, int fVerbose, float Mem )
/**Function*************************************************************
Synopsis [Reverse the order of nodes in equiv classes.]
Description [If the flag is 1, assumed current increasing order ]
SideEffects []
SeeAlso []
***********************************************************************/
void
Gia_ManReverseClasses
(
Gia_Man_t
*
p
,
int
fNowIncreasing
)
{
Vec_Int_t
*
vCollected
;
Vec_Int_t
*
vClass
;
int
i
,
k
,
iRepr
,
iNode
,
iPrev
;
// collect classes
vCollected
=
Vec_IntAlloc
(
100
);
Gia_ManForEachClass
(
p
,
iRepr
)
{
Vec_IntPush
(
vCollected
,
iRepr
);
/*
// check classes
if ( !fNowIncreasing )
{
iPrev = iRepr;
Gia_ClassForEachObj1( p, iRepr, iNode )
{
if ( iPrev < iNode )
{
printf( "Class %d : ", iRepr );
Gia_ClassForEachObj( p, iRepr, iNode )
printf( " %d", iNode );
printf( "\n" );
break;
}
iPrev = iNode;
}
}
*/
}
// correct each class
vClass
=
Vec_IntAlloc
(
100
);
Vec_IntForEachEntry
(
vCollected
,
iRepr
,
i
)
{
Vec_IntClear
(
vClass
);
Vec_IntPush
(
vClass
,
iRepr
);
Gia_ClassForEachObj1
(
p
,
iRepr
,
iNode
)
{
if
(
fNowIncreasing
)
assert
(
iRepr
<
iNode
);
// else
// assert( iRepr > iNode );
Vec_IntPush
(
vClass
,
iNode
);
}
if
(
!
fNowIncreasing
)
Vec_IntSort
(
vClass
,
1
);
// if ( iRepr == 129720 || iRepr == 129737 )
// Vec_IntPrint( vClass );
// reverse the class
iPrev
=
0
;
iRepr
=
Vec_IntEntryLast
(
vClass
);
Vec_IntForEachEntry
(
vClass
,
iNode
,
k
)
{
if
(
fNowIncreasing
)
Gia_ObjSetReprRev
(
p
,
iNode
,
iNode
==
iRepr
?
GIA_VOID
:
iRepr
);
else
Gia_ObjSetRepr
(
p
,
iNode
,
iNode
==
iRepr
?
GIA_VOID
:
iRepr
);
Gia_ObjSetNext
(
p
,
iNode
,
iPrev
);
iPrev
=
iNode
;
}
}
Vec_IntFree
(
vCollected
);
Vec_IntFree
(
vClass
);
// verify
Gia_ManForEachClass
(
p
,
iRepr
)
Gia_ClassForEachObj1
(
p
,
iRepr
,
iNode
)
if
(
fNowIncreasing
)
assert
(
Gia_ObjRepr
(
p
,
iNode
)
==
iRepr
&&
iRepr
>
iNode
);
else
assert
(
Gia_ObjRepr
(
p
,
iNode
)
==
iRepr
&&
iRepr
<
iNode
);
}
/**Function*************************************************************
Synopsis [Returns representative node.]
Description []
...
...
src/aig/gia/giaUtil.c
View file @
255f171f
...
...
@@ -981,55 +981,6 @@ int Gia_ManHasChoices( Gia_Man_t * p )
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Gia_ManVerifyChoices
(
Gia_Man_t
*
p
)
{
Gia_Obj_t
*
pObj
;
int
i
,
iRepr
,
iNode
,
fProb
=
0
;
assert
(
p
->
pReprs
);
// mark nodes
Gia_ManCleanMark0
(
p
);
Gia_ManForEachClass
(
p
,
iRepr
)
Gia_ClassForEachObj1
(
p
,
iRepr
,
iNode
)
{
if
(
Gia_ObjIsHead
(
p
,
iNode
)
)
printf
(
"Member %d of choice class %d is a representative.
\n
"
,
iNode
,
iRepr
),
fProb
=
1
;
if
(
Gia_ManObj
(
p
,
iNode
)
->
fMark0
==
1
)
printf
(
"Node %d participates in more than one choice node.
\n
"
,
iNode
),
fProb
=
1
;
Gia_ManObj
(
p
,
iNode
)
->
fMark0
=
1
;
}
Gia_ManCleanMark0
(
p
);
Gia_ManForEachObj
(
p
,
pObj
,
i
)
{
if
(
Gia_ObjIsAnd
(
pObj
)
)
{
if
(
Gia_ObjHasRepr
(
p
,
Gia_ObjFaninId0
(
pObj
,
i
))
)
printf
(
"Fanin 0 of AND node %d has a repr.
\n
"
,
i
),
fProb
=
1
;
if
(
Gia_ObjHasRepr
(
p
,
Gia_ObjFaninId1
(
pObj
,
i
))
)
printf
(
"Fanin 1 of AND node %d has a repr.
\n
"
,
i
),
fProb
=
1
;
}
else
if
(
Gia_ObjIsCo
(
pObj
)
)
{
if
(
Gia_ObjHasRepr
(
p
,
Gia_ObjFaninId0
(
pObj
,
i
))
)
printf
(
"Fanin 0 of CO node %d has a repr.
\n
"
,
i
),
fProb
=
1
;
}
}
if
(
!
fProb
)
printf
(
"GIA with choices is correct.
\n
"
);
}
/**Function*************************************************************
Synopsis [Returns 1 if AIG has dangling nodes.]
Description []
...
...
src/aig/gia/module.make
View file @
255f171f
...
...
@@ -5,6 +5,7 @@ SRC += src/aig/gia/gia.c \
src/aig/gia/giaCCof.c
\
src/aig/gia/giaCex.c
\
src/aig/gia/giaCexMin.c
\
src/aig/gia/giaChoice.c
\
src/aig/gia/giaCof.c
\
src/aig/gia/giaCSatOld.c
\
src/aig/gia/giaCSat.c
\
...
...
src/proof/dch/dchCore.c
View file @
255f171f
...
...
@@ -106,6 +106,12 @@ p->timeSimInit = clock() - clk;
// free memory ahead of time
p
->
timeTotal
=
clock
()
-
clkTotal
;
Dch_ManStop
(
p
);
// try something different
{
// extern void Gia_ManNormalizeChoicesTest( Aig_Man_t * pAig );
// Gia_ManNormalizeChoicesTest( pAig );
}
// create choices
ABC_FREE
(
pAig
->
pTable
);
pResult
=
Dch_DeriveChoiceAig
(
pAig
,
pPars
->
fSkipRedSupp
);
...
...
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