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
a43d8273
Commit
a43d8273
authored
Oct 24, 2015
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes for delay-oriented computation.
parent
61d46232
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
22 deletions
+42
-22
src/base/abci/abc.c
+14
-2
src/opt/sfm/sfm.h
+1
-0
src/opt/sfm/sfmDec.c
+0
-0
src/opt/sfm/sfmInt.h
+2
-2
src/opt/sfm/sfmLib.c
+10
-6
src/opt/sfm/sfmTime.c
+15
-12
No files found.
src/base/abci/abc.c
View file @
a43d8273
...
...
@@ -5173,7 +5173,7 @@ int Abc_CommandMfs3( Abc_Frame_t * pAbc, int argc, char ** argv )
// set defaults
Sfm_ParSetDefault3
(
pPars
);
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"OIFLHDMCNPdamzospvwh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"OIFLHDMCNP
W
damzospvwh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -5290,6 +5290,17 @@ int Abc_CommandMfs3( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
pPars
->
iNodeOne
<
0
)
goto
usage
;
break
;
case
'W'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-W
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
pPars
->
nTimeWin
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
pPars
->
nTimeWin
<
0
||
pPars
->
nTimeWin
>
100
)
goto
usage
;
break
;
case
'a'
:
pPars
->
fArea
^=
1
;
break
;
...
...
@@ -5335,7 +5346,7 @@ int Abc_CommandMfs3( Abc_Frame_t * pAbc, int argc, char ** argv )
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: mfs3 [-OIFLHDMCNP <num>] [-amzospvwh]
\n
"
);
Abc_Print
(
-
2
,
"usage: mfs3 [-OIFLHDMCNP
W
<num>] [-amzospvwh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
performs don't-care-based optimization of mapped networks
\n
"
);
Abc_Print
(
-
2
,
"
\t
-O <num> : the number of levels in the TFO cone (0 <= num) [default = %d]
\n
"
,
pPars
->
nTfoLevMax
);
Abc_Print
(
-
2
,
"
\t
-I <num> : the number of levels in the TFI cone (1 <= num) [default = %d]
\n
"
,
pPars
->
nTfiLevMax
);
...
...
@@ -5347,6 +5358,7 @@ usage:
Abc_Print
(
-
2
,
"
\t
-C <num> : the max number of conflicts in one SAT run (0 = no limit) [default = %d]
\n
"
,
pPars
->
nBTLimit
);
Abc_Print
(
-
2
,
"
\t
-N <num> : the max number of nodes to try (0 = all) [default = %d]
\n
"
,
pPars
->
nNodesMax
);
Abc_Print
(
-
2
,
"
\t
-P <num> : one particular node to try (0 = none) [default = %d]
\n
"
,
pPars
->
iNodeOne
);
Abc_Print
(
-
2
,
"
\t
-W <num> : size of timing window in percents (0 <= num <= 100) [default = %d]
\n
"
,
pPars
->
nTimeWin
);
Abc_Print
(
-
2
,
"
\t
-a : toggle area minimization [default = %s]
\n
"
,
pPars
->
fArea
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-m : toggle detecting multi-input AND/OR gates [default = %s]
\n
"
,
pPars
->
fUseAndOr
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-z : toggle zero-cost replacements [default = %s]
\n
"
,
pPars
->
fZeroCost
?
"yes"
:
"no"
);
src/opt/sfm/sfm.h
View file @
a43d8273
...
...
@@ -55,6 +55,7 @@ struct Sfm_Par_t_
int
nNodesMax
;
// the maximum number of nodes to try
int
iNodeOne
;
// one particular node to try
int
nFirstFixed
;
// the number of first nodes to be treated as fixed
int
nTimeWin
;
// the size of timing window in percents
int
fRrOnly
;
// perform redundance removal
int
fArea
;
// performs optimization for area
int
fMoreEffort
;
// performs high-affort minimization
...
...
src/opt/sfm/sfmDec.c
View file @
a43d8273
This diff is collapsed.
Click to expand it.
src/opt/sfm/sfmInt.h
View file @
a43d8273
...
...
@@ -218,9 +218,9 @@ extern int Sfm_TimReadNtkDelay( Sfm_Tim_t * p );
extern
int
Sfm_TimReadObjDelay
(
Sfm_Tim_t
*
p
,
int
iObj
);
extern
void
Sfm_TimUpdateTiming
(
Sfm_Tim_t
*
p
,
Vec_Int_t
*
vTimeNodes
);
extern
int
Sfm_TimSortArrayByArrival
(
Sfm_Tim_t
*
p
,
Vec_Int_t
*
vNodes
,
int
iPivot
);
extern
int
Sfm_TimPriorityNodes
(
Sfm_Tim_t
*
p
,
Vec_Int_t
*
vCands
);
extern
int
Sfm_TimPriorityNodes
(
Sfm_Tim_t
*
p
,
Vec_Int_t
*
vCands
,
int
Window
);
extern
int
Sfm_TimNodeIsNonCritical
(
Sfm_Tim_t
*
p
,
Abc_Obj_t
*
pPivot
,
Abc_Obj_t
*
pNode
);
extern
int
Sfm_TimEvalRemapping
(
Sfm_Tim_t
*
p
,
Vec_Int_t
*
vFanins
,
Mio_Gate_t
*
pGate1
,
char
*
pFans1
,
Mio_Gate_t
*
pGate2
,
char
*
pFans2
);
extern
int
Sfm_TimEvalRemapping
(
Sfm_Tim_t
*
p
,
Vec_Int_t
*
vFanins
,
Vec_Int_t
*
vMap
,
Mio_Gate_t
*
pGate1
,
char
*
pFans1
,
Mio_Gate_t
*
pGate2
,
char
*
pFans2
);
/*=== sfmWin.c ==========================================================*/
extern
int
Sfm_ObjMffcSize
(
Sfm_Ntk_t
*
p
,
int
iObj
);
extern
int
Sfm_NtkCreateWindow
(
Sfm_Ntk_t
*
p
,
int
iNode
,
int
fVerbose
);
...
...
src/opt/sfm/sfmLib.c
View file @
a43d8273
...
...
@@ -509,15 +509,18 @@ void Sfm_LibPrintObj( Sfm_Lib_t * p, Sfm_Fun_t * pObj )
}
void
Sfm_LibPrint
(
Sfm_Lib_t
*
p
)
{
word
*
pTruth
;
Sfm_Fun_t
*
pObj
;
int
iFunc
;
word
*
pTruth
;
Sfm_Fun_t
*
pObj
;
int
iFunc
,
nSupp
;
Vec_MemForEachEntry
(
p
->
vTtMem
,
pTruth
,
iFunc
)
{
if
(
iFunc
<
2
)
continue
;
nSupp
=
Abc_TtSupportSize
(
pTruth
,
6
);
if
(
nSupp
>
3
)
continue
;
//if ( iFunc % 10000 )
// continue;
printf
(
"%d : Count = %d "
,
iFunc
,
Vec_IntEntry
(
&
p
->
vCounts
,
iFunc
)
);
Dau_DsdPrintFromTruth
(
pTruth
,
Abc_TtSupportSize
(
pTruth
,
6
)
);
Dau_DsdPrintFromTruth
(
pTruth
,
nSupp
);
Sfm_LibForEachSuper
(
p
,
pObj
,
iFunc
)
Sfm_LibPrintObj
(
p
,
pObj
);
}
...
...
@@ -565,8 +568,8 @@ int Sfm_LibFindMatches( Sfm_Lib_t * p, word uTruth, int * pFanins, int nFanins,
{
pCellB
=
p
->
pCells
+
(
int
)
pObj
->
pFansB
[
0
];
pCellT
=
p
->
pCells
+
(
int
)
pObj
->
pFansT
[
0
];
Vec_PtrPush
(
vGates
,
pCellB
);
Vec_PtrPush
(
vGates
,
pCellT
==
p
->
pCells
?
NULL
:
pCellT
);
Vec_PtrPush
(
vGates
,
pCellB
->
pMioGate
);
Vec_PtrPush
(
vGates
,
pCellT
==
p
->
pCells
?
NULL
:
pCellT
->
pMioGate
);
Vec_PtrPush
(
vFans
,
pObj
->
pFansB
+
1
);
Vec_PtrPush
(
vFans
,
pCellT
==
p
->
pCells
?
NULL
:
pObj
->
pFansT
+
1
);
}
...
...
@@ -590,7 +593,7 @@ int Sfm_LibAddNewGates( Sfm_Lib_t * p, int * pFanins, Mio_Gate_t * pGateB, Mio_G
int
i
,
nFanins
;
// create bottom gate
Vec_IntPush
(
vGates
,
Mio_GateReadValue
(
pGateB
)
);
vLevel
=
Vec_WecPushLevel
(
vFanins
);
vLevel
=
Vec_WecPushLevel
(
vFanins
);
nFanins
=
Mio_GateReadPinNum
(
pGateB
);
for
(
i
=
0
;
i
<
nFanins
;
i
++
)
Vec_IntPush
(
vLevel
,
pFanins
[(
int
)
pFansB
[
i
]]
);
...
...
@@ -598,7 +601,8 @@ int Sfm_LibAddNewGates( Sfm_Lib_t * p, int * pFanins, Mio_Gate_t * pGateB, Mio_G
return
1
;
// create top gate
Vec_IntPush
(
vGates
,
Mio_GateReadValue
(
pGateT
)
);
vLevel
=
Vec_WecPushLevel
(
vFanins
);
vLevel
=
Vec_WecPushLevel
(
vFanins
);
nFanins
=
Mio_GateReadPinNum
(
pGateT
);
for
(
i
=
0
;
i
<
nFanins
;
i
++
)
if
(
pFansT
[
i
]
==
(
char
)
16
)
Vec_IntPush
(
vLevel
,
Vec_WecSize
(
vFanins
)
-
2
);
...
...
src/opt/sfm/sfmTime.c
View file @
a43d8273
...
...
@@ -242,11 +242,11 @@ Sfm_Tim_t * Sfm_TimStart( Mio_Library_t * pLib, Scl_Con_t * pExt, Abc_Ntk_t * pN
p
->
pLib
=
pLib
;
p
->
pExt
=
pExt
;
p
->
pNtk
=
pNtk
;
Vec_IntFill
(
&
p
->
vTimArrs
,
2
*
Abc_NtkObjNumMax
(
pNtk
),
0
);
Vec_IntFill
(
&
p
->
vTimReqs
,
2
*
Abc_NtkObjNumMax
(
pNtk
),
0
);
// Vec_IntFill( &p->vTimSlews,
2
*Abc_NtkObjNumMax(pNtk), 0 );
// Vec_IntFill( &p->vTimLoads,
2
*Abc_NtkObjNumMax(pNtk), 0 );
// Vec_IntFill( &p->vObjOffs, Abc_NtkObjNumMax(pNtk), 0 );
Vec_IntFill
(
&
p
->
vTimArrs
,
4
*
Abc_NtkObjNumMax
(
pNtk
),
0
);
Vec_IntFill
(
&
p
->
vTimReqs
,
4
*
Abc_NtkObjNumMax
(
pNtk
),
0
);
// Vec_IntFill( &p->vTimSlews,
4
*Abc_NtkObjNumMax(pNtk), 0 );
// Vec_IntFill( &p->vTimLoads,
4
*Abc_NtkObjNumMax(pNtk), 0 );
// Vec_IntFill( &p->vObjOffs,
2*
Abc_NtkObjNumMax(pNtk), 0 );
// Abc_NtkForEachNode( pNtk, pObj, i )
// {
// Vec_IntWriteEntry( &p->vObjOffs, i, Vec_IntSize(Vec_IntSize(&p->vTimEdges)) );
...
...
@@ -264,7 +264,9 @@ void Sfm_TimStop( Sfm_Tim_t * p )
Vec_IntErase
(
&
p
->
vTimLoads
);
Vec_IntErase
(
&
p
->
vObjOffs
);
Vec_IntErase
(
&
p
->
vTimEdges
);
Vec_WecErase
(
&
p
->
vLevels
);
Vec_IntErase
(
&
p
->
vPath
);
Vec_WrdErase
(
&
p
->
vSortData
);
ABC_FREE
(
p
);
}
int
Sfm_TimReadNtkDelay
(
Sfm_Tim_t
*
p
)
...
...
@@ -384,13 +386,14 @@ int Sfm_TimSortArrayByArrival( Sfm_Tim_t * p, Vec_Int_t * vNodes, int iPivot )
SeeAlso []
***********************************************************************/
int
Sfm_TimPriorityNodes
(
Sfm_Tim_t
*
p
,
Vec_Int_t
*
vCands
)
int
Sfm_TimPriorityNodes
(
Sfm_Tim_t
*
p
,
Vec_Int_t
*
vCands
,
int
Window
)
{
Vec_Int_t
*
vLevel
;
Abc_Obj_t
*
pObj
;
int
i
;
int
i
,
k
;
assert
(
Window
>=
0
&&
Window
<=
100
);
// collect critical path
Sfm_TimCriticalPath
(
p
,
1
);
Sfm_TimCriticalPath
(
p
,
Window
);
// add nodes to the levelized structure
Sfm_TimUpdateClean
(
p
);
Abc_NtkForEachObjVec
(
&
p
->
vPath
,
p
->
pNtk
,
pObj
,
i
)
...
...
@@ -403,7 +406,7 @@ int Sfm_TimPriorityNodes( Sfm_Tim_t * p, Vec_Int_t * vCands )
Vec_WecSort
(
&
p
->
vLevels
,
0
);
Vec_IntClear
(
vCands
);
Vec_WecForEachLevel
(
&
p
->
vLevels
,
vLevel
,
i
)
Abc_NtkForEachObjVec
(
vLevel
,
p
->
pNtk
,
pObj
,
i
)
Abc_NtkForEachObjVec
(
vLevel
,
p
->
pNtk
,
pObj
,
k
)
if
(
!
pObj
->
fMarkA
)
Vec_IntPush
(
vCands
,
Abc_ObjId
(
pObj
)
);
return
Vec_IntSize
(
vCands
)
>
0
;
...
...
@@ -436,7 +439,7 @@ int Sfm_TimNodeIsNonCritical( Sfm_Tim_t * p, Abc_Obj_t * pPivot, Abc_Obj_t * pNo
SeeAlso []
***********************************************************************/
int
Sfm_TimEvalRemapping
(
Sfm_Tim_t
*
p
,
Vec_Int_t
*
vFanins
,
Mio_Gate_t
*
pGate1
,
char
*
pFans1
,
Mio_Gate_t
*
pGate2
,
char
*
pFans2
)
int
Sfm_TimEvalRemapping
(
Sfm_Tim_t
*
p
,
Vec_Int_t
*
vFanins
,
Vec_Int_t
*
vMap
,
Mio_Gate_t
*
pGate1
,
char
*
pFans1
,
Mio_Gate_t
*
pGate2
,
char
*
pFans2
)
{
int
TimeOut
[
2
][
2
];
int
*
pTimesIn1
[
6
],
*
pTimesIn2
[
6
];
...
...
@@ -444,7 +447,7 @@ int Sfm_TimEvalRemapping( Sfm_Tim_t * p, Vec_Int_t * vFanins, Mio_Gate_t * pGate
// process the first gate
nFanins1
=
Mio_GateReadPinNum
(
pGate1
);
for
(
i
=
0
;
i
<
nFanins1
;
i
++
)
pTimesIn1
[
i
]
=
Sfm_TimArrId
(
p
,
Vec_IntEntry
(
v
Fanins
,
(
int
)
pFans1
[
i
]
)
);
pTimesIn1
[
i
]
=
Sfm_TimArrId
(
p
,
Vec_IntEntry
(
v
Map
,
Vec_IntEntry
(
vFanins
,
(
int
)
pFans1
[
i
])
)
);
Sfm_TimGateArrival
(
p
,
pGate1
,
pTimesIn1
,
TimeOut
[
0
]
);
if
(
pGate2
==
NULL
)
return
Abc_MaxInt
(
TimeOut
[
0
][
0
],
TimeOut
[
0
][
1
]);
...
...
@@ -454,7 +457,7 @@ int Sfm_TimEvalRemapping( Sfm_Tim_t * p, Vec_Int_t * vFanins, Mio_Gate_t * pGate
if
(
(
int
)
pFans2
[
i
]
==
16
)
pTimesIn2
[
i
]
=
TimeOut
[
0
];
else
pTimesIn2
[
i
]
=
Sfm_TimArrId
(
p
,
Vec_IntEntry
(
v
Fanins
,
(
int
)
pFans2
[
i
]
)
);
pTimesIn2
[
i
]
=
Sfm_TimArrId
(
p
,
Vec_IntEntry
(
v
Map
,
Vec_IntEntry
(
vFanins
,
(
int
)
pFans2
[
i
])
)
);
Sfm_TimGateArrival
(
p
,
pGate2
,
pTimesIn2
,
TimeOut
[
1
]
);
return
Abc_MaxInt
(
TimeOut
[
1
][
0
],
TimeOut
[
1
][
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