Commit e822a1f8 by Alan Mishchenko

Added Python APIs for node/level counts.

parent 73789120
...@@ -49,12 +49,25 @@ int n_ands() ...@@ -49,12 +49,25 @@ int n_ands()
return -1; return -1;
} }
int n_nodes()
{
Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame();
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
if ( pNtk )
{
return Abc_NtkNodeNum(pNtk);
}
return -1;
}
int n_pis() int n_pis()
{ {
Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame(); Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame();
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
if ( pNtk && Abc_NtkIsStrash(pNtk) ) if ( pNtk )
{ {
return Abc_NtkPiNum(pNtk); return Abc_NtkPiNum(pNtk);
} }
...@@ -68,7 +81,7 @@ int n_pos() ...@@ -68,7 +81,7 @@ int n_pos()
Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame(); Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame();
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
if ( pNtk && Abc_NtkIsStrash(pNtk) ) if ( pNtk )
{ {
return Abc_NtkPoNum(pNtk); return Abc_NtkPoNum(pNtk);
} }
...@@ -81,7 +94,7 @@ int n_latches() ...@@ -81,7 +94,7 @@ int n_latches()
Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame(); Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame();
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
if ( pNtk && Abc_NtkIsStrash(pNtk) ) if ( pNtk )
{ {
return Abc_NtkLatchNum(pNtk); return Abc_NtkLatchNum(pNtk);
} }
...@@ -89,6 +102,19 @@ int n_latches() ...@@ -89,6 +102,19 @@ int n_latches()
return -1; return -1;
} }
int n_levels()
{
Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame();
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
if ( pNtk )
{
return Abc_NtkLevelNum(pNtk);
}
return -1;
}
int has_comb_model() int has_comb_model()
{ {
Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame(); Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment