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
95af9797
Commit
95af9797
authored
Jul 06, 2015
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding new Python API 'co_supp'.
parent
9894fc76
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
0 deletions
+78
-0
src/base/abc/abc.h
+1
-0
src/base/abc/abcDfs.c
+51
-0
src/python/pyabc.i
+26
-0
No files found.
src/base/abc/abc.h
View file @
95af9797
...
@@ -625,6 +625,7 @@ extern ABC_DLL int Abc_NtkIsDfsOrdered( Abc_Ntk_t * pNtk );
...
@@ -625,6 +625,7 @@ extern ABC_DLL int Abc_NtkIsDfsOrdered( Abc_Ntk_t * pNtk );
extern
ABC_DLL
Vec_Ptr_t
*
Abc_NtkDfsWithBoxes
(
Abc_Ntk_t
*
pNtk
);
extern
ABC_DLL
Vec_Ptr_t
*
Abc_NtkDfsWithBoxes
(
Abc_Ntk_t
*
pNtk
);
extern
ABC_DLL
Vec_Ptr_t
*
Abc_NtkSupport
(
Abc_Ntk_t
*
pNtk
);
extern
ABC_DLL
Vec_Ptr_t
*
Abc_NtkSupport
(
Abc_Ntk_t
*
pNtk
);
extern
ABC_DLL
Vec_Ptr_t
*
Abc_NtkNodeSupport
(
Abc_Ntk_t
*
pNtk
,
Abc_Obj_t
**
ppNodes
,
int
nNodes
);
extern
ABC_DLL
Vec_Ptr_t
*
Abc_NtkNodeSupport
(
Abc_Ntk_t
*
pNtk
,
Abc_Obj_t
**
ppNodes
,
int
nNodes
);
extern
ABC_DLL
Vec_Int_t
*
Abc_NtkNodeSupportInt
(
Abc_Ntk_t
*
pNtk
,
int
iCo
);
extern
ABC_DLL
Vec_Ptr_t
*
Abc_AigDfs
(
Abc_Ntk_t
*
pNtk
,
int
fCollectAll
,
int
fCollectCos
);
extern
ABC_DLL
Vec_Ptr_t
*
Abc_AigDfs
(
Abc_Ntk_t
*
pNtk
,
int
fCollectAll
,
int
fCollectCos
);
extern
ABC_DLL
Vec_Ptr_t
*
Abc_AigDfsMap
(
Abc_Ntk_t
*
pNtk
);
extern
ABC_DLL
Vec_Ptr_t
*
Abc_AigDfsMap
(
Abc_Ntk_t
*
pNtk
);
extern
ABC_DLL
Vec_Vec_t
*
Abc_DfsLevelized
(
Abc_Obj_t
*
pNode
,
int
fTfi
);
extern
ABC_DLL
Vec_Vec_t
*
Abc_DfsLevelized
(
Abc_Obj_t
*
pNode
,
int
fTfi
);
...
...
src/base/abc/abcDfs.c
View file @
95af9797
...
@@ -905,6 +905,57 @@ Vec_Ptr_t * Abc_NtkNodeSupport( Abc_Ntk_t * pNtk, Abc_Obj_t ** ppNodes, int nNod
...
@@ -905,6 +905,57 @@ Vec_Ptr_t * Abc_NtkNodeSupport( Abc_Ntk_t * pNtk, Abc_Obj_t ** ppNodes, int nNod
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Returns the set of CI node IDs in the support of the given node.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Abc_NtkNodeSupportInt_rec
(
Abc_Obj_t
*
pNode
,
Vec_Int_t
*
vNodes
)
{
Abc_Obj_t
*
pFanin
;
int
i
;
assert
(
!
Abc_ObjIsNet
(
pNode
)
);
// if this node is already visited, skip
if
(
Abc_NodeIsTravIdCurrent
(
pNode
)
)
return
;
// mark the node as visited
Abc_NodeSetTravIdCurrent
(
pNode
);
// collect the CI
if
(
Abc_ObjIsCi
(
pNode
)
||
(
Abc_NtkIsStrash
(
pNode
->
pNtk
)
&&
Abc_ObjFaninNum
(
pNode
)
==
0
)
)
{
if
(
Abc_ObjIsCi
(
pNode
)
)
Vec_IntPush
(
vNodes
,
pNode
->
iTemp
);
return
;
}
assert
(
Abc_ObjIsNode
(
pNode
)
);
// visit the transitive fanin of the node
Abc_ObjForEachFanin
(
pNode
,
pFanin
,
i
)
Abc_NtkNodeSupportInt_rec
(
Abc_ObjFanin0Ntk
(
pFanin
),
vNodes
);
}
Vec_Int_t
*
Abc_NtkNodeSupportInt
(
Abc_Ntk_t
*
pNtk
,
int
iCo
)
{
Vec_Int_t
*
vNodes
;
Abc_Obj_t
*
pObj
;
int
i
;
if
(
iCo
<
0
||
iCo
>=
Abc_NtkCoNum
(
pNtk
)
)
return
NULL
;
// save node indices in the CI nodes
Abc_NtkForEachCi
(
pNtk
,
pObj
,
i
)
pObj
->
iTemp
=
i
;
// collect the indexes of CI nodes in the TFI of the CO node
Abc_NtkIncrementTravId
(
pNtk
);
pObj
=
Abc_NtkCo
(
pNtk
,
iCo
);
vNodes
=
Vec_IntAlloc
(
100
);
Abc_NtkNodeSupportInt_rec
(
Abc_ObjFanin0
(
pObj
),
vNodes
);
return
vNodes
;
}
/**Function*************************************************************
Synopsis [Computes support size of the node.]
Synopsis [Computes support size of the node.]
Description []
Description []
...
...
src/python/pyabc.i
View file @
95af9797
...
@@ -359,6 +359,31 @@ PyObject* eq_classes()
...
@@ -359,6 +359,31 @@ PyObject* eq_classes()
return eq_classes;
return eq_classes;
}
}
PyObject* co_supp( int iCo )
{
PyObject* co_supp;
Vec_Int_t * vSupp;
Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame();
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
if ( !pNtk )
{
Py_RETURN_NONE;
}
vSupp = Abc_NtkNodeSupportInt( pNtk, iCo );
if( !vSupp )
{
Py_RETURN_NONE;
}
co_supp = VecInt_To_PyList( vSupp );
Vec_IntFree( vSupp );
return co_supp;
}
void _pyabc_array_clear()
void _pyabc_array_clear()
{
{
Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame();
Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame();
...
@@ -715,6 +740,7 @@ int _cex_get_po(Abc_Cex_t* pCex);
...
@@ -715,6 +740,7 @@ int _cex_get_po(Abc_Cex_t* pCex);
int _cex_get_frame(Abc_Cex_t* pCex);
int _cex_get_frame(Abc_Cex_t* pCex);
PyObject* eq_classes();
PyObject* eq_classes();
PyObject* co_supp(int iCo);
void _pyabc_array_clear();
void _pyabc_array_clear();
void _pyabc_array_push(int i);
void _pyabc_array_push(int i);
...
...
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