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
92ad58ff
Commit
92ad58ff
authored
Apr 13, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding iterative refinement to 'addbuffs'.
parent
7e21f012
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
10 deletions
+37
-10
src/base/abc/abcUtil.c
+24
-3
src/base/abci/abc.c
+13
-7
No files found.
src/base/abc/abcUtil.c
View file @
92ad58ff
...
...
@@ -2072,7 +2072,7 @@ Abc_Obj_t * Abc_NtkAddBuffsOne( Vec_Ptr_t * vBuffs, Abc_Obj_t * pFanin, int Leve
}
return
pBuffer
;
}
Abc_Ntk_t
*
Abc_NtkAddBuffs
(
Abc_Ntk_t
*
pNtkInit
,
int
fReverse
,
int
nImprove
,
int
fVerbose
)
Abc_Ntk_t
*
Abc_NtkAddBuffs
Int
(
Abc_Ntk_t
*
pNtkInit
,
int
fReverse
,
int
nImprove
,
int
fVerbose
)
{
Vec_Ptr_t
*
vBuffs
;
Abc_Ntk_t
*
pNtk
=
Abc_NtkDup
(
pNtkInit
);
...
...
@@ -2120,7 +2120,7 @@ Abc_Ntk_t * Abc_NtkAddBuffs( Abc_Ntk_t * pNtkInit, int fReverse, int nImprove, i
}
}
if
(
fVerbose
)
printf
(
"Shifted %
d nodes down with total gain %
d.
\n
"
,
Counter
,
TotalGain
);
printf
(
"Shifted %
5d nodes down with total gain %5
d.
\n
"
,
Counter
,
TotalGain
);
if
(
Counter
==
0
)
break
;
}
...
...
@@ -2155,7 +2155,7 @@ Abc_Ntk_t * Abc_NtkAddBuffs( Abc_Ntk_t * pNtkInit, int fReverse, int nImprove, i
}
}
if
(
fVerbose
)
printf
(
"Shifted %
d nodes up with total gain %
d.
\n
"
,
Counter
,
TotalGain
);
printf
(
"Shifted %
5d nodes up with total gain %5
d.
\n
"
,
Counter
,
TotalGain
);
if
(
Counter
==
0
)
break
;
}
...
...
@@ -2182,6 +2182,27 @@ Abc_Ntk_t * Abc_NtkAddBuffs( Abc_Ntk_t * pNtkInit, int fReverse, int nImprove, i
pObj
->
Level
=
0
;
return
pNtk
;
}
Abc_Ntk_t
*
Abc_NtkAddBuffs
(
Abc_Ntk_t
*
pNtkInit
,
int
fDirect
,
int
fReverse
,
int
nImprove
,
int
fVerbose
)
{
Abc_Ntk_t
*
pNtkD
,
*
pNtkR
;
if
(
fDirect
)
return
Abc_NtkAddBuffsInt
(
pNtkInit
,
0
,
nImprove
,
fVerbose
);
if
(
fReverse
)
return
Abc_NtkAddBuffsInt
(
pNtkInit
,
1
,
nImprove
,
fVerbose
);
pNtkD
=
Abc_NtkAddBuffsInt
(
pNtkInit
,
0
,
nImprove
,
fVerbose
);
pNtkR
=
Abc_NtkAddBuffsInt
(
pNtkInit
,
1
,
nImprove
,
fVerbose
);
if
(
Abc_NtkNodeNum
(
pNtkD
)
<
Abc_NtkNodeNum
(
pNtkR
)
)
{
Abc_NtkDelete
(
pNtkR
);
return
pNtkD
;
}
else
{
Abc_NtkDelete
(
pNtkD
);
return
pNtkR
;
}
}
/**Function*************************************************************
...
...
src/base/abci/abc.c
View file @
92ad58ff
...
...
@@ -4550,18 +4550,20 @@ usage:
***********************************************************************/
int
Abc_CommandAddBuffs
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
extern
Abc_Ntk_t
*
Abc_NtkAddBuffs
(
Abc_Ntk_t
*
pNtk
,
int
fReverse
,
int
nImprove
,
int
fVerbose
);
extern
Abc_Ntk_t
*
Abc_NtkAddBuffs
(
Abc_Ntk_t
*
pNtk
,
int
f
Direct
,
int
f
Reverse
,
int
nImprove
,
int
fVerbose
);
Abc_Ntk_t
*
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
Abc_Ntk_t
*
pNtkRes
;
int
c
,
fVerbose
;
int
fDirect
;
int
fReverse
;
int
nImprove
;
int
c
,
fVerbose
;
nImprove
=
100
0
;
fDirect
=
0
;
fReverse
=
0
;
nImprove
=
1000
;
fVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"Irvh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"I
d
rvh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -4576,6 +4578,9 @@ int Abc_CommandAddBuffs( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
nImprove
<
0
)
goto
usage
;
break
;
case
'd'
:
fDirect
^=
1
;
break
;
case
'r'
:
fReverse
^=
1
;
break
;
...
...
@@ -4601,7 +4606,7 @@ int Abc_CommandAddBuffs( Abc_Frame_t * pAbc, int argc, char ** argv )
}
// modify the current network
pNtkRes
=
Abc_NtkAddBuffs
(
pNtk
,
fReverse
,
nImprove
,
fVerbose
);
pNtkRes
=
Abc_NtkAddBuffs
(
pNtk
,
f
Direct
,
f
Reverse
,
nImprove
,
fVerbose
);
if
(
pNtkRes
==
NULL
)
{
Abc_Print
(
-
1
,
"The command has failed.
\n
"
);
...
...
@@ -4612,10 +4617,11 @@ int Abc_CommandAddBuffs( Abc_Frame_t * pAbc, int argc, char ** argv )
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: addbuffs [-I num] [-rvh]
\n
"
);
Abc_Print
(
-
2
,
"usage: addbuffs [-I num] [-
d
rvh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
adds buffers to create balanced CI/CO paths
\n
"
);
Abc_Print
(
-
2
,
"
\t
-I <num> : the number of refinement iterations [default = %d]
\n
"
,
nImprove
);
Abc_Print
(
-
2
,
"
\t
-r : toggle reversing the levelized order [default = %s]
\n
"
,
fReverse
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-d : toggle using only CI-to-CO levelized order [default = %s]
\n
"
,
fDirect
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-r : toggle using only CO-to-C1 levelized order [default = %s]
\n
"
,
fReverse
?
"yes"
:
"no"
);
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
;
...
...
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