diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-04-20 10:32:29 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-04-20 10:32:29 -0700 |
commit | e822a1f8c78587d2ca8b826e62295a643056890f (patch) | |
tree | b0a6f662755bd401ffa971953f2c166162afb684 /src/python | |
parent | 73789120c17bb857976ccf0b8f34a59832dfadee (diff) | |
download | abc-e822a1f8c78587d2ca8b826e62295a643056890f.tar.gz abc-e822a1f8c78587d2ca8b826e62295a643056890f.tar.bz2 abc-e822a1f8c78587d2ca8b826e62295a643056890f.zip |
Added Python APIs for node/level counts.
Diffstat (limited to 'src/python')
-rw-r--r-- | src/python/pyabc.i | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/src/python/pyabc.i b/src/python/pyabc.i index 00e410a6..84de6ed6 100644 --- a/src/python/pyabc.i +++ b/src/python/pyabc.i @@ -48,13 +48,26 @@ int n_ands() 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() { Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame(); Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); - if ( pNtk && Abc_NtkIsStrash(pNtk) ) + if ( pNtk ) { return Abc_NtkPiNum(pNtk); } @@ -68,7 +81,7 @@ int n_pos() Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame(); Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); - if ( pNtk && Abc_NtkIsStrash(pNtk) ) + if ( pNtk ) { return Abc_NtkPoNum(pNtk); } @@ -81,7 +94,7 @@ int n_latches() Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame(); Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); - if ( pNtk && Abc_NtkIsStrash(pNtk) ) + if ( pNtk ) { return Abc_NtkLatchNum(pNtk); } @@ -89,6 +102,19 @@ int n_latches() 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() { Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame(); |