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
1c31dbe7
Commit
1c31dbe7
authored
Mar 23, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added command 'addbuffs' to create balanced CI/CO paths.
parent
0792ab0e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
123 additions
and
0 deletions
+123
-0
src/base/abc/abcUtil.c
+57
-0
src/base/abci/abc.c
+66
-0
No files found.
src/base/abc/abcUtil.c
View file @
1c31dbe7
...
...
@@ -2001,9 +2001,66 @@ void Abc_NtkPrintCiLevels( Abc_Ntk_t * pNtk )
Abc_NtkForEachCi
(
pNtk
,
pObj
,
i
)
printf
(
"%c=%d "
,
'a'
+
i
,
pObj
->
Level
);
printf
(
"
\n
"
);
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Abc_Obj_t
*
Abc_NtkAddBuffsOne
(
Vec_Ptr_t
*
vBuffs
,
Abc_Obj_t
*
pFanin
,
int
Level
,
int
nLevelMax
)
{
Abc_Obj_t
*
pBuffer
;
assert
(
Level
-
1
>=
Abc_ObjLevel
(
pFanin
)
);
pBuffer
=
(
Abc_Obj_t
*
)
Vec_PtrEntry
(
vBuffs
,
Abc_ObjId
(
pFanin
)
*
nLevelMax
+
Level
);
if
(
pBuffer
==
NULL
)
{
if
(
Level
-
1
==
Abc_ObjLevel
(
pFanin
)
)
pBuffer
=
pFanin
;
else
pBuffer
=
Abc_NtkAddBuffsOne
(
vBuffs
,
pFanin
,
Level
-
1
,
nLevelMax
);
pBuffer
=
Abc_NtkCreateNodeBuf
(
Abc_ObjNtk
(
pFanin
),
pBuffer
);
Vec_PtrWriteEntry
(
vBuffs
,
Abc_ObjId
(
pFanin
)
*
nLevelMax
+
Level
,
pBuffer
);
}
return
pBuffer
;
}
Abc_Ntk_t
*
Abc_NtkAddBuffs
(
Abc_Ntk_t
*
pNtkInit
,
int
fVerbose
)
{
Vec_Ptr_t
*
vBuffs
;
Abc_Ntk_t
*
pNtk
=
Abc_NtkDup
(
pNtkInit
);
Abc_Obj_t
*
pObj
,
*
pFanin
,
*
pBuffer
;
int
i
,
k
,
nLevelMax
=
Abc_NtkLevel
(
pNtk
);
Abc_NtkForEachCo
(
pNtk
,
pObj
,
i
)
pObj
->
Level
=
nLevelMax
+
1
;
vBuffs
=
Vec_PtrStart
(
Abc_NtkObjNumMax
(
pNtk
)
*
nLevelMax
);
Abc_NtkForEachObj
(
pNtk
,
pObj
,
i
)
{
if
(
i
==
Vec_PtrSize
(
vBuffs
)
/
nLevelMax
)
break
;
if
(
!
Abc_ObjIsNode
(
pObj
)
&&
!
Abc_ObjIsCo
(
pObj
)
)
continue
;
Abc_ObjForEachFanin
(
pObj
,
pFanin
,
k
)
{
assert
(
Abc_ObjLevel
(
pObj
)
-
1
>=
Abc_ObjLevel
(
pFanin
)
);
if
(
Abc_ObjLevel
(
pObj
)
-
1
==
Abc_ObjLevel
(
pFanin
)
)
continue
;
pBuffer
=
Abc_NtkAddBuffsOne
(
vBuffs
,
pFanin
,
Abc_ObjLevel
(
pObj
)
-
1
,
nLevelMax
);
Abc_ObjPatchFanin
(
pObj
,
pFanin
,
pBuffer
);
}
}
Vec_PtrFree
(
vBuffs
);
Abc_NtkForEachCo
(
pNtk
,
pObj
,
i
)
pObj
->
Level
=
0
;
return
pNtk
;
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
...
...
src/base/abci/abc.c
View file @
1c31dbe7
...
...
@@ -106,6 +106,7 @@ static int Abc_CommandMfs ( Abc_Frame_t * pAbc, int argc, cha
static
int
Abc_CommandTrace
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandSpeedup
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandPowerdown
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAddBuffs
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
//static int Abc_CommandMerge ( Abc_Frame_t * pAbc, int argc, char ** argv );
static
int
Abc_CommandRewrite
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
...
...
@@ -550,6 +551,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"trace"
,
Abc_CommandTrace
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"speedup"
,
Abc_CommandSpeedup
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"powerdown"
,
Abc_CommandPowerdown
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"addbuffs"
,
Abc_CommandAddBuffs
,
1
);
// Cmd_CommandAdd( pAbc, "Synthesis", "merge", Abc_CommandMerge, 1 );
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"rewrite"
,
Abc_CommandRewrite
,
1
);
...
...
@@ -4526,6 +4528,70 @@ usage:
return
1
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_CommandAddBuffs
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
extern
Abc_Ntk_t
*
Abc_NtkAddBuffs
(
Abc_Ntk_t
*
pNtk
,
int
fVerbose
);
Abc_Ntk_t
*
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
Abc_Ntk_t
*
pNtkRes
;
int
c
,
fVerbose
;
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
(
pNtk
==
NULL
)
{
Abc_Print
(
-
1
,
"Empty network.
\n
"
);
return
1
;
}
if
(
!
Abc_NtkIsLogic
(
pNtk
)
)
{
Abc_Print
(
-
1
,
"This command can only be applied to a logic network.
\n
"
);
return
1
;
}
// modify the current network
pNtkRes
=
Abc_NtkAddBuffs
(
pNtk
,
fVerbose
);
if
(
pNtkRes
==
NULL
)
{
Abc_Print
(
-
1
,
"The command has failed.
\n
"
);
return
1
;
}
// replace the current network
Abc_FrameReplaceCurrentNetwork
(
pAbc
,
pNtkRes
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: addbuffs [-vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
adds buffers to create balanced CI/CO paths
\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
;
}
#if 0
/**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