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
61ee156b
Commit
61ee156b
authored
Sep 28, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New logic sharing extraction.
parent
f9b11cc9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
15 deletions
+51
-15
abclib.dsp
+4
-0
src/aig/gia/gia.h
+3
-1
src/aig/gia/giaBalance.c
+0
-0
src/aig/gia/giaHash.c
+6
-0
src/aig/gia/giaMan.c
+9
-1
src/aig/gia/giaUtil.c
+8
-2
src/base/abci/abc.c
+21
-11
No files found.
abclib.dsp
View file @
61ee156b
...
...
@@ -2791,6 +2791,10 @@ SOURCE=.\src\misc\vec\vecHash.h
# End Source File
# Begin Source File
SOURCE=.\src\misc\vec\vecHsh.h
# End Source File
# Begin Source File
SOURCE=.\src\misc\vec\vecInt.h
# End Source File
# Begin Source File
...
...
src/aig/gia/gia.h
View file @
61ee156b
...
...
@@ -179,8 +179,8 @@ struct Gia_Man_t_
Vec_Ptr_t
*
vTtInputs
;
// truth tables for constant and primary inputs
Vec_Wrd_t
*
vTtMemory
;
// truth tables for internal nodes
// balancing
Vec_Int_t
*
vStore
;
// node storage
Vec_Int_t
*
vSuper
;
// supergate
Vec_Int_t
*
vStore
;
// node storage
};
...
...
@@ -929,7 +929,9 @@ extern void Gia_DumpAiger( Gia_Man_t * p, char * pFilePrefix, int
extern
Vec_Str_t
*
Gia_AigerWriteIntoMemoryStr
(
Gia_Man_t
*
p
);
extern
Vec_Str_t
*
Gia_AigerWriteIntoMemoryStrPart
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vCis
,
Vec_Int_t
*
vAnds
,
Vec_Int_t
*
vCos
,
int
nRegs
);
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_ManMultiExtract
(
Gia_Man_t
*
p
,
int
fSimpleAnd
,
int
nNewNodesMax
,
int
fVerbose
);
/*=== 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
);
...
...
src/aig/gia/giaBalance.c
View file @
61ee156b
This diff is collapsed.
Click to expand it.
src/aig/gia/giaHash.c
View file @
61ee156b
...
...
@@ -518,6 +518,12 @@ int Gia_ManHashMuxReal( Gia_Man_t * p, int iLitC, int iLit1, int iLit0 )
{
int
fCompl
=
0
;
assert
(
p
->
fAddStrash
==
0
);
if
(
iLitC
<
2
)
return
iLitC
?
iLit1
:
iLit0
;
if
(
iLit0
<
2
)
return
iLit0
?
Gia_ManHashOr
(
p
,
Abc_LitNot
(
iLitC
),
iLit1
)
:
Gia_ManHashAnd
(
p
,
iLitC
,
iLit1
);
if
(
iLit1
<
2
)
return
iLit1
?
Gia_ManHashOr
(
p
,
iLitC
,
iLit0
)
:
Gia_ManHashAnd
(
p
,
Abc_LitNot
(
iLitC
),
iLit0
);
assert
(
iLit0
>
1
&&
iLit1
>
1
&&
iLitC
>
1
);
if
(
iLit0
==
iLit1
)
return
iLit0
;
...
...
src/aig/gia/giaMan.c
View file @
61ee156b
...
...
@@ -77,6 +77,8 @@ void Gia_ManStop( Gia_Man_t * p )
assert
(
p
->
pManTime
==
NULL
);
Vec_PtrFreeFree
(
p
->
vNamesIn
);
Vec_PtrFreeFree
(
p
->
vNamesOut
);
Vec_IntFreeP
(
&
p
->
vSuper
);
Vec_IntFreeP
(
&
p
->
vStore
);
Vec_IntFreeP
(
&
p
->
vClassNew
);
Vec_IntFreeP
(
&
p
->
vClassOld
);
Vec_WrdFreeP
(
&
p
->
vSims
);
...
...
@@ -335,13 +337,19 @@ void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars )
Abc_Print
(
1
,
"(c=%d)"
,
Gia_ManConstrNum
(
p
)
);
if
(
Gia_ManRegNum
(
p
)
)
Abc_Print
(
1
,
" ff =%7d"
,
Gia_ManRegNum
(
p
)
);
Abc_Print
(
1
,
"
and =%8
d"
,
Gia_ManAndNum
(
p
)
);
Abc_Print
(
1
,
"
%s =%8d"
,
p
->
pMuxes
?
"nod"
:
"an
d"
,
Gia_ManAndNum
(
p
)
);
Abc_Print
(
1
,
" lev =%5d"
,
Gia_ManLevelNum
(
p
)
);
Vec_IntFreeP
(
&
p
->
vLevels
);
if
(
pPars
&&
pPars
->
fCut
)
Abc_Print
(
1
,
" cut = %d(%d)"
,
Gia_ManCrossCut
(
p
,
0
),
Gia_ManCrossCut
(
p
,
1
)
);
Abc_Print
(
1
,
" mem =%5.2f MB"
,
Gia_ManMemory
(
p
)
/
(
1
<<
20
)
);
if
(
Gia_ManHasDangling
(
p
)
)
Abc_Print
(
1
,
" ch =%5d"
,
Gia_ManEquivCountClasses
(
p
)
);
if
(
p
->
pMuxes
)
{
Abc_Print
(
1
,
" and =%5d"
,
Gia_ManAndNum
(
p
)
-
Gia_ManXorNum
(
p
)
-
Gia_ManMuxNum
(
p
)
);
Abc_Print
(
1
,
" xor =%5d"
,
Gia_ManXorNum
(
p
)
);
Abc_Print
(
1
,
" mux =%5d"
,
Gia_ManMuxNum
(
p
)
);
}
if
(
pPars
&&
pPars
->
fSwitch
)
{
if
(
p
->
pSwitching
)
...
...
src/aig/gia/giaUtil.c
View file @
61ee156b
...
...
@@ -1008,13 +1008,19 @@ int Gia_ManHasDangling( Gia_Man_t * p )
Gia_ManForEachObj
(
p
,
pObj
,
i
)
{
pObj
->
fMark0
=
0
;
if
(
Gia_ObjIsAnd
(
pObj
)
)
if
(
Gia_ObjIsCo
(
pObj
)
)
Gia_ObjFanin0
(
pObj
)
->
fMark0
=
1
;
else
if
(
Gia_ObjIsMux
(
p
,
pObj
)
)
{
Gia_ObjFanin0
(
pObj
)
->
fMark0
=
1
;
Gia_ObjFanin1
(
pObj
)
->
fMark0
=
1
;
Gia_ObjFanin2
(
p
,
pObj
)
->
fMark0
=
1
;
}
else
if
(
Gia_ObjIsCo
(
pObj
)
)
else
if
(
Gia_ObjIsAnd
(
pObj
)
)
{
Gia_ObjFanin0
(
pObj
)
->
fMark0
=
1
;
Gia_ObjFanin1
(
pObj
)
->
fMark0
=
1
;
}
}
Gia_ManForEachAnd
(
p
,
pObj
,
i
)
Counter
+=
!
pObj
->
fMark0
;
...
...
src/base/abci/abc.c
View file @
61ee156b
...
...
@@ -27410,12 +27410,13 @@ usage:
int
Abc_CommandAbc9Balance
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
Gia_Man_t
*
pTemp
=
NULL
;
int
c
,
fVerbose
=
0
;
int
fSimpleAnd
=
0
;
int
fKeepLevel
=
0
;
int
nFanoutMax
=
50
;
int
nNewNodesMax
=
ABC_INFINITY
;
int
fMultiExt
=
0
;
int
fSimpleAnd
=
0
;
int
fKeepLevel
=
0
;
int
c
,
fVerbose
=
1
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"N
la
vh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"N
eal
vh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -27425,17 +27426,20 @@ int Abc_CommandAbc9Balance( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print
(
-
1
,
"Command line switch
\"
-N
\"
should be followed by a char string.
\n
"
);
goto
usage
;
}
n
Fanout
Max
=
atoi
(
argv
[
globalUtilOptind
]);
n
NewNodes
Max
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
n
Fanout
Max
<
0
)
if
(
n
NewNodes
Max
<
0
)
goto
usage
;
break
;
case
'
l
'
:
f
KeepLevel
^=
1
;
case
'
e
'
:
f
MultiExt
^=
1
;
break
;
case
'a'
:
fSimpleAnd
^=
1
;
break
;
case
'l'
:
fKeepLevel
^=
1
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
...
...
@@ -27455,14 +27459,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
;
}
pTemp
=
Gia_ManBalance
(
pAbc
->
pGia
,
fSimpleAnd
,
fVerbose
);
if
(
fMultiExt
)
pTemp
=
Gia_ManMultiExtract
(
pAbc
->
pGia
,
fSimpleAnd
,
nNewNodesMax
,
fVerbose
);
else
pTemp
=
Gia_ManBalance
(
pAbc
->
pGia
,
fSimpleAnd
,
fVerbose
);
Abc_FrameUpdateGia
(
pAbc
,
pTemp
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: &b [-
a
vh]
\n
"
);
Abc_Print
(
-
2
,
"usage: &b [-
N num] [-eal
vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
performs AIG balancing to reduce delay
\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
-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
-v : toggle printing verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
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