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
0dcdbc2a
Commit
0dcdbc2a
authored
Feb 19, 2015
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Performance bug fix in 'clp' (different way of removing redundant fanins).
parent
e3f87e18
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
2 deletions
+69
-2
src/base/abc/abcMinBase.c
+1
-1
src/base/abci/abcCollapse.c
+68
-1
No files found.
src/base/abc/abcMinBase.c
View file @
0dcdbc2a
...
@@ -28,7 +28,7 @@ ABC_NAMESPACE_IMPL_START
...
@@ -28,7 +28,7 @@ ABC_NAMESPACE_IMPL_START
/// DECLARATIONS ///
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
static
int
Abc_NodeSupport
(
DdNode
*
bFunc
,
Vec_Str_t
*
vSupport
,
int
nVars
);
extern
int
Abc_NodeSupport
(
DdNode
*
bFunc
,
Vec_Str_t
*
vSupport
,
int
nVars
);
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
/// FUNCTION DEFINITIONS ///
...
...
src/base/abci/abcCollapse.c
View file @
0dcdbc2a
...
@@ -31,12 +31,79 @@ ABC_NAMESPACE_IMPL_START
...
@@ -31,12 +31,79 @@ ABC_NAMESPACE_IMPL_START
static
Abc_Ntk_t
*
Abc_NtkFromGlobalBdds
(
Abc_Ntk_t
*
pNtk
);
static
Abc_Ntk_t
*
Abc_NtkFromGlobalBdds
(
Abc_Ntk_t
*
pNtk
);
static
Abc_Obj_t
*
Abc_NodeFromGlobalBdds
(
Abc_Ntk_t
*
pNtkNew
,
DdManager
*
dd
,
DdNode
*
bFunc
);
static
Abc_Obj_t
*
Abc_NodeFromGlobalBdds
(
Abc_Ntk_t
*
pNtkNew
,
DdManager
*
dd
,
DdNode
*
bFunc
);
extern
int
Abc_NodeSupport
(
DdNode
*
bFunc
,
Vec_Str_t
*
vSupport
,
int
nVars
);
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Makes nodes minimum base.]
Description [Returns the number of changed nodes.]
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_NodeMinimumBase2
(
Abc_Obj_t
*
pNode
)
{
Vec_Str_t
*
vSupport
;
Vec_Ptr_t
*
vFanins
;
DdNode
*
bTemp
;
int
i
,
nVars
;
assert
(
Abc_NtkIsBddLogic
(
pNode
->
pNtk
)
);
assert
(
Abc_ObjIsNode
(
pNode
)
);
// compute support
vSupport
=
Vec_StrAlloc
(
10
);
nVars
=
Abc_NodeSupport
(
Cudd_Regular
(
pNode
->
pData
),
vSupport
,
Abc_ObjFaninNum
(
pNode
)
);
if
(
nVars
==
Abc_ObjFaninNum
(
pNode
)
)
{
Vec_StrFree
(
vSupport
);
return
0
;
}
// add fanins
vFanins
=
Vec_PtrAlloc
(
Abc_ObjFaninNum
(
pNode
)
);
Abc_NodeCollectFanins
(
pNode
,
vFanins
);
Vec_IntClear
(
&
pNode
->
vFanins
);
for
(
i
=
0
;
i
<
vFanins
->
nSize
;
i
++
)
if
(
vSupport
->
pArray
[
i
]
!=
0
)
// useful
Vec_IntPush
(
&
pNode
->
vFanins
,
Abc_ObjId
((
Abc_Obj_t
*
)
vFanins
->
pArray
[
i
])
);
assert
(
nVars
==
Abc_ObjFaninNum
(
pNode
)
);
// update the function of the node
pNode
->
pData
=
Extra_bddRemapUp
(
(
DdManager
*
)
pNode
->
pNtk
->
pManFunc
,
bTemp
=
(
DdNode
*
)
pNode
->
pData
);
Cudd_Ref
(
(
DdNode
*
)
pNode
->
pData
);
Cudd_RecursiveDeref
(
(
DdManager
*
)
pNode
->
pNtk
->
pManFunc
,
bTemp
);
Vec_PtrFree
(
vFanins
);
Vec_StrFree
(
vSupport
);
return
1
;
}
int
Abc_NtkMinimumBase2
(
Abc_Ntk_t
*
pNtk
)
{
Abc_Obj_t
*
pNode
,
*
pFanin
;
int
i
,
k
,
Counter
;
assert
(
Abc_NtkIsBddLogic
(
pNtk
)
);
// remove all fanouts
Abc_NtkForEachObj
(
pNtk
,
pNode
,
i
)
Vec_IntClear
(
&
pNode
->
vFanouts
);
// add useful fanins
Counter
=
0
;
Abc_NtkForEachNode
(
pNtk
,
pNode
,
i
)
Counter
+=
Abc_NodeMinimumBase2
(
pNode
);
// add fanouts
Abc_NtkForEachObj
(
pNtk
,
pNode
,
i
)
Abc_ObjForEachFanin
(
pNode
,
pFanin
,
k
)
Vec_IntPush
(
&
pFanin
->
vFanouts
,
Abc_ObjId
(
pNode
)
);
return
Counter
;
}
/**Function*************************************************************
Synopsis [Collapses the network.]
Synopsis [Collapses the network.]
Description []
Description []
...
@@ -76,7 +143,7 @@ Abc_Ntk_t * Abc_NtkCollapse( Abc_Ntk_t * pNtk, int fBddSizeMax, int fDualRail, i
...
@@ -76,7 +143,7 @@ Abc_Ntk_t * Abc_NtkCollapse( Abc_Ntk_t * pNtk, int fBddSizeMax, int fDualRail, i
// pNtk->pManGlob = NULL;
// pNtk->pManGlob = NULL;
// make the network minimum base
// make the network minimum base
Abc_NtkMinimumBase
(
pNtkNew
);
Abc_NtkMinimumBase
2
(
pNtkNew
);
if
(
pNtk
->
pExdc
)
if
(
pNtk
->
pExdc
)
pNtkNew
->
pExdc
=
Abc_NtkDup
(
pNtk
->
pExdc
);
pNtkNew
->
pExdc
=
Abc_NtkDup
(
pNtk
->
pExdc
);
...
...
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