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
6d05fde2
Commit
6d05fde2
authored
Sep 16, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added delay multipliers to 'map'.
parent
bbf4b8bc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
22 deletions
+63
-22
src/base/abci/abc.c
+23
-9
src/base/abci/abcMap.c
+13
-8
src/map/mio/mio.h
+2
-1
src/map/mio/mioUtils.c
+25
-4
No files found.
src/base/abci/abc.c
View file @
6d05fde2
...
...
@@ -13006,26 +13006,28 @@ int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv )
char
Buffer
[
100
];
double
DelayTarget
;
double
AreaMulti
;
double
DelayMulti
;
int
fAreaOnly
;
int
fRecovery
;
int
fSweep
;
int
fSwitching
;
int
fVerbose
;
int
c
;
extern
Abc_Ntk_t
*
Abc_NtkMap
(
Abc_Ntk_t
*
pNtk
,
double
DelayTarget
,
double
AreaMulti
,
int
fRecovery
,
int
fSwitching
,
int
fVerbose
);
extern
Abc_Ntk_t
*
Abc_NtkMap
(
Abc_Ntk_t
*
pNtk
,
double
DelayTarget
,
double
AreaMulti
,
double
DelayMulti
,
int
fRecovery
,
int
fSwitching
,
int
fVerbose
);
extern
int
Abc_NtkFraigSweep
(
Abc_Ntk_t
*
pNtk
,
int
fUseInv
,
int
fExdc
,
int
fVerbose
,
int
fVeryVerbose
);
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
// set defaults
DelayTarget
=-
1
;
AreaMulti
=
0
;
DelayMulti
=
0
;
fAreaOnly
=
0
;
fRecovery
=
1
;
fSweep
=
1
;
fSwitching
=
0
;
fVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"D
M
arspvh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"D
AB
arspvh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -13040,16 +13042,27 @@ int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
DelayTarget
<=
0
.
0
)
goto
usage
;
break
;
case
'
M
'
:
case
'
A
'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-
M
\"
should be followed by a floating point number.
\n
"
);
Abc_Print
(
-
1
,
"Command line switch
\"
-
A
\"
should be followed by a floating point number.
\n
"
);
goto
usage
;
}
AreaMulti
=
(
float
)
atof
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
AreaMulti
<
0
.
0
)
// if ( AreaMulti < 0.0 )
// goto usage;
break
;
case
'B'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-B
\"
should be followed by a floating point number.
\n
"
);
goto
usage
;
}
DelayMulti
=
(
float
)
atof
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
// if ( DelayMulti < 0.0 )
// goto usage;
break
;
case
'a'
:
fAreaOnly
^=
1
;
...
...
@@ -13099,7 +13112,7 @@ int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv )
}
Abc_Print
(
0
,
"The network was strashed and balanced before mapping.
\n
"
);
// get the new network
pNtkRes
=
Abc_NtkMap
(
pNtk
,
DelayTarget
,
AreaMulti
,
fRecovery
,
fSwitching
,
fVerbose
);
pNtkRes
=
Abc_NtkMap
(
pNtk
,
DelayTarget
,
AreaMulti
,
DelayMulti
,
fRecovery
,
fSwitching
,
fVerbose
);
if
(
pNtkRes
==
NULL
)
{
Abc_NtkDelete
(
pNtk
);
...
...
@@ -13111,7 +13124,7 @@ int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv )
else
{
// get the new network
pNtkRes
=
Abc_NtkMap
(
pNtk
,
DelayTarget
,
AreaMulti
,
fRecovery
,
fSwitching
,
fVerbose
);
pNtkRes
=
Abc_NtkMap
(
pNtk
,
DelayTarget
,
AreaMulti
,
DelayMulti
,
fRecovery
,
fSwitching
,
fVerbose
);
if
(
pNtkRes
==
NULL
)
{
Abc_Print
(
-
1
,
"Mapping has failed.
\n
"
);
...
...
@@ -13138,10 +13151,11 @@ usage:
sprintf
(
Buffer
,
"not used"
);
else
sprintf
(
Buffer
,
"%.3f"
,
DelayTarget
);
Abc_Print
(
-
2
,
"usage: map [-D
M
float] [-arspvh]
\n
"
);
Abc_Print
(
-
2
,
"usage: map [-D
AB
float] [-arspvh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
performs standard cell mapping of the current network
\n
"
);
Abc_Print
(
-
2
,
"
\t
-D float : sets the global required times [default = %s]
\n
"
,
Buffer
);
Abc_Print
(
-
2
,
"
\t
-M float :
\"
area multiplier
\"
to discourage large gates [default = %.2f]
\n
"
,
AreaMulti
);
Abc_Print
(
-
2
,
"
\t
-A float :
\"
area multiplier
\"
to bias gate selection [default = %.2f]
\n
"
,
AreaMulti
);
Abc_Print
(
-
2
,
"
\t
-B float :
\"
delay multiplier
\"
to bias gate selection [default = %.2f]
\n
"
,
DelayMulti
);
Abc_Print
(
-
2
,
"
\t
-a : toggles area-only mapping [default = %s]
\n
"
,
fAreaOnly
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-r : toggles area recovery [default = %s]
\n
"
,
fRecovery
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-s : toggles sweep after mapping [default = %s]
\n
"
,
fSweep
?
"yes"
:
"no"
);
...
...
src/base/abci/abcMap.c
View file @
6d05fde2
...
...
@@ -57,7 +57,7 @@ static Abc_Obj_t * Abc_NodeFromMapSuperChoice_rec( Abc_Ntk_t * pNtkNew, Map_Sup
SeeAlso []
***********************************************************************/
Abc_Ntk_t
*
Abc_NtkMap
(
Abc_Ntk_t
*
pNtk
,
double
DelayTarget
,
double
AreaMulti
,
int
fRecovery
,
int
fSwitching
,
int
fVerbose
)
Abc_Ntk_t
*
Abc_NtkMap
(
Abc_Ntk_t
*
pNtk
,
double
DelayTarget
,
double
AreaMulti
,
double
DelayMulti
,
int
fRecovery
,
int
fSwitching
,
int
fVerbose
)
{
int
fShowSwitching
=
1
;
Abc_Ntk_t
*
pNtkNew
;
...
...
@@ -76,22 +76,27 @@ Abc_Ntk_t * Abc_NtkMap( Abc_Ntk_t * pNtk, double DelayTarget, double AreaMulti,
return
0
;
}
// penalize large gates by increasing their area
Mio_LibraryMultiArea
(
pLib
,
AreaMulti
);
Mio_LibraryMultiDelay
(
pLib
,
DelayMulti
);
// derive the supergate library
if
(
Abc_FrameReadLibSuper
()
==
NULL
&&
pLib
)
{
// printf( "A simple supergate library is derived from gate library \"%s\".\n",
// Mio_LibraryReadName((Mio_Library_t *)Abc_FrameReadLibGen()) );
// penalize large gates by increasing their area
Mio_LibraryShiftArea
(
pLib
,
AreaMulti
);
// compute supergate library to be used for mapping
Map_SuperLibDeriveFromGenlib
(
pLib
);
// return the library to normal
Mio_LibraryShiftArea
(
Abc_FrameReadLibGen
(),
-
AreaMulti
);
if
(
AreaMulti
!=
0
.
0
)
printf
(
"The cell areas are multiplied by the factor: <num_fanins> ^ (%.2f).
\n
"
,
AreaMulti
);
}
// return the library to normal
Mio_LibraryMultiArea
(
Abc_FrameReadLibGen
(),
-
AreaMulti
);
Mio_LibraryMultiDelay
(
Abc_FrameReadLibGen
(),
-
DelayMulti
);
if
(
AreaMulti
!=
0
.
0
)
printf
(
"The cell areas are multiplied by the factor: <num_fanins> ^ (%.2f).
\n
"
,
AreaMulti
);
if
(
DelayMulti
!=
0
.
0
)
printf
(
"The cell delay are multiplied by the factor: <num_fanins> ^ (%.2f).
\n
"
,
DelayMulti
);
// print a warning about choice nodes
if
(
Abc_NtkGetChoiceNum
(
pNtk
)
)
printf
(
"Performing mapping with choices.
\n
"
);
...
...
src/map/mio/mio.h
View file @
6d05fde2
...
...
@@ -150,7 +150,8 @@ extern void Mio_DeriveGateDelays( Mio_Gate_t * pGate,
float
*
ptDelaysRes
,
float
*
ptPinDelayMax
);
extern
Mio_Gate_t
*
Mio_GateCreatePseudo
(
int
nInputs
);
extern
void
Mio_LibraryShiftDelay
(
Mio_Library_t
*
pLib
,
double
Shift
);
extern
void
Mio_LibraryShiftArea
(
Mio_Library_t
*
pLib
,
double
Shift
);
extern
void
Mio_LibraryMultiArea
(
Mio_Library_t
*
pLib
,
double
Multi
);
extern
void
Mio_LibraryMultiDelay
(
Mio_Library_t
*
pLib
,
double
Multi
);
ABC_NAMESPACE_HEADER_END
...
...
src/map/mio/mioUtils.c
View file @
6d05fde2
...
...
@@ -610,7 +610,7 @@ void Mio_LibraryShiftDelay( Mio_Library_t * pLib, double Shift )
/**Function*************************************************************
Synopsis [Multiply areas
of all gate
s by values proportional to fanin count.]
Synopsis [Multiply areas
/delay
s by values proportional to fanin count.]
Description []
...
...
@@ -619,14 +619,35 @@ void Mio_LibraryShiftDelay( Mio_Library_t * pLib, double Shift )
SeeAlso []
***********************************************************************/
void
Mio_Library
ShiftArea
(
Mio_Library_t
*
pLib
,
double
Shift
)
void
Mio_Library
MultiArea
(
Mio_Library_t
*
pLib
,
double
Multi
)
{
Mio_Gate_t
*
pGate
;
Mio_LibraryForEachGate
(
pLib
,
pGate
)
{
if
(
pGate
->
nInputs
<
2
)
continue
;
// printf( "Before %8.3f ", pGate->dArea );
pGate
->
dArea
*=
pow
(
pGate
->
nInputs
,
Shift
);
// printf( "After %8.3f Inputs = %d. Factor = %8.3f\n", pGate->dArea, pGate->nInputs, pow( pGate->nInputs, Shift ) );
pGate
->
dArea
*=
pow
(
pGate
->
nInputs
,
Multi
);
// printf( "After %8.3f Inputs = %d. Factor = %8.3f\n", pGate->dArea, pGate->nInputs, pow( pGate->nInputs, Multi ) );
}
}
void
Mio_LibraryMultiDelay
(
Mio_Library_t
*
pLib
,
double
Multi
)
{
Mio_Gate_t
*
pGate
;
Mio_Pin_t
*
pPin
;
Mio_LibraryForEachGate
(
pLib
,
pGate
)
{
if
(
pGate
->
nInputs
<
2
)
continue
;
// printf( "Before %8.3f ", pGate->dDelayMax );
pGate
->
dDelayMax
*=
pow
(
pGate
->
nInputs
,
Multi
);
// printf( "After %8.3f Inputs = %d. Factor = %8.3f\n", pGate->dDelayMax, pGate->nInputs, pow( pGate->nInputs, Multi ) );
Mio_GateForEachPin
(
pGate
,
pPin
)
{
pPin
->
dDelayBlockRise
*=
pow
(
pGate
->
nInputs
,
Multi
);
pPin
->
dDelayBlockFall
*=
pow
(
pGate
->
nInputs
,
Multi
);
pPin
->
dDelayBlockMax
*=
pow
(
pGate
->
nInputs
,
Multi
);
}
}
}
...
...
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