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
338845a2
Commit
338845a2
authored
May 30, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New MFS package.
parent
3c978925
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
57 deletions
+32
-57
src/opt/sfm/sfmCore.c
+1
-1
src/opt/sfm/sfmInt.h
+0
-3
src/opt/sfm/sfmNtk.c
+0
-6
src/opt/sfm/sfmWin.c
+31
-47
No files found.
src/opt/sfm/sfmCore.c
View file @
338845a2
...
...
@@ -118,7 +118,7 @@ int Sfm_NodeResubSolve( Sfm_Ntk_t * p, int iNode, int f, int fRemoveOnly )
// report init stats
if
(
p
->
pPars
->
fVeryVerbose
)
printf
(
"%5d : Lev =%3d. Leaf =%3d. Node =%3d. Div=%3d. Fanin =%4d (%d/%d). MFFC = %d
\n
"
,
iNode
,
Sfm_ObjLevel
(
p
,
iNode
),
Vec_IntSize
(
p
->
vLeaves
)
,
Vec_IntSize
(
p
->
vNodes
),
Vec_IntSize
(
p
->
vDivs
),
iNode
,
Sfm_ObjLevel
(
p
,
iNode
),
0
,
Vec_IntSize
(
p
->
vNodes
),
Vec_IntSize
(
p
->
vDivs
),
Sfm_ObjFanin
(
p
,
iNode
,
f
),
f
,
Sfm_ObjFaninNum
(
p
,
iNode
),
Sfm_ObjMffcSize
(
p
,
Sfm_ObjFanin
(
p
,
iNode
,
f
))
);
// clean simulation info
p
->
nCexes
=
0
;
...
...
src/opt/sfm/sfmInt.h
View file @
338845a2
...
...
@@ -77,10 +77,7 @@ struct Sfm_Ntk_t_
int
nTravIds2
;
// traversal IDs
// window
int
iPivotNode
;
// window pivot
Vec_Int_t
*
vLeaves
;
// leaves
Vec_Int_t
*
vLeaves2
;
// leaves
Vec_Int_t
*
vNodes
;
// internal
Vec_Int_t
*
vNodes2
;
// internal
Vec_Int_t
*
vDivs
;
// divisors
Vec_Int_t
*
vRoots
;
// roots
Vec_Int_t
*
vTfo
;
// TFO (excluding iNode)
...
...
src/opt/sfm/sfmNtk.c
View file @
338845a2
...
...
@@ -163,10 +163,7 @@ Sfm_Ntk_t * Sfm_NtkConstruct( Vec_Wec_t * vFanins, int nPis, int nPos, Vec_Str_t
}
void
Sfm_NtkPrepare
(
Sfm_Ntk_t
*
p
)
{
p
->
vLeaves
=
Vec_IntAlloc
(
1000
);
p
->
vLeaves2
=
Vec_IntAlloc
(
1000
);
p
->
vNodes
=
Vec_IntAlloc
(
1000
);
p
->
vNodes2
=
Vec_IntAlloc
(
1000
);
p
->
vDivs
=
Vec_IntAlloc
(
100
);
p
->
vRoots
=
Vec_IntAlloc
(
1000
);
p
->
vTfo
=
Vec_IntAlloc
(
1000
);
...
...
@@ -198,10 +195,7 @@ void Sfm_NtkFree( Sfm_Ntk_t * p )
Vec_WecFree
(
p
->
vCnfs
);
Vec_IntFree
(
p
->
vCover
);
// other data
Vec_IntFreeP
(
&
p
->
vLeaves
);
Vec_IntFreeP
(
&
p
->
vLeaves2
);
Vec_IntFreeP
(
&
p
->
vNodes
);
Vec_IntFreeP
(
&
p
->
vNodes2
);
Vec_IntFreeP
(
&
p
->
vDivs
);
Vec_IntFreeP
(
&
p
->
vRoots
);
Vec_IntFreeP
(
&
p
->
vTfo
);
...
...
src/opt/sfm/sfmWin.c
View file @
338845a2
...
...
@@ -266,41 +266,34 @@ static inline int Sfm_ObjIsUseful( Sfm_Ntk_t * p, int iNode )
SeeAlso []
***********************************************************************/
int
Sfm_NtkCollectTfi_rec
(
Sfm_Ntk_t
*
p
,
int
iNode
,
Vec_Int_t
*
v
Leaves
,
Vec_Int_t
*
v
Nodes
)
int
Sfm_NtkCollectTfi_rec
(
Sfm_Ntk_t
*
p
,
int
iNode
,
Vec_Int_t
*
vNodes
)
{
int
i
,
iFanin
;
if
(
Sfm_ObjIsTravIdCurrent
(
p
,
iNode
)
)
return
0
;
Sfm_ObjSetTravIdCurrent
(
p
,
iNode
);
if
(
Sfm_ObjIsPi
(
p
,
iNode
)
)
{
Vec_IntPush
(
vLeaves
,
iNode
);
return
0
;
}
Sfm_ObjForEachFanin
(
p
,
iNode
,
iFanin
,
i
)
if
(
Sfm_NtkCollectTfi_rec
(
p
,
iFanin
,
v
Leaves
,
v
Nodes
)
)
if
(
Sfm_NtkCollectTfi_rec
(
p
,
iFanin
,
vNodes
)
)
return
1
;
Vec_IntPush
(
vNodes
,
iNode
);
return
p
->
pPars
->
nWinSizeMax
&&
(
Vec_IntSize
(
vNodes
)
>
p
->
pPars
->
nWinSizeMax
);
}
int
Sfm_NtkCreateWindow
(
Sfm_Ntk_t
*
p
,
int
iNode
,
int
fVerbose
)
{
int
i
,
k
,
iTemp
,
nDivStart
;
int
i
,
k
,
iTemp
;
abctime
clkDiv
,
clkWin
=
Abc_Clock
();
assert
(
Sfm_ObjIsNode
(
p
,
iNode
)
);
p
->
iPivotNode
=
iNode
;
Vec_IntClear
(
p
->
vLeaves
);
// leaves
Vec_IntClear
(
p
->
vLeaves2
);
// leaves
Vec_IntClear
(
p
->
vNodes
);
// internal
Vec_IntClear
(
p
->
vNodes2
);
// internal
Vec_IntClear
(
p
->
vDivs
);
// divisors
Vec_IntClear
(
p
->
vRoots
);
// roots
Vec_IntClear
(
p
->
vTfo
);
// roots
Vec_IntClear
(
p
->
vOrder
);
// variable order
// collect transitive fanin
Sfm_NtkIncrementTravId
(
p
);
if
(
Sfm_NtkCollectTfi_rec
(
p
,
iNode
,
p
->
v
Leaves
,
p
->
v
Nodes
)
)
if
(
Sfm_NtkCollectTfi_rec
(
p
,
iNode
,
p
->
vNodes
)
)
{
p
->
nMaxDivs
++
;
p
->
timeWin
+=
Abc_Clock
()
-
clkWin
;
...
...
@@ -310,13 +303,9 @@ int Sfm_NtkCreateWindow( Sfm_Ntk_t * p, int iNode, int fVerbose )
// create divisors
clkDiv
=
Abc_Clock
();
Vec_IntClear
(
p
->
vDivs
);
Vec_IntForEachEntry
(
p
->
vLeaves
,
iTemp
,
i
)
Vec_IntPush
(
p
->
vDivs
,
iTemp
);
Vec_IntForEachEntry
(
p
->
vNodes
,
iTemp
,
i
)
Vec_IntPush
(
p
->
vDivs
,
iTemp
);
Vec_IntAppend
(
p
->
vDivs
,
p
->
vNodes
);
Vec_IntPop
(
p
->
vDivs
);
// add non-topological divisors
nDivStart
=
Vec_IntSize
(
p
->
vDivs
);
if
(
Vec_IntSize
(
p
->
vDivs
)
<
p
->
pPars
->
nWinSizeMax
+
0
)
{
Sfm_NtkIncrementTravId2
(
p
);
...
...
@@ -352,7 +341,7 @@ int Sfm_NtkCreateWindow( Sfm_Ntk_t * p, int iNode, int fVerbose )
clkDiv
=
Abc_Clock
()
-
clkDiv
;
p
->
timeDiv
+=
clkDiv
;
p
->
nTotalDivs
+=
Vec_IntSize
(
p
->
vDivs
);
// collect TFO and window roots
if
(
p
->
pPars
->
nTfoLevMax
>
0
&&
!
Sfm_NtkCheckRoot
(
p
,
iNode
,
Sfm_ObjLevel
(
p
,
iNode
)
+
p
->
pPars
->
nTfoLevMax
)
)
{
...
...
@@ -364,39 +353,34 @@ int Sfm_NtkCreateWindow( Sfm_Ntk_t * p, int iNode, int fVerbose )
// compute new leaves and nodes
Sfm_NtkIncrementTravId
(
p
);
Vec_IntForEachEntry
(
p
->
vRoots
,
iTemp
,
i
)
if
(
Sfm_NtkCollectTfi_rec
(
p
,
iTemp
,
p
->
vLeaves2
,
p
->
vNodes2
)
)
if
(
Sfm_NtkCollectTfi_rec
(
p
,
iTemp
,
p
->
vOrder
)
)
{
Vec_IntClear
(
p
->
vRoots
);
Vec_IntClear
(
p
->
vTfo
);
Vec_IntClear
(
p
->
vOrder
);
break
;
if
(
i
==
Vec_IntSize
(
p
->
vRoots
)
)
{
// printf( "%d -> %d %d -> %d\n", Vec_IntSize(p->vLeaves), Vec_IntSize(p->vLeaves2), Vec_IntSize(p->vNodes), Vec_IntSize(p->vNodes2) );
// swap leaves and nodes
ABC_SWAP
(
Vec_Int_t
*
,
p
->
vLeaves
,
p
->
vLeaves2
);
ABC_SWAP
(
Vec_Int_t
*
,
p
->
vNodes
,
p
->
vNodes2
);
}
else
{
Vec_IntClear
(
p
->
vRoots
);
Vec_IntClear
(
p
->
vTfo
);
}
// printf( "Roots = %d. TFO = %d.\n", Vec_IntSize(p->vRoots), Vec_IntSize(p->vTfo) );
}
if
(
Vec_IntSize
(
p
->
vRoots
)
>
0
)
Vec_IntForEachEntry
(
p
->
vDivs
,
iTemp
,
i
)
if
(
Sfm_NtkCollectTfi_rec
(
p
,
iTemp
,
p
->
vOrder
)
)
{
Vec_IntClear
(
p
->
vRoots
);
Vec_IntClear
(
p
->
vTfo
);
Vec_IntClear
(
p
->
vOrder
);
break
;
}
}
// create ordering of the nodes, leaves and divisors that are not among nodes/leaves
Vec_IntClear
(
p
->
vOrder
);
Sfm_NtkIncrementTravId2
(
p
);
Vec_IntForEachEntryReverse
(
p
->
vNodes
,
iTemp
,
i
)
{
Sfm_ObjSetTravIdCurrent2
(
p
,
iTemp
);
Vec_IntPush
(
p
->
vOrder
,
iTemp
);
}
Vec_IntForEachEntry
(
p
->
vLeaves
,
iTemp
,
i
)
if
(
Vec_IntSize
(
p
->
vOrder
)
==
0
)
{
Sfm_ObjSetTravIdCurrent2
(
p
,
iTemp
);
Vec_IntPush
(
p
->
vOrder
,
iTemp
);
int
Temp
=
p
->
pPars
->
nWinSizeMax
;
p
->
pPars
->
nWinSizeMax
=
0
;
Sfm_NtkIncrementTravId
(
p
);
Sfm_NtkCollectTfi_rec
(
p
,
iNode
,
p
->
vOrder
);
Vec_IntForEachEntry
(
p
->
vDivs
,
iTemp
,
i
)
Sfm_NtkCollectTfi_rec
(
p
,
iTemp
,
p
->
vOrder
);
p
->
pPars
->
nWinSizeMax
=
Temp
;
}
Vec_IntForEachEntry
(
p
->
vDivs
,
iTemp
,
i
)
if
(
!
Sfm_ObjIsTravIdCurrent2
(
p
,
iTemp
)
)
Vec_IntPush
(
p
->
vOrder
,
iTemp
);
// statistics
p
->
timeWin
+=
Abc_Clock
()
-
clkWin
-
clkDiv
;
...
...
@@ -405,7 +389,7 @@ int Sfm_NtkCreateWindow( Sfm_Ntk_t * p, int iNode, int fVerbose )
// print stats about the window
printf
(
"%6d : "
,
iNode
);
printf
(
"Leaves = %5d. "
,
Vec_IntSize
(
p
->
vLeaves
)
);
printf
(
"Leaves = %5d. "
,
0
);
printf
(
"Nodes = %5d. "
,
Vec_IntSize
(
p
->
vNodes
)
);
printf
(
"Roots = %5d. "
,
Vec_IntSize
(
p
->
vRoots
)
);
printf
(
"Divs = %5d. "
,
Vec_IntSize
(
p
->
vDivs
)
);
...
...
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