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
8c0e0d71
Commit
8c0e0d71
authored
Aug 31, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added command 'print_gs' to print gate sizes in the mapping.
parent
e63c603e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
141 additions
and
7 deletions
+141
-7
src/map/scl/scl.c
+61
-6
src/map/scl/sclInt.h
+1
-0
src/map/scl/sclSize.c
+32
-1
src/map/scl/sclTime.c
+1
-0
src/map/scl/sclUtil.c
+46
-0
No files found.
src/map/scl/scl.c
View file @
8c0e0d71
...
...
@@ -31,6 +31,7 @@ ABC_NAMESPACE_IMPL_START
static
int
Scl_CommandRead
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Scl_CommandWrite
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Scl_CommandPrint
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Scl_CommandPrintGS
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Scl_CommandStime
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Scl_CommandBuffer
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Scl_CommandGsize
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
...
...
@@ -52,12 +53,13 @@ static int Scl_CommandGsize ( Abc_Frame_t * pAbc, int argc, char **argv );
***********************************************************************/
void
Scl_Init
(
Abc_Frame_t
*
pAbc
)
{
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"read_scl"
,
Scl_CommandRead
,
0
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"write_scl"
,
Scl_CommandWrite
,
0
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"print_scl"
,
Scl_CommandPrint
,
0
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"stime"
,
Scl_CommandStime
,
0
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"buffer"
,
Scl_CommandBuffer
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"gsize"
,
Scl_CommandGsize
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"read_scl"
,
Scl_CommandRead
,
0
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"write_scl"
,
Scl_CommandWrite
,
0
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"print_scl"
,
Scl_CommandPrint
,
0
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"print_gs"
,
Scl_CommandPrintGS
,
0
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"stime"
,
Scl_CommandStime
,
0
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"buffer"
,
Scl_CommandBuffer
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SCL mapping"
,
"gsize"
,
Scl_CommandGsize
,
1
);
}
void
Scl_End
(
Abc_Frame_t
*
pAbc
)
{
...
...
@@ -229,6 +231,59 @@ usage:
SeeAlso []
***********************************************************************/
int
Scl_CommandPrintGS
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
int
c
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"h"
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'h'
:
goto
usage
;
default:
goto
usage
;
}
}
if
(
Abc_FrameReadNtk
(
pAbc
)
==
NULL
)
{
fprintf
(
pAbc
->
Err
,
"There is no current network.
\n
"
);
return
1
;
}
if
(
!
Abc_NtkHasMapping
(
Abc_FrameReadNtk
(
pAbc
))
)
{
fprintf
(
pAbc
->
Err
,
"The current network is not mapped.
\n
"
);
return
1
;
}
if
(
pAbc
->
pLibScl
==
NULL
)
{
fprintf
(
pAbc
->
Err
,
"There is no Liberty library available.
\n
"
);
return
1
;
}
// save current library
Abc_SclPrintGateSizes
(
pAbc
->
pLibScl
,
Abc_FrameReadNtk
(
pAbc
)
);
return
0
;
usage:
fprintf
(
pAbc
->
Err
,
"usage: print_gs [-h]
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
prints gate sizes in the current mapping
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
-h : print the help massage
\n
"
);
return
1
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Scl_CommandStime
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
int
c
;
...
...
src/map/scl/sclInt.h
View file @
8c0e0d71
...
...
@@ -423,6 +423,7 @@ extern void Abc_SclLinkCells( SC_Lib * p );
extern
void
Abc_SclPrintCells
(
SC_Lib
*
p
);
extern
Vec_Int_t
*
Abc_SclManFindGates
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
p
);
extern
void
Abc_SclManSetGates
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
p
,
Vec_Int_t
*
vGates
);
extern
void
Abc_SclPrintGateSizes
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
p
);
...
...
src/map/scl/sclSize.c
View file @
8c0e0d71
...
...
@@ -246,7 +246,7 @@ Vec_Int_t * Abc_SclCollectTfo( Abc_Ntk_t * p, Abc_Obj_t * pObj, Vec_Int_t * vPiv
SeeAlso []
***********************************************************************/
SC_Cell
*
Abc_SclObjResiable
(
SC_Man
*
p
,
Abc_Obj_t
*
pObj
,
int
fUpsize
)
static
inline
SC_Cell
*
Abc_SclObjResiable
(
SC_Man
*
p
,
Abc_Obj_t
*
pObj
,
int
fUpsize
)
{
SC_Cell
*
pOld
=
Abc_SclObjCell
(
p
,
pObj
);
if
(
fUpsize
)
...
...
@@ -353,6 +353,37 @@ void Abc_SclUpdateNetwork( SC_Man * p, Abc_Obj_t * pObj, int nCone, int fUpsize,
}
}
/**Function*************************************************************
Synopsis [Begin by upsizing gates will many fanouts.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Abc_SclManUpsize
(
SC_Man
*
p
)
{
SC_Cell
*
pOld
,
*
pNew
;
Abc_Obj_t
*
pObj
;
int
i
;
Abc_NtkForEachNode1
(
p
->
pNtk
,
pObj
,
i
)
{
if
(
Abc_ObjFanoutNum
(
pObj
)
<=
2
)
continue
;
// find new gate
pOld
=
Abc_SclObjCell
(
p
,
pObj
);
pNew
=
Abc_SclObjResiable
(
p
,
pObj
,
1
);
if
(
pNew
==
NULL
)
continue
;
Vec_IntWriteEntry
(
p
->
vGates
,
Abc_ObjId
(
pObj
),
Abc_SclCellFind
(
p
->
pLib
,
pNew
->
pName
)
);
}
}
/**Function*************************************************************
Synopsis []
...
...
src/map/scl/sclTime.c
View file @
8c0e0d71
...
...
@@ -262,6 +262,7 @@ SC_Man * Abc_SclManStart( SC_Lib * pLib, Abc_Ntk_t * pNtk )
SC_Man
*
p
=
Abc_SclManAlloc
(
pLib
,
pNtk
);
assert
(
p
->
vGates
==
NULL
);
p
->
vGates
=
Abc_SclManFindGates
(
pLib
,
pNtk
);
// Abc_SclManUpsize( p );
Abc_SclComputeLoad
(
p
);
Abc_SclTimeNtk
(
p
);
p
->
SumArea
=
p
->
SumArea0
=
Abc_SclGetTotalArea
(
p
);
...
...
src/map/scl/sclUtil.c
View file @
8c0e0d71
...
...
@@ -221,6 +221,52 @@ void Abc_SclManSetGates( SC_Lib * pLib, Abc_Ntk_t * p, Vec_Int_t * vGates )
}
}
/**Function*************************************************************
Synopsis [Reports percentage of gates of each size.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
#define ABC_SCL_MAX_SIZE 64
void
Abc_SclManPrintGateSizes
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
p
,
Vec_Int_t
*
vGates
)
{
Abc_Obj_t
*
pObj
;
int
i
,
nGates
=
0
,
Counters
[
ABC_SCL_MAX_SIZE
]
=
{
0
};
double
TotArea
=
0
,
Areas
[
ABC_SCL_MAX_SIZE
]
=
{
0
};
Abc_NtkForEachNode1
(
p
,
pObj
,
i
)
{
SC_Cell
*
pCell
=
SC_LibCell
(
pLib
,
Vec_IntEntry
(
vGates
,
Abc_ObjId
(
pObj
))
);
assert
(
pCell
->
Order
<
ABC_SCL_MAX_SIZE
);
Counters
[
pCell
->
Order
]
++
;
Areas
[
pCell
->
Order
]
+=
pCell
->
area
;
TotArea
+=
pCell
->
area
;
nGates
++
;
}
printf
(
"Total gates = %d. Total area = %.1f
\n
"
,
nGates
,
TotArea
);
for
(
i
=
0
;
i
<
ABC_SCL_MAX_SIZE
;
i
++
)
{
if
(
Counters
[
i
]
==
0
)
continue
;
printf
(
"Cell size = %d. "
,
i
);
printf
(
"Count = %6d "
,
Counters
[
i
]
);
printf
(
"(%5.1f %%) "
,
100
.
0
*
Counters
[
i
]
/
nGates
);
printf
(
"Area = %12.1f "
,
Areas
[
i
]
);
printf
(
"(%5.1f %%) "
,
100
.
0
*
Areas
[
i
]
/
TotArea
);
printf
(
"
\n
"
);
}
}
void
Abc_SclPrintGateSizes
(
SC_Lib
*
pLib
,
Abc_Ntk_t
*
p
)
{
Vec_Int_t
*
vGates
;
vGates
=
Abc_SclManFindGates
(
pLib
,
p
);
Abc_SclManPrintGateSizes
(
pLib
,
p
,
vGates
);
Vec_IntFree
(
vGates
);
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
...
...
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