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
05ca4afb
Commit
05ca4afb
authored
Jul 10, 2015
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New TFI/TFO profiling code.
parent
3aece535
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
22 deletions
+50
-22
src/aig/gia/giaMuxes.c
+41
-17
src/base/abci/abc.c
+9
-5
No files found.
src/aig/gia/giaMuxes.c
View file @
05ca4afb
...
...
@@ -630,6 +630,7 @@ void Gia_ManMuxProfiling( Gia_Man_t * p )
ITEM(oXOR) \
ITEM(oMUXc) \
ITEM(oMUXd) \
ITEM(oAND) \
ITEM(oANDn) \
ITEM(oANDp) \
ITEM(GIA_END)
...
...
@@ -684,15 +685,16 @@ int Gia_ManEncodeFanin( Gia_Man_t * p, int iLit )
if
(
Gia_ObjIsMux
(
p
,
pObj
)
)
return
iMUX
;
assert
(
Gia_ObjIsAnd
(
pObj
)
);
if
(
Abc_LitIsCompl
(
iLit
)
)
return
iANDn
;
else
return
iANDp
;
return
iAND
;
// if ( Abc_LitIsCompl(iLit) )
// return iANDn;
// else
// return iANDp;
}
// find fanout code
int
Gia_ManEncodeFanout
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
int
i
)
{
int
iLit
;
//
int iLit;
if
(
Gia_ObjIsPo
(
p
,
pObj
)
)
return
oPO
;
if
(
Gia_ObjIsCo
(
pObj
)
)
...
...
@@ -702,11 +704,12 @@ int Gia_ManEncodeFanout( Gia_Man_t * p, Gia_Obj_t * pObj, int i )
if
(
Gia_ObjIsMux
(
p
,
pObj
)
)
return
i
==
2
?
oMUXc
:
oMUXd
;
assert
(
Gia_ObjIsAnd
(
pObj
)
);
iLit
=
i
?
Gia_ObjFaninLit1p
(
p
,
pObj
)
:
Gia_ObjFaninLit0p
(
p
,
pObj
);
if
(
Abc_LitIsCompl
(
iLit
)
)
return
oANDn
;
else
return
oANDp
;
return
oAND
;
// iLit = i ? Gia_ObjFaninLit1p(p, pObj) : Gia_ObjFaninLit0p(p, pObj);
// if ( Abc_LitIsCompl(iLit) )
// return oANDn;
// else
// return oANDp;
}
void
Gia_ManProfileCollect
(
Gia_Man_t
*
p
,
int
i
,
Vec_Int_t
*
vCode
,
Vec_Int_t
*
vCodeOffsets
,
Vec_Int_t
*
vArray
)
...
...
@@ -723,7 +726,7 @@ void Gia_ManProfilePrintOne( Gia_Man_t * p, int i, Vec_Int_t * vArray )
int
k
,
nFanins
,
nFanouts
;
if
(
Gia_ObjIsRi
(
p
,
pObj
)
)
return
;
nFanins
=
Gia_ObjFaninNum
(
p
,
pObj
);
nFanins
=
Gia_Obj
IsRo
(
p
,
pObj
)
?
1
:
Gia_Obj
FaninNum
(
p
,
pObj
);
nFanouts
=
Gia_ObjFanoutNum
(
p
,
pObj
);
printf
(
"%6d : "
,
i
);
...
...
@@ -734,8 +737,21 @@ void Gia_ManProfilePrintOne( Gia_Man_t * p, int i, Vec_Int_t * vArray )
printf
(
" ->"
);
printf
(
" %5s"
,
GIA_TYPE_STRINGS
[
Vec_IntEntry
(
vArray
,
0
)]
);
printf
(
" ->"
);
for
(
k
=
0
;
k
<
nFanouts
;
k
++
)
printf
(
" %5s"
,
GIA_TYPE_STRINGS
[
Vec_IntEntry
(
vArray
,
k
+
1
+
nFanins
)]
);
if
(
nFanouts
>
0
)
{
int
Count
=
1
,
Prev
=
Vec_IntEntry
(
vArray
,
1
+
nFanins
);
for
(
k
=
1
;
k
<
nFanouts
;
k
++
)
{
if
(
Prev
!=
Vec_IntEntry
(
vArray
,
k
+
1
+
nFanins
)
)
{
printf
(
" %d x %s"
,
Count
,
GIA_TYPE_STRINGS
[
Prev
]
);
Prev
=
Vec_IntEntry
(
vArray
,
k
+
1
+
nFanins
);
Count
=
0
;
}
Count
++
;
}
printf
(
" %d x %s"
,
Count
,
GIA_TYPE_STRINGS
[
Prev
]
);
}
printf
(
"
\n
"
);
}
...
...
@@ -785,9 +801,18 @@ void Gia_ManProfileStructuresInt( Gia_Man_t * p, int nLimit, int fVerbose )
Vec_IntPush
(
vCode
,
Gia_ManEncodeObj
(
p
,
i
)
);
if
(
nFanins
==
3
)
{
Vec_IntPush
(
vCode
,
Gia_ManEncodeFanin
(
p
,
Gia_ObjFaninLit0p
(
p
,
pObj
))
);
Vec_IntPush
(
vCode
,
Gia_ManEncodeFanin
(
p
,
Gia_ObjFaninLit1p
(
p
,
pObj
))
);
Vec_IntPush
(
vCode
,
Gia_ManEncodeFanin
(
p
,
Gia_ObjFaninLit2p
(
p
,
pObj
))
);
int
iLit
=
Gia_ObjFaninLit2p
(
p
,
pObj
);
Vec_IntPush
(
vCode
,
Gia_ManEncodeFanin
(
p
,
Abc_LitRegular
(
iLit
))
);
if
(
Abc_LitIsCompl
(
iLit
)
)
{
Vec_IntPush
(
vCode
,
Gia_ManEncodeFanin
(
p
,
Gia_ObjFaninLit0p
(
p
,
pObj
))
);
Vec_IntPush
(
vCode
,
Gia_ManEncodeFanin
(
p
,
Gia_ObjFaninLit1p
(
p
,
pObj
))
);
}
else
{
Vec_IntPush
(
vCode
,
Gia_ManEncodeFanin
(
p
,
Gia_ObjFaninLit1p
(
p
,
pObj
))
);
Vec_IntPush
(
vCode
,
Gia_ManEncodeFanin
(
p
,
Gia_ObjFaninLit0p
(
p
,
pObj
))
);
}
}
else
if
(
nFanins
==
2
)
{
...
...
@@ -856,7 +881,6 @@ void Gia_ManProfileStructuresInt( Gia_Man_t * p, int nLimit, int fVerbose )
// print the object
Gia_ManProfileCollect
(
p
,
Vec_IntEntry
(
vFirst
,
pPerm
[
i
]),
vCode
,
vCodeOffsets
,
vArray
);
Gia_ManProfilePrintOne
(
p
,
Vec_IntEntry
(
vFirst
,
pPerm
[
i
]),
vArray
);
//printf( "\n" );
}
// cleanup
...
...
src/base/abci/abc.c
View file @
05ca4afb
...
...
@@ -26727,9 +26727,9 @@ int Abc_CommandAbc9MuxProfile( Abc_Frame_t * pAbc, int argc, char ** argv )
{
extern
void
Gia_ManMuxProfiling
(
Gia_Man_t
*
p
);
extern
void
Gia_ManProfileStructures
(
Gia_Man_t
*
p
,
int
nLimit
,
int
fVerbose
);
int
c
,
nLimit
=
0
,
fVerbose
=
0
;
int
c
,
fMuxes
=
0
,
nLimit
=
0
,
fVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"Nvh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"N
m
vh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -26744,6 +26744,9 @@ int Abc_CommandAbc9MuxProfile( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
nLimit
<
0
)
goto
usage
;
break
;
case
'm'
:
fMuxes
^=
1
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
...
...
@@ -26758,16 +26761,17 @@ int Abc_CommandAbc9MuxProfile( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print
(
-
1
,
"Abc_CommandAbc9MuxProfile(): There is no AIG.
\n
"
);
return
1
;
}
if
(
nLimit
==
0
)
if
(
fMuxes
)
Gia_ManMuxProfiling
(
pAbc
->
pGia
);
else
Gia_ManProfileStructures
(
pAbc
->
pGia
,
nLimit
,
fVerbose
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: &profile [-N num] [-vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
profile
MUXes appearing in the design
\n
"
);
Abc_Print
(
-
2
,
"usage: &profile [-N num] [-
m
vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
profile
gate structures appearing in the AIG
\n
"
);
Abc_Print
(
-
2
,
"
\t
-N num : limit on class size to show [default = %d]
\n
"
,
nLimit
);
Abc_Print
(
-
2
,
"
\t
-m : toggle profiling MUX structures [default = %s]
\n
"
,
fMuxes
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : toggle verbose output [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