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
6aa1c94e
Commit
6aa1c94e
authored
Sep 25, 2014
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enabling print-out, for each operator, of the percetage of AND nodes after bit-blasting.
parent
a1b4773c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
14 deletions
+35
-14
src/base/wlc/wlc.h
+2
-1
src/base/wlc/wlcBlast.c
+6
-0
src/base/wlc/wlcCom.c
+8
-3
src/base/wlc/wlcNtk.c
+19
-10
No files found.
src/base/wlc/wlc.h
View file @
6aa1c94e
...
...
@@ -115,6 +115,7 @@ struct Wlc_Ntk_t_
Vec_Int_t
vCos
;
// combinational outputs
Vec_Int_t
vFfs
;
// flops
int
nObjs
[
WLC_OBJ_NUMBER
];
// counter of objects of each type
int
nAnds
[
WLC_OBJ_NUMBER
];
// counter of AND gates after blasting
// memory for objects
Wlc_Obj_t
*
pObjs
;
int
iObj
;
...
...
@@ -218,7 +219,7 @@ extern void Wlc_ObjUpdateType( Wlc_Ntk_t * p, Wlc_Obj_t * pObj, int Ty
extern
void
Wlc_ObjAddFanins
(
Wlc_Ntk_t
*
p
,
Wlc_Obj_t
*
pObj
,
Vec_Int_t
*
vFanins
);
extern
void
Wlc_NtkFree
(
Wlc_Ntk_t
*
p
);
extern
void
Wlc_NtkPrintNodes
(
Wlc_Ntk_t
*
p
,
int
Type
);
extern
void
Wlc_NtkPrintStats
(
Wlc_Ntk_t
*
p
,
int
fVerbose
);
extern
void
Wlc_NtkPrintStats
(
Wlc_Ntk_t
*
p
,
int
f
Distrib
,
int
f
Verbose
);
extern
Wlc_Ntk_t
*
Wlc_NtkDupDfs
(
Wlc_Ntk_t
*
p
);
extern
void
Wlc_NtkTransferNames
(
Wlc_Ntk_t
*
pNew
,
Wlc_Ntk_t
*
p
);
/*=== wlcReadWord.c ========================================================*/
...
...
src/base/wlc/wlcBlast.c
View file @
6aa1c94e
...
...
@@ -352,9 +352,12 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p )
pNew
=
Gia_ManStart
(
5
*
Wlc_NtkObjNum
(
p
)
+
1000
);
pNew
->
pName
=
Abc_UtilStrsav
(
p
->
pName
);
Gia_ManHashAlloc
(
pNew
);
// clean AND-gate counters
memset
(
p
->
nAnds
,
0
,
sizeof
(
int
)
*
WLC_OBJ_NUMBER
);
// create primary inputs
Wlc_NtkForEachObj
(
p
,
pObj
,
i
)
{
int
nAndPrev
=
Gia_ManObjNum
(
pNew
);
// char * pName = Wlc_ObjName(p, i);
nRange
=
Wlc_ObjRange
(
pObj
);
nRange0
=
Wlc_ObjFaninNum
(
pObj
)
>
0
?
Wlc_ObjRange
(
Wlc_ObjFanin0
(
p
,
pObj
)
)
:
-
1
;
...
...
@@ -564,7 +567,10 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p )
assert
(
Vec_IntSize
(
vBits
)
==
Wlc_ObjCopy
(
p
,
i
)
);
Vec_IntAppend
(
vBits
,
vRes
);
pPrev
=
pObj
;
if
(
pObj
->
Type
!=
WLC_OBJ_PI
&&
pObj
->
Type
!=
WLC_OBJ_PO
)
p
->
nAnds
[
pObj
->
Type
]
+=
Gia_ManObjNum
(
pNew
)
-
nAndPrev
;
}
p
->
nAnds
[
0
]
=
Gia_ManAndNum
(
pNew
);
assert
(
nBits
==
Vec_IntSize
(
vBits
)
);
Vec_IntFree
(
vTemp0
);
Vec_IntFree
(
vTemp1
);
...
...
src/base/wlc/wlcCom.c
View file @
6aa1c94e
...
...
@@ -208,9 +208,10 @@ int Abc_CommandPs( Abc_Frame_t * pAbc, int argc, char ** argv )
Wlc_Ntk_t
*
pNtk
=
Wlc_AbcGetNtk
(
pAbc
);
int
fShowMulti
=
0
;
int
fShowAdder
=
0
;
int
fDistrib
=
0
;
int
c
,
fVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"mavh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"ma
d
vh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -220,6 +221,9 @@ int Abc_CommandPs( Abc_Frame_t * pAbc, int argc, char ** argv )
case
'a'
:
fShowAdder
^=
1
;
break
;
case
'd'
:
fDistrib
^=
1
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
...
...
@@ -234,17 +238,18 @@ int Abc_CommandPs( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print
(
1
,
"Abc_CommandPs(): There is no current design.
\n
"
);
return
0
;
}
Wlc_NtkPrintStats
(
pNtk
,
fVerbose
);
Wlc_NtkPrintStats
(
pNtk
,
f
Distrib
,
f
Verbose
);
if
(
fShowMulti
)
Wlc_NtkPrintNodes
(
pNtk
,
WLC_OBJ_ARI_MULTI
);
if
(
fShowAdder
)
Wlc_NtkPrintNodes
(
pNtk
,
WLC_OBJ_ARI_ADD
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: %%ps [-mavh]
\n
"
);
Abc_Print
(
-
2
,
"usage: %%ps [-ma
d
vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
prints statistics
\n
"
);
Abc_Print
(
-
2
,
"
\t
-m : toggle printing multipliers [default = %s]
\n
"
,
fShowMulti
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-a : toggle printing adders [default = %s]
\n
"
,
fShowAdder
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-d : toggle printing distrubition [default = %s]
\n
"
,
fDistrib
?
"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
;
...
...
src/base/wlc/wlcNtk.c
View file @
6aa1c94e
...
...
@@ -146,8 +146,8 @@ void Wlc_ObjUpdateType( Wlc_Ntk_t * p, Wlc_Obj_t * pObj, int Type )
{
if
(
pObj
->
Type
==
WLC_OBJ_PO
)
{
if
(
Type
!=
WLC_OBJ_BUF
)
printf
(
"Primary outputs should be driven by buffers.
\n
"
);
//
if ( Type != WLC_OBJ_BUF )
//
printf( "Primary outputs should be driven by buffers.\n" );
assert
(
Type
==
WLC_OBJ_BUF
);
return
;
}
...
...
@@ -303,7 +303,7 @@ void Wlc_NtkPrintDistrib( Wlc_Ntk_t * p, int fVerbose )
Vec_Wrd_t
*
vOccur
=
(
Vec_Wrd_t
*
)
Vec_PtrEntry
(
vOccurs
,
i
);
if
(
p
->
nObjs
[
i
]
==
0
)
continue
;
printf
(
"%2d : %
6d %-8s "
,
i
,
p
->
nObjs
[
i
],
Wlc_Name
s
[
i
]
);
printf
(
"%2d : %
-8s %6d "
,
i
,
Wlc_Names
[
i
],
p
->
nObj
s
[
i
]
);
// sort by occurence
Wlc_NtkPrintDistribSortOne
(
vTypes
,
vOccurs
,
i
);
Vec_WrdForEachEntry
(
vType
,
Sign
,
k
)
...
...
@@ -345,7 +345,7 @@ void Wlc_NtkPrintNodes( Wlc_Ntk_t * p, int Type )
printf
(
"
\n
"
);
}
}
void
Wlc_NtkPrintStats
(
Wlc_Ntk_t
*
p
,
int
fVerbose
)
void
Wlc_NtkPrintStats
(
Wlc_Ntk_t
*
p
,
int
f
Distrib
,
int
f
Verbose
)
{
int
i
;
printf
(
"%-20s : "
,
p
->
pName
);
...
...
@@ -357,12 +357,21 @@ void Wlc_NtkPrintStats( Wlc_Ntk_t * p, int fVerbose )
printf
(
"
\n
"
);
if
(
!
fVerbose
)
return
;
printf
(
"Node type statisticts:
\n
"
);
Wlc_NtkPrintDistrib
(
p
,
fVerbose
);
return
;
for
(
i
=
0
;
i
<
WLC_OBJ_NUMBER
;
i
++
)
if
(
p
->
nObjs
[
i
]
)
printf
(
"%2d : %6d %-8s
\n
"
,
i
,
p
->
nObjs
[
i
],
Wlc_Names
[
i
]
);
if
(
fDistrib
)
{
Wlc_NtkPrintDistrib
(
p
,
fVerbose
);
return
;
}
printf
(
"Node type statistics:
\n
"
);
for
(
i
=
1
;
i
<
WLC_OBJ_NUMBER
;
i
++
)
{
if
(
!
p
->
nObjs
[
i
]
)
continue
;
if
(
p
->
nAnds
[
0
]
&&
p
->
nAnds
[
i
]
)
printf
(
"%2d : %-8s %6d %7.2f %%
\n
"
,
i
,
Wlc_Names
[
i
],
p
->
nObjs
[
i
],
100
.
0
*
p
->
nAnds
[
i
]
/
p
->
nAnds
[
0
]
);
else
printf
(
"%2d : %-8s %6d
\n
"
,
i
,
Wlc_Names
[
i
],
p
->
nObjs
[
i
]
);
}
}
/**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