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
27be3d01
Commit
27be3d01
authored
Sep 13, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added command &struct for profiling non-dec structures.
parent
dfb43b2f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
112 additions
and
0 deletions
+112
-0
src/aig/gia/giaIf.c
+49
-0
src/aig/gia/giaJf.c
+2
-0
src/base/abci/abc.c
+61
-0
No files found.
src/aig/gia/giaIf.c
View file @
27be3d01
...
...
@@ -1366,6 +1366,55 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp, int fNormalized )
return
pNew
;
}
/**Function*************************************************************
Synopsis [Tests decomposition structures.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Gia_ManTestStruct
(
Gia_Man_t
*
p
)
{
int
nCutMax
=
7
;
int
LutCount
[
8
]
=
{
0
},
LutNDecomp
[
8
]
=
{
0
};
int
i
,
k
,
iFan
,
nFanins
,
Status
;
Vec_Int_t
*
vLeaves
;
word
*
pTruth
;
vLeaves
=
Vec_IntAlloc
(
100
);
Gia_ObjComputeTruthTableStart
(
p
,
nCutMax
);
Gia_ManForEachLut
(
p
,
i
)
{
nFanins
=
Gia_ObjLutSize
(
p
,
i
);
assert
(
nFanins
<=
7
);
LutCount
[
Abc_MaxInt
(
nFanins
,
5
)]
++
;
if
(
nFanins
<=
5
)
continue
;
Vec_IntClear
(
vLeaves
);
Gia_LutForEachFanin
(
p
,
i
,
iFan
,
k
)
Vec_IntPush
(
vLeaves
,
iFan
);
pTruth
=
Gia_ObjComputeTruthTableCut
(
p
,
Gia_ManObj
(
p
,
i
),
vLeaves
);
// check if it is decomposable
Status
=
If_CutPerformCheck07
(
NULL
,
(
unsigned
*
)
pTruth
,
7
,
nFanins
,
NULL
);
if
(
Status
==
1
)
continue
;
LutNDecomp
[
nFanins
]
++
;
if
(
LutNDecomp
[
nFanins
]
>
10
)
continue
;
Kit_DsdPrintFromTruth
(
(
unsigned
*
)
pTruth
,
nFanins
);
printf
(
"
\n
"
);
}
Gia_ObjComputeTruthTableStop
(
p
);
printf
(
"LUT5 = %d "
,
LutCount
[
5
]
);
printf
(
"LUT6 = %d NonDec = %d (%.2f %%) "
,
LutCount
[
6
],
LutNDecomp
[
6
],
100
.
0
*
LutNDecomp
[
6
]
/
Abc_MaxInt
(
LutCount
[
6
],
1
)
);
printf
(
"LUT7 = %d NonDec = %d (%.2f %%) "
,
LutCount
[
7
],
LutNDecomp
[
7
],
100
.
0
*
LutNDecomp
[
7
]
/
Abc_MaxInt
(
LutCount
[
7
],
1
)
);
printf
(
"
\n
"
);
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
...
...
src/aig/gia/giaJf.c
View file @
27be3d01
...
...
@@ -1024,6 +1024,8 @@ void Jf_ObjComputeCuts( Jf_Man_t * p, Gia_Obj_t * pObj, int fEdge )
assert
(
pSto
[
c
]
->
pCut
[
0
]
<=
nOldSupp
);
if
(
pSto
[
c
]
->
pCut
[
0
]
<
nOldSupp
)
pSto
[
c
]
->
Sign
=
Jf_CutGetSign
(
pSto
[
c
]
->
pCut
);
if
(
pSto
[
c
]
->
iFunc
>=
(
1
<<
22
)
)
printf
(
"Hard limit on the number of different Boolean functions (2^21) is reached. Quitting...
\n
"
),
exit
(
1
);
}
else
{
...
...
src/base/abci/abc.c
View file @
27be3d01
...
...
@@ -374,6 +374,7 @@ static int Abc_CommandAbc9Embed ( Abc_Frame_t * pAbc, int argc, cha
static
int
Abc_CommandAbc9If
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9If2
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Jf
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Struct
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Trace
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Speedup
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Era
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
...
...
@@ -931,6 +932,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&if"
,
Abc_CommandAbc9If
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&if2"
,
Abc_CommandAbc9If2
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&jf"
,
Abc_CommandAbc9Jf
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&struct"
,
Abc_CommandAbc9Struct
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&trace"
,
Abc_CommandAbc9Trace
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&speedup"
,
Abc_CommandAbc9Speedup
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&era"
,
Abc_CommandAbc9Era
,
0
);
...
...
@@ -29988,6 +29990,65 @@ usage:
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_CommandAbc9Struct
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
extern
void
Gia_ManTestStruct
(
Gia_Man_t
*
p
);
Abc_Ntk_t
*
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
int
c
,
fVerbose
;
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
// set defaults
fVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"vh"
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'v'
:
fVerbose
^=
1
;
break
;
case
'h'
:
goto
usage
;
default:
goto
usage
;
}
}
if
(
pAbc
->
pGia
==
NULL
)
{
Abc_Print
(
-
1
,
"Abc_CommandAbc9Struct(): There is no AIG to map.
\n
"
);
return
1
;
}
if
(
!
Gia_ManHasMapping
(
pAbc
->
pGia
)
)
{
Abc_Print
(
-
1
,
"Abc_CommandAbc9Struct(): Mapping of the AIG is not defined.
\n
"
);
return
1
;
}
if
(
Gia_ManLutSizeMax
(
pAbc
->
pGia
)
>=
8
)
{
Abc_Print
(
-
1
,
"Abc_CommandAbc9Struct(): Can only handle nodes with less than 8 inputs.
\n
"
);
return
1
;
}
Gia_ManTestStruct
(
pAbc
->
pGia
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: &struct [-vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
checks decomposition structures of the current mapping
\n
"
);
Abc_Print
(
-
2
,
"
\t
-v : toggle printing optimization summary [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
}
/**Function*************************************************************
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