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
62439be8
Commit
62439be8
authored
Sep 29, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New logic sharing extraction.
parent
49ac3c52
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
140 additions
and
72 deletions
+140
-72
abclib.dsp
+4
-0
src/aig/gia/gia.h
+5
-5
src/aig/gia/giaBalance.c
+1
-1
src/aig/gia/giaFx.c
+0
-0
src/aig/gia/giaMan.c
+1
-1
src/aig/gia/giaTruth.c
+25
-48
src/aig/gia/module.make
+1
-0
src/base/abci/abc.c
+97
-11
src/base/abci/abcFx.c
+6
-6
No files found.
abclib.dsp
View file @
62439be8
...
...
@@ -3683,6 +3683,10 @@ SOURCE=.\src\aig\gia\giaFront.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaFx.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaGlitch.c
# End Source File
# Begin Source File
...
...
src/aig/gia/gia.h
View file @
62439be8
...
...
@@ -174,7 +174,7 @@ struct Gia_Man_t_
// truth table computation for small functions
int
nTtVars
;
// truth table variables
int
nTtWords
;
// truth table words
Vec_
Str
_t
*
vTtNums
;
// object numbers
Vec_
Int
_t
*
vTtNums
;
// object numbers
Vec_Int_t
*
vTtNodes
;
// internal nodes
Vec_Ptr_t
*
vTtInputs
;
// truth tables for constant and primary inputs
Vec_Wrd_t
*
vTtMemory
;
// truth tables for internal nodes
...
...
@@ -454,8 +454,8 @@ static inline void Gia_ObjSetXorLevel( Gia_Man_t * p, Gia_Obj_t * pObj )
static
inline
void
Gia_ObjSetMuxLevel
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
assert
(
Gia_ObjIsMux
(
p
,
pObj
)
);
Gia_ObjSetLevel
(
p
,
pObj
,
2
+
Abc_MaxInt
(
Abc_MaxInt
(
Gia_ObjLevel
(
p
,
Gia_ObjFanin0
(
pObj
)),
Gia_ObjLevel
(
p
,
Gia_ObjFanin1
(
pObj
))),
Gia_ObjLevel
(
p
,
Gia_ObjFanin2
(
p
,
pObj
)))
);
}
static
inline
void
Gia_ObjSetGateLevel
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
){
if
(
Gia_ObjIsMux
(
p
,
pObj
)
)
Gia_ObjSetMuxLevel
(
p
,
pObj
);
else
if
(
Gia_ObjIsXor
(
pObj
)
)
Gia_ObjSetXorLevel
(
p
,
pObj
);
else
if
(
Gia_ObjIsAnd
(
pObj
)
)
Gia_ObjSetAndLevel
(
p
,
pObj
);
}
static
inline
int
Gia_ObjNum
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
(
int
)(
unsigned
char
)
Vec_StrGetEntry
(
p
->
vTtNums
,
Gia_ObjId
(
p
,
pObj
));
}
static
inline
void
Gia_ObjSetNum
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
int
n
)
{
assert
(
n
>=
0
&&
n
<
254
);
Vec_StrSetEntry
(
p
->
vTtNums
,
Gia_ObjId
(
p
,
pObj
),
(
char
)
n
);
}
static
inline
int
Gia_ObjNum
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Vec_IntGetEntry
(
p
->
vTtNums
,
Gia_ObjId
(
p
,
pObj
));
}
static
inline
void
Gia_ObjSetNum
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
int
n
)
{
assert
(
n
>=
0
);
Vec_IntSetEntry
(
p
->
vTtNums
,
Gia_ObjId
(
p
,
pObj
),
n
);
}
static
inline
int
Gia_ObjRefNumId
(
Gia_Man_t
*
p
,
int
Id
)
{
return
p
->
pRefs
[
Id
];
}
static
inline
int
Gia_ObjRefIncId
(
Gia_Man_t
*
p
,
int
Id
)
{
return
p
->
pRefs
[
Id
]
++
;
}
...
...
@@ -931,7 +931,7 @@ extern Vec_Str_t * Gia_AigerWriteIntoMemoryStrPart( Gia_Man_t * p, Vec_I
extern
void
Gia_AigerWriteSimple
(
Gia_Man_t
*
pInit
,
char
*
pFileName
);
/*=== giaBalance.c ===========================================================*/
extern
Gia_Man_t
*
Gia_ManBalance
(
Gia_Man_t
*
p
,
int
fSimpleAnd
,
int
fVerbose
);
extern
Gia_Man_t
*
Gia_Man
MultiExtract
(
Gia_Man_t
*
p
,
int
fSimpleAnd
,
int
nNewNodesMax
,
int
fVerbose
,
int
fVeryVerbose
);
extern
Gia_Man_t
*
Gia_Man
AreaBalance
(
Gia_Man_t
*
p
,
int
fSimpleAnd
,
int
nNewNodesMax
,
int
fVerbose
,
int
fVeryVerbose
);
/*=== giaBidec.c ===========================================================*/
extern
unsigned
*
Gia_ManConvertAigToTruth
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pRoot
,
Vec_Int_t
*
vLeaves
,
Vec_Int_t
*
vTruth
,
Vec_Int_t
*
vVisited
);
extern
Gia_Man_t
*
Gia_ManPerformBidec
(
Gia_Man_t
*
p
,
int
fVerbose
);
...
...
@@ -1193,7 +1193,7 @@ extern Gia_Man_t * Gia_ManUpdateExtraAig( void * pTime, Gia_Man_t * pAig
/*=== giaTruth.c ===========================================================*/
extern
word
Gia_ObjComputeTruthTable6Lut
(
Gia_Man_t
*
p
,
int
iObj
,
Vec_Wrd_t
*
vTemp
);
extern
word
Gia_ObjComputeTruthTable6
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
Vec_Int_t
*
vSupp
,
Vec_Wrd_t
*
vTruths
);
extern
int
Gia_ObjCollectInternal
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
);
extern
void
Gia_ObjCollectInternal
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
);
extern
word
*
Gia_ObjComputeTruthTable
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
);
extern
void
Gia_ObjComputeTruthTableStart
(
Gia_Man_t
*
p
,
int
nVarsMax
);
extern
void
Gia_ObjComputeTruthTableStop
(
Gia_Man_t
*
p
);
...
...
src/aig/gia/giaBalance.c
View file @
62439be8
...
...
@@ -896,7 +896,7 @@ Gia_Man_t * Dam_ManMultiExtractInt( Gia_Man_t * pGia, int nNewNodesMax, int fVer
Dam_ManFree
(
p
);
return
pNew
;
}
Gia_Man_t
*
Gia_Man
MultiExtract
(
Gia_Man_t
*
p
,
int
fSimpleAnd
,
int
nNewNodesMax
,
int
fVerbose
,
int
fVeryVerbose
)
Gia_Man_t
*
Gia_Man
AreaBalance
(
Gia_Man_t
*
p
,
int
fSimpleAnd
,
int
nNewNodesMax
,
int
fVerbose
,
int
fVeryVerbose
)
{
Gia_Man_t
*
pNew
,
*
pNew1
,
*
pNew2
;
if
(
fVerbose
)
Gia_ManPrintStats
(
p
,
NULL
);
...
...
src/aig/gia/giaFx.c
0 → 100644
View file @
62439be8
This diff is collapsed.
Click to expand it.
src/aig/gia/giaMan.c
View file @
62439be8
...
...
@@ -95,7 +95,7 @@ void Gia_ManStop( Gia_Man_t * p )
Vec_IntFreeP
(
&
p
->
vDoms
);
Vec_IntFreeP
(
&
p
->
vLevels
);
Vec_IntFreeP
(
&
p
->
vTruths
);
Vec_
Str
FreeP
(
&
p
->
vTtNums
);
Vec_
Int
FreeP
(
&
p
->
vTtNums
);
Vec_IntFreeP
(
&
p
->
vTtNodes
);
Vec_WrdFreeP
(
&
p
->
vTtMemory
);
Vec_PtrFreeP
(
&
p
->
vTtInputs
);
...
...
src/aig/gia/giaTruth.c
View file @
62439be8
...
...
@@ -38,8 +38,8 @@ static word s_Truth6[6] = {
static
inline
word
*
Gla_ObjTruthElem
(
Gia_Man_t
*
p
,
int
i
)
{
return
(
word
*
)
Vec_PtrEntry
(
p
->
vTtInputs
,
i
);
}
static
inline
word
*
Gla_ObjTruthNode
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Vec_WrdArray
(
p
->
vTtMemory
)
+
p
->
nTtWords
*
Gia_ObjNum
(
p
,
pObj
);
}
static
inline
word
*
Gla_ObjTruthFree1
(
Gia_Man_t
*
p
)
{
return
Vec_WrdArray
(
p
->
vTtMemory
)
+
p
->
nTtWords
*
254
;
}
static
inline
word
*
Gla_ObjTruthFree2
(
Gia_Man_t
*
p
)
{
return
Vec_WrdArray
(
p
->
vTtMemory
)
+
p
->
nTtWords
*
255
;
}
static
inline
word
*
Gla_ObjTruthFree1
(
Gia_Man_t
*
p
)
{
return
Vec_WrdArray
(
p
->
vTtMemory
)
+
Vec_WrdSize
(
p
->
vTtMemory
)
-
p
->
nTtWords
*
1
;
}
static
inline
word
*
Gla_ObjTruthFree2
(
Gia_Man_t
*
p
)
{
return
Vec_WrdArray
(
p
->
vTtMemory
)
+
Vec_WrdSize
(
p
->
vTtMemory
)
-
p
->
nTtWords
*
2
;
}
static
inline
word
*
Gla_ObjTruthConst0
(
Gia_Man_t
*
p
,
word
*
pDst
)
{
int
w
;
for
(
w
=
0
;
w
<
p
->
nTtWords
;
w
++
)
pDst
[
w
]
=
0
;
return
pDst
;
}
static
inline
word
*
Gla_ObjTruthDup
(
Gia_Man_t
*
p
,
word
*
pDst
,
word
*
pSrc
,
int
c
)
{
int
w
;
for
(
w
=
0
;
w
<
p
->
nTtWords
;
w
++
)
pDst
[
w
]
=
c
?
~
pSrc
[
w
]
:
pSrc
[
w
];
return
pDst
;
}
...
...
@@ -143,28 +143,22 @@ word Gia_ObjComputeTruthTable6( Gia_Man_t * p, Gia_Obj_t * pObj, Vec_Int_t * vSu
SeeAlso []
***********************************************************************/
int
Gia_ObjCollectInternal_rec
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
void
Gia_ObjCollectInternal_rec
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
if
(
!
Gia_ObjIsAnd
(
pObj
)
)
return
0
;
return
;
if
(
pObj
->
fMark0
)
return
0
;
return
;
pObj
->
fMark0
=
1
;
Gia_ObjCollectInternal_rec
(
p
,
Gia_ObjFanin0
(
pObj
)
);
Gia_ObjCollectInternal_rec
(
p
,
Gia_ObjFanin1
(
pObj
)
);
if
(
Vec_IntSize
(
p
->
vTtNodes
)
>
253
)
return
1
;
Gia_ObjSetNum
(
p
,
pObj
,
Vec_IntSize
(
p
->
vTtNodes
)
);
Vec_IntPush
(
p
->
vTtNodes
,
Gia_ObjId
(
p
,
pObj
)
);
return
0
;
}
int
Gia_ObjCollectInternal
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
void
Gia_ObjCollectInternal
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
int
RetValue
;
Vec_IntClear
(
p
->
vTtNodes
);
RetValue
=
Gia_ObjCollectInternal_rec
(
p
,
pObj
);
assert
(
Vec_IntSize
(
p
->
vTtNodes
)
<
254
);
return
RetValue
;
Gia_ObjCollectInternal_rec
(
p
,
pObj
);
}
/**Function*************************************************************
...
...
@@ -188,7 +182,7 @@ word * Gia_ObjComputeTruthTable( Gia_Man_t * p, Gia_Obj_t * pObj )
{
p
->
nTtVars
=
Gia_ManPiNum
(
p
);
p
->
nTtWords
=
(
p
->
nTtVars
<=
6
?
1
:
(
1
<<
(
p
->
nTtVars
-
6
)));
p
->
vTtNums
=
Vec_
Str
Alloc
(
Gia_ManObjNum
(
p
)
+
1000
);
p
->
vTtNums
=
Vec_
Int
Alloc
(
Gia_ManObjNum
(
p
)
+
1000
);
p
->
vTtNodes
=
Vec_IntAlloc
(
256
);
p
->
vTtInputs
=
Vec_PtrAllocTruthTables
(
p
->
nTtVars
);
p
->
vTtMemory
=
Vec_WrdStart
(
p
->
nTtWords
*
256
);
...
...
@@ -201,13 +195,10 @@ word * Gia_ObjComputeTruthTable( Gia_Man_t * p, Gia_Obj_t * pObj )
}
// collect internal nodes
pRoot
=
Gia_ObjIsCo
(
pObj
)
?
Gia_ObjFanin0
(
pObj
)
:
pObj
;
if
(
Gia_ObjCollectInternal
(
p
,
pRoot
)
)
{
Gia_ManForEachObjVec
(
p
->
vTtNodes
,
p
,
pTemp
,
i
)
pTemp
->
fMark0
=
0
;
return
NULL
;
}
Gia_ObjCollectInternal
(
p
,
pRoot
);
// compute the truth table for internal nodes
if
(
Vec_WrdSize
(
p
->
vTtMemory
)
<
p
->
nTtWords
*
(
Vec_IntSize
(
p
->
vTtNodes
)
+
2
)
)
Vec_WrdFillExtra
(
p
->
vTtMemory
,
p
->
nTtWords
*
(
Vec_IntSize
(
p
->
vTtNodes
)
+
2
),
0
);
Gia_ManForEachObjVec
(
p
->
vTtNodes
,
p
,
pTemp
,
i
)
{
pTemp
->
fMark0
=
0
;
// unmark nodes marked by Gia_ObjCollectInternal()
...
...
@@ -283,21 +274,18 @@ void Gia_ObjComputeTruthTableTest( Gia_Man_t * p )
SeeAlso []
***********************************************************************/
int
Gia_ObjCollectInternalCut_rec
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
void
Gia_ObjCollectInternalCut_rec
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
if
(
pObj
->
fMark0
)
return
0
;
assert
(
Gia_ObjIsAnd
(
pObj
)
);
if
(
Gia_ObjCollectInternalCut_rec
(
p
,
Gia_ObjFanin0
(
pObj
)
)
)
return
1
;
if
(
Gia_ObjCollectInternalCut_rec
(
p
,
Gia_ObjFanin1
(
pObj
)
)
)
return
1
;
return
;
pObj
->
fMark0
=
1
;
assert
(
Gia_ObjIsAnd
(
pObj
)
);
Gia_ObjCollectInternalCut_rec
(
p
,
Gia_ObjFanin0
(
pObj
)
);
Gia_ObjCollectInternalCut_rec
(
p
,
Gia_ObjFanin1
(
pObj
)
);
Gia_ObjSetNum
(
p
,
pObj
,
Vec_IntSize
(
p
->
vTtNodes
)
);
Vec_IntPush
(
p
->
vTtNodes
,
Gia_ObjId
(
p
,
pObj
)
);
return
(
Vec_IntSize
(
p
->
vTtNodes
)
>=
254
);
}
int
Gia_ObjCollectInternalCut
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pRoot
,
Vec_Int_t
*
vLeaves
)
void
Gia_ObjCollectInternalCut
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pRoot
,
Vec_Int_t
*
vLeaves
)
{
Gia_Obj_t
*
pObj
;
int
i
;
...
...
@@ -311,7 +299,7 @@ int Gia_ObjCollectInternalCut( Gia_Man_t * p, Gia_Obj_t * pRoot, Vec_Int_t * vLe
}
assert
(
pRoot
->
fMark0
==
0
);
// the root cannot be one of the leaves
Vec_IntClear
(
p
->
vTtNodes
);
return
Gia_ObjCollectInternalCut_rec
(
p
,
pRoot
);
Gia_ObjCollectInternalCut_rec
(
p
,
pRoot
);
}
/**Function*************************************************************
...
...
@@ -329,17 +317,17 @@ void Gia_ObjComputeTruthTableStart( Gia_Man_t * p, int nVarsMax )
{
assert
(
p
->
vTtMemory
==
NULL
);
p
->
nTtVars
=
nVarsMax
;
p
->
nTtWords
=
(
p
->
nTtVars
<=
6
?
1
:
(
1
<<
(
p
->
nTtVars
-
6
))
);
p
->
vTtNums
=
Vec_
Str
Alloc
(
Gia_ManObjNum
(
p
)
+
1000
);
p
->
nTtWords
=
Abc_Truth6WordNum
(
p
->
nTtVars
);
p
->
vTtNums
=
Vec_
Int
Alloc
(
Gia_ManObjNum
(
p
)
+
1000
);
p
->
vTtNodes
=
Vec_IntAlloc
(
256
);
p
->
vTtInputs
=
Vec_PtrAllocTruthTables
(
p
->
nTtVars
);
p
->
vTtMemory
=
Vec_WrdStart
(
p
->
nTtWords
*
256
);
p
->
vTtMemory
=
Vec_WrdStart
(
p
->
nTtWords
*
64
);
}
void
Gia_ObjComputeTruthTableStop
(
Gia_Man_t
*
p
)
{
p
->
nTtVars
=
0
;
p
->
nTtWords
=
0
;
Vec_
Str
FreeP
(
&
p
->
vTtNums
);
Vec_
Int
FreeP
(
&
p
->
vTtNums
);
Vec_IntFreeP
(
&
p
->
vTtNodes
);
Vec_PtrFreeP
(
&
p
->
vTtInputs
);
Vec_WrdFreeP
(
&
p
->
vTtMemory
);
...
...
@@ -364,21 +352,10 @@ word * Gia_ObjComputeTruthTableCut( Gia_Man_t * p, Gia_Obj_t * pRoot, Vec_Int_t
assert
(
p
->
vTtMemory
!=
NULL
);
assert
(
Vec_IntSize
(
vLeaves
)
<=
p
->
nTtVars
);
// collect internal nodes
if
(
Gia_ObjCollectInternalCut
(
p
,
pRoot
,
vLeaves
)
)
{
// unmark nodes makred by Gia_ObjCollectInternal()
Gia_ManForEachObjVec
(
p
->
vTtNodes
,
p
,
pTemp
,
i
)
pTemp
->
fMark0
=
0
;
// unmark leaves marked by Gia_ObjCollectInternal()
Gia_ManForEachObjVec
(
vLeaves
,
p
,
pTemp
,
i
)
{
assert
(
pTemp
->
fMark0
==
1
);
pTemp
->
fMark0
=
0
;
}
return
NULL
;
}
Gia_ObjCollectInternalCut
(
p
,
pRoot
,
vLeaves
);
// compute the truth table for internal nodes
assert
(
Vec_IntSize
(
p
->
vTtNodes
)
<
254
);
if
(
Vec_WrdSize
(
p
->
vTtMemory
)
<
p
->
nTtWords
*
(
Vec_IntSize
(
p
->
vTtNodes
)
+
2
)
)
Vec_WrdFillExtra
(
p
->
vTtMemory
,
p
->
nTtWords
*
(
Vec_IntSize
(
p
->
vTtNodes
)
+
2
),
0
);
Gia_ManForEachObjVec
(
p
->
vTtNodes
,
p
,
pTemp
,
i
)
{
pTemp
->
fMark0
=
0
;
// unmark nodes marked by Gia_ObjCollectInternal()
...
...
src/aig/gia/module.make
View file @
62439be8
...
...
@@ -21,6 +21,7 @@ SRC += src/aig/gia/giaAig.c \
src/aig/gia/giaForce.c
\
src/aig/gia/giaFrames.c
\
src/aig/gia/giaFront.c
\
src/aig/gia/giaFx.c
\
src/aig/gia/giaGlitch.c
\
src/aig/gia/giaHash.c
\
src/aig/gia/giaIf.c
\
...
...
src/base/abci/abc.c
View file @
62439be8
...
...
@@ -350,6 +350,7 @@ static int Abc_CommandAbc9Enable ( Abc_Frame_t * pAbc, int argc, cha
static
int
Abc_CommandAbc9Dc2
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Bidec
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Shrink
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Fx
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Balance
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Miter
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Miter2
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
...
...
@@ -909,6 +910,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&dc2"
,
Abc_CommandAbc9Dc2
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&bidec"
,
Abc_CommandAbc9Bidec
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&shrink"
,
Abc_CommandAbc9Shrink
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&fx"
,
Abc_CommandAbc9Fx
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&b"
,
Abc_CommandAbc9Balance
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&miter"
,
Abc_CommandAbc9Miter
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&miter2"
,
Abc_CommandAbc9Miter2
,
0
);
...
...
@@ -27411,17 +27413,101 @@ usage:
SeeAlso []
***********************************************************************/
int
Abc_CommandAbc9Fx
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
extern
Gia_Man_t
*
Gia_ManPerformFx
(
Gia_Man_t
*
p
,
int
nNewNodesMax
,
int
LitCountMax
,
int
fVerbose
,
int
fVeryVerbose
);
Gia_Man_t
*
pTemp
;
int
nNewNodesMax
=
1000000
;
int
LitCountMax
=
0
;
int
c
,
fVerbose
=
0
;
int
fVeryVerbose
=
0
;
// set the defaults
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"NMvh"
))
!=
EOF
)
{
switch
(
c
)
{
case
'N'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-N
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
nNewNodesMax
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nNewNodesMax
<
0
)
goto
usage
;
break
;
case
'M'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-M
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
LitCountMax
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
LitCountMax
<
0
)
goto
usage
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
case
'h'
:
goto
usage
;
break
;
default:
goto
usage
;
}
}
if
(
pAbc
->
pGia
==
NULL
)
{
Abc_Print
(
-
1
,
"Abc_CommandAbc9Shrink(): There is no AIG.
\n
"
);
return
1
;
}
if
(
!
Gia_ManHasMapping
(
pAbc
->
pGia
)
)
{
Abc_Print
(
-
1
,
"Abc_CommandAbc9Shrink(): Mapping of the AIG is not defined.
\n
"
);
return
1
;
}
pTemp
=
Gia_ManPerformFx
(
pAbc
->
pGia
,
nNewNodesMax
,
LitCountMax
,
fVerbose
,
fVeryVerbose
);
if
(
pTemp
!=
NULL
)
Abc_FrameUpdateGia
(
pAbc
,
pTemp
);
else
Abc_Print
(
-
1
,
"Abc_CommandAbc9Fx(): Command has failed.
\n
"
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: &fx [-NM <num>] [-vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
extract shared logic using the classical
\"
fast_extract
\"
algorithm
\n
"
);
Abc_Print
(
-
2
,
"
\t
-N <num> : max number of divisors to extract during this run [default = %d]
\n
"
,
nNewNodesMax
);
Abc_Print
(
-
2
,
"
\t
-M <num> : upper bound on literal count of divisors to extract [default = %d]
\n
"
,
LitCountMax
);
Abc_Print
(
-
2
,
"
\t
-v : print verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_CommandAbc9Balance
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
Gia_Man_t
*
pTemp
=
NULL
;
int
nNewNodesMax
=
ABC_INFINITY
;
int
f
MultiExt
=
0
;
int
f
DelayOnly
=
0
;
int
fSimpleAnd
=
0
;
int
fKeepLevel
=
0
;
int
c
,
fVerbose
=
0
;
int
fVeryVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"N
e
alvwh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"N
d
alvwh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -27436,8 +27522,8 @@ int Abc_CommandAbc9Balance( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
nNewNodesMax
<
0
)
goto
usage
;
break
;
case
'
e
'
:
f
MultiExt
^=
1
;
case
'
d
'
:
f
DelayOnly
^=
1
;
break
;
case
'a'
:
fSimpleAnd
^=
1
;
...
...
@@ -27467,20 +27553,20 @@ int Abc_CommandAbc9Balance( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print
(
-
1
,
"Abc_CommandAbc9Balance(): The current AIG is mapped.
\n
"
);
return
1
;
}
if
(
fMultiExt
)
pTemp
=
Gia_ManMultiExtract
(
pAbc
->
pGia
,
fSimpleAnd
,
nNewNodesMax
,
fVerbose
,
fVeryVerbose
);
else
if
(
fDelayOnly
)
pTemp
=
Gia_ManBalance
(
pAbc
->
pGia
,
fSimpleAnd
,
fVerbose
);
else
pTemp
=
Gia_ManAreaBalance
(
pAbc
->
pGia
,
fSimpleAnd
,
nNewNodesMax
,
fVerbose
,
fVeryVerbose
);
Abc_FrameUpdateGia
(
pAbc
,
pTemp
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: &b [-N num] [-
eal
vwh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
performs AIG balancing to reduce delay
\n
"
);
Abc_Print
(
-
2
,
"usage: &b [-N num] [-
da
vwh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
performs AIG balancing to reduce delay
and area
\n
"
);
Abc_Print
(
-
2
,
"
\t
-N num : the max fanout count to skip a divisor [default = %d]
\n
"
,
nNewNodesMax
);
Abc_Print
(
-
2
,
"
\t
-
e : toggle extacting shared logic while balancing [default = %s]
\n
"
,
fMultiExt
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-
d : toggle delay only balancing [default = %s]
\n
"
,
fDelayOnly
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-a : toggle using AND instead of AND/XOR/MUX [default = %s]
\n
"
,
fSimpleAnd
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-l : toggle level update during shrinking [default = %s]
\n
"
,
fKeepLevel
?
"yes"
:
"no"
);
//
Abc_Print( -2, "\t-l : toggle level update during shrinking [default = %s]\n", fKeepLevel? "yes": "no" );
Abc_Print
(
-
2
,
"
\t
-v : toggle printing verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-w : toggle printing additional information [default = %s]
\n
"
,
fVeryVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
src/base/abci/abcFx.c
View file @
62439be8
...
...
@@ -481,12 +481,12 @@ static void Fx_PrintMatrix( Fx_Man_t * p )
}
static
void
Fx_PrintStats
(
Fx_Man_t
*
p
,
abctime
clk
)
{
printf
(
"Cubes =%
7
d "
,
Vec_WecSizeUsed
(
p
->
vCubes
)
);
printf
(
"Lits =%
7
d "
,
Vec_WecSizeUsed
(
p
->
vLits
)
);
printf
(
"Divs =%
7
d "
,
Hsh_VecSize
(
p
->
pHash
)
);
printf
(
"Divs+ =%
7
d "
,
Vec_QueSize
(
p
->
vPrio
)
);
printf
(
"Compl =%
6
d "
,
p
->
nDivMux
[
1
]
);
printf
(
"Extr =%
6
d "
,
p
->
nDivs
);
printf
(
"Cubes =%
8
d "
,
Vec_WecSizeUsed
(
p
->
vCubes
)
);
printf
(
"Lits =%
8
d "
,
Vec_WecSizeUsed
(
p
->
vLits
)
);
printf
(
"Divs =%
8
d "
,
Hsh_VecSize
(
p
->
pHash
)
);
printf
(
"Divs+ =%
8
d "
,
Vec_QueSize
(
p
->
vPrio
)
);
printf
(
"Compl =%
8
d "
,
p
->
nDivMux
[
1
]
);
printf
(
"Extr =%
7
d "
,
p
->
nDivs
);
// printf( "DivsS =%6d ", p->nDivsS );
// printf( "PairS =%6d ", p->nPairsS );
// printf( "PairD =%6d ", p->nPairsD );
...
...
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