From eec94a70f1a63faefc7db2d7afccb2fd187e5d47 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sun, 22 Sep 2013 23:18:40 -0700 Subject: Adding API to return the mapped network. --- src/aig/miniaig/abcapis.h | 4 ++++ src/base/abci/abcMap.c | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/aig/miniaig/abcapis.h b/src/aig/miniaig/abcapis.h index cc7cd87d..8615d283 100644 --- a/src/aig/miniaig/abcapis.h +++ b/src/aig/miniaig/abcapis.h @@ -53,6 +53,10 @@ extern int Cmd_CommandExecute( void * pAbc, char * pCommandLine ); extern void Abc_NtkInputMiniAig( void * pAbc, void * pMiniAig ); extern void * Abc_NtkOutputMiniAig( void * pAbc ); +// procedures to return the mapped network +extern int * Abc_NtkOutputMiniMapping( Abc_Frame_t * pAbc ); +extern void Abc_NtkPrintMiniMapping( int * pArray ); + // procedures to access verifization status and a counter-example extern int Abc_FrameReadProbStatus( void * pAbc ); extern void * Abc_FrameReadCex( void * pAbc ); diff --git a/src/base/abci/abcMap.c b/src/base/abci/abcMap.c index 95d2e4cb..adceb12a 100644 --- a/src/base/abci/abcMap.c +++ b/src/base/abci/abcMap.c @@ -792,8 +792,8 @@ Vec_Int_t * Abc_NtkWriteMiniMapping( Abc_Ntk_t * pNtk ) pObj->iTemp = nNodes++; Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i ) pObj->iTemp = nNodes++, nFanins += Abc_ObjFaninNum(pObj); - // allocate attay to store mapping (4 counters + N entries - vMapping = Vec_IntAlloc( 4 + Abc_NtkNodeNum(pNtk) + nFanins + Abc_NtkCoNum(pNtk) ); + // allocate attay to store mapping (4 counters + fanins for each node + PO drivers + gate names) + vMapping = Vec_IntAlloc( 4 + Abc_NtkNodeNum(pNtk) + nFanins + Abc_NtkCoNum(pNtk) + 10000 ); // write the numbers of CI/CO/Node/FF Vec_IntPush( vMapping, Abc_NtkCiNum(pNtk) ); Vec_IntPush( vMapping, Abc_NtkCoNum(pNtk) ); @@ -806,6 +806,7 @@ Vec_Int_t * Abc_NtkWriteMiniMapping( Abc_Ntk_t * pNtk ) Vec_IntPush( vMapping, Abc_ObjFaninNum(pObj) ); Abc_ObjForEachFanin( pObj, pFanin, k ) Vec_IntPush( vMapping, pFanin->iTemp ); + // remember this gate (to be added to the mapping later) Vec_StrPrintStr( vGates, Mio_GateReadName((Mio_Gate_t *)pObj->pData) ); Vec_StrPush( vGates, '\0' ); } @@ -904,7 +905,7 @@ int * Abc_NtkOutputMiniMapping( Abc_Frame_t * pAbc ) /**Function************************************************************* - Synopsis [Test mini-mapped format.] + Synopsis [Test for mini-mapped format.] Description [] -- cgit v1.2.3