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
c2b805dc
Commit
c2b805dc
authored
Jan 26, 2017
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding visualization of word-level networks Wlc_Ntk_t.
parent
64d7119d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
14 deletions
+31
-14
src/base/wlc/wlc.h
+1
-1
src/base/wlc/wlcCom.c
+22
-6
src/base/wlc/wlcNtk.c
+8
-7
No files found.
src/base/wlc/wlc.h
View file @
c2b805dc
...
...
@@ -293,7 +293,7 @@ extern void Wlc_NtkTransferNames( Wlc_Ntk_t * pNew, Wlc_Ntk_t * p );
extern
char
*
Wlc_NtkNewName
(
Wlc_Ntk_t
*
p
,
int
iCoId
,
int
fSeq
);
extern
Wlc_Ntk_t
*
Wlc_NtkDupDfs
(
Wlc_Ntk_t
*
p
,
int
fMarked
,
int
fSeq
);
extern
void
Wlc_NtkCleanMarks
(
Wlc_Ntk_t
*
p
);
extern
void
Wlc_NtkMarkCone
(
Wlc_Ntk_t
*
p
,
int
iCoId
,
int
fSeq
);
extern
void
Wlc_NtkMarkCone
(
Wlc_Ntk_t
*
p
,
int
iCoId
,
int
Range
,
int
fSeq
,
int
fAllPis
);
extern
void
Wlc_NtkProfileCones
(
Wlc_Ntk_t
*
p
);
extern
Wlc_Ntk_t
*
Wlc_NtkDupSingleNodes
(
Wlc_Ntk_t
*
p
);
extern
void
Wlc_NtkShortNames
(
Wlc_Ntk_t
*
p
);
...
...
src/base/wlc/wlcCom.c
View file @
c2b805dc
...
...
@@ -364,10 +364,10 @@ usage:
int
Abc_CommandCone
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
Wlc_Ntk_t
*
pNtk
=
Wlc_AbcGetNtk
(
pAbc
);
int
c
,
iOutput
=
-
1
,
fSeq
=
0
,
fVerbose
=
0
;
int
c
,
iOutput
=
-
1
,
Range
=
1
,
fAllPis
=
0
,
fSeq
=
0
,
fVerbose
=
0
;
char
*
pName
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"Osvh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"O
Ri
svh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -382,6 +382,20 @@ int Abc_CommandCone( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
iOutput
<
0
)
goto
usage
;
break
;
case
'R'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-R
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
Range
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
Range
<
0
)
goto
usage
;
break
;
case
'i'
:
fAllPis
^=
1
;
break
;
case
's'
:
fSeq
^=
1
;
break
;
...
...
@@ -406,16 +420,18 @@ int Abc_CommandCone( Abc_Frame_t * pAbc, int argc, char ** argv )
}
printf
(
"Extracting output %d as a %s word-level network.
\n
"
,
iOutput
,
fSeq
?
"sequential"
:
"combinational"
);
pName
=
Wlc_NtkNewName
(
pNtk
,
iOutput
,
fSeq
);
Wlc_NtkMarkCone
(
pNtk
,
iOutput
,
fSeq
);
Wlc_NtkMarkCone
(
pNtk
,
iOutput
,
Range
,
fSeq
,
fAllPis
);
pNtk
=
Wlc_NtkDupDfs
(
pNtk
,
1
,
fSeq
);
ABC_FREE
(
pNtk
->
pName
);
pNtk
->
pName
=
Abc_UtilStrsav
(
pName
);
Wlc_AbcUpdateNtk
(
pAbc
,
pNtk
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: %%cone [-O num] [-svh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
extracts cone of the given word-level output
\n
"
);
Abc_Print
(
-
2
,
"
\t
-O num : zero-based index of the word-level output to extract [default = %d]
\n
"
,
iOutput
);
Abc_Print
(
-
2
,
"usage: %%cone [-OR num] [-isvh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
extracts logic cone of one or more word-level outputs
\n
"
);
Abc_Print
(
-
2
,
"
\t
-O num : zero-based index of the first word-level output to extract [default = %d]
\n
"
,
iOutput
);
Abc_Print
(
-
2
,
"
\t
-R num : total number of word-level outputs to extract [default = %d]
\n
"
,
Range
);
Abc_Print
(
-
2
,
"
\t
-i : toggle using support composed of all primary inputs [default = %s]
\n
"
,
fAllPis
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-s : toggle performing extracting sequential cones [default = %s]
\n
"
,
fSeq
?
"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
"
);
...
...
src/base/wlc/wlcNtk.c
View file @
c2b805dc
...
...
@@ -314,7 +314,7 @@ void Wlc_NtkCollectStats( Wlc_Ntk_t * p, int nObjs[2][WLC_OBJ_NUMBER] )
return
;
for
(
n
=
0
;
n
<
2
;
n
++
)
{
Wlc_NtkMarkCone
(
p
,
n
,
1
);
Wlc_NtkMarkCone
(
p
,
n
,
1
,
1
,
0
);
Wlc_NtkForEachObj
(
p
,
pObj
,
i
)
if
(
pObj
->
Mark
)
nObjs
[
n
][
pObj
->
Type
]
++
;
...
...
@@ -325,7 +325,7 @@ int Wlc_NtkCountRealPis( Wlc_Ntk_t * p )
{
Wlc_Obj_t
*
pObj
;
int
i
,
Count
=
0
;
Wlc_NtkMarkCone
(
p
,
-
1
,
1
);
Wlc_NtkMarkCone
(
p
,
-
1
,
-
1
,
1
,
0
);
Wlc_NtkForEachPi
(
p
,
pObj
,
i
)
Count
+=
pObj
->
Mark
;
Wlc_NtkCleanMarks
(
p
);
...
...
@@ -859,17 +859,18 @@ void Wlc_NtkMarkCone_rec( Wlc_Ntk_t * p, Wlc_Obj_t * pObj, Vec_Int_t * vFlops )
Wlc_ObjForEachFanin
(
pObj
,
iFanin
,
i
)
Wlc_NtkMarkCone_rec
(
p
,
Wlc_NtkObj
(
p
,
iFanin
),
vFlops
);
}
void
Wlc_NtkMarkCone
(
Wlc_Ntk_t
*
p
,
int
iCoId
,
int
fSeq
)
void
Wlc_NtkMarkCone
(
Wlc_Ntk_t
*
p
,
int
iCoId
,
int
Range
,
int
fSeq
,
int
fAllPis
)
{
Vec_Int_t
*
vFlops
;
Wlc_Obj_t
*
pObj
;
int
i
,
CiId
,
CoId
;
Wlc_NtkCleanMarks
(
p
);
// Wlc_NtkForEachPi( p, pObj, i )
// pObj->Mark = 1;
if
(
fAllPis
)
Wlc_NtkForEachPi
(
p
,
pObj
,
i
)
pObj
->
Mark
=
1
;
vFlops
=
Vec_IntAlloc
(
100
);
Wlc_NtkForEachCo
(
p
,
pObj
,
i
)
if
(
iCoId
==
-
1
||
i
==
iCoId
)
if
(
iCoId
==
-
1
||
(
i
>=
iCoId
&&
i
<
iCoId
+
Range
)
)
Wlc_NtkMarkCone_rec
(
p
,
pObj
,
vFlops
);
if
(
fSeq
)
Vec_IntForEachEntry
(
vFlops
,
CiId
,
i
)
...
...
@@ -885,7 +886,7 @@ void Wlc_NtkProfileCones( Wlc_Ntk_t * p )
int
i
,
nPis
,
nFos
,
nNodes
,
nAdders
,
nMults
;
Wlc_NtkForEachCo
(
p
,
pObj
,
i
)
{
Wlc_NtkMarkCone
(
p
,
i
,
0
);
Wlc_NtkMarkCone
(
p
,
i
,
1
,
0
,
0
);
nNodes
=
Wlc_NtkCountMarked
(
p
,
&
nPis
,
&
nFos
,
&
nAdders
,
&
nMults
);
printf
(
"Cone %5d : "
,
i
);
printf
(
"PI = %4d "
,
nPis
);
...
...
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