From 70563cd441a32e14f831b1866f3ba28221315082 Mon Sep 17 00:00:00 2001 From: Ethan Mahintorabi Date: Wed, 31 Jul 2024 21:34:26 +0000 Subject: [PATCH] Adds option to unamap network using a non static version of the library Signed-off-by: Ethan Mahintorabi --- src/base/abc/abc.h | 1 + src/base/abc/abcFunc.c | 24 ++++++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/base/abc/abc.h b/src/base/abc/abc.h index 0b70f2dbb..73d218438 100644 --- a/src/base/abc/abc.h +++ b/src/base/abc/abc.h @@ -678,6 +678,7 @@ extern ABC_DLL void Abc_NtkLogicMakeDirectSops( Abc_Ntk_t * pNtk ) extern ABC_DLL int Abc_NtkSopToAig( Abc_Ntk_t * pNtk ); extern ABC_DLL int Abc_NtkAigToBdd( Abc_Ntk_t * pNtk ); extern ABC_DLL Gia_Man_t * Abc_NtkAigToGia( Abc_Ntk_t * p, int fGiaSimple ); +extern ABC_DLL int Abc_NtkMapToSopUsingLibrary( Abc_Ntk_t * pNtk, void* library ); extern ABC_DLL int Abc_NtkMapToSop( Abc_Ntk_t * pNtk ); extern ABC_DLL int Abc_NtkToSop( Abc_Ntk_t * pNtk, int fMode, int nCubeLimit ); extern ABC_DLL int Abc_NtkToBdd( Abc_Ntk_t * pNtk ); diff --git a/src/base/abc/abcFunc.c b/src/base/abc/abcFunc.c index 375617baf..68b5688b8 100644 --- a/src/base/abc/abcFunc.c +++ b/src/base/abc/abcFunc.c @@ -1182,7 +1182,7 @@ Abc_Obj_t * Abc_ConvertAigToAig( Abc_Ntk_t * pNtkAig, Abc_Obj_t * pObjOld ) /**Function************************************************************* - Synopsis [Unmaps the network.] + Synopsis [Unmaps the network with user provided Mio library.] Description [] @@ -1191,16 +1191,15 @@ Abc_Obj_t * Abc_ConvertAigToAig( Abc_Ntk_t * pNtkAig, Abc_Obj_t * pObjOld ) SeeAlso [] ***********************************************************************/ -int Abc_NtkMapToSop( Abc_Ntk_t * pNtk ) +int Abc_NtkMapToSopUsingLibrary( Abc_Ntk_t * pNtk, void* library) { - extern void * Abc_FrameReadLibGen(); Abc_Obj_t * pNode; char * pSop; int i; assert( Abc_NtkHasMapping(pNtk) ); // update the functionality manager - assert( pNtk->pManFunc == Abc_FrameReadLibGen() ); + assert( pNtk->pManFunc == (void*) library ); pNtk->pManFunc = Mem_FlexStart(); // update the nodes Abc_NtkForEachNode( pNtk, pNode, i ) @@ -1215,6 +1214,23 @@ int Abc_NtkMapToSop( Abc_Ntk_t * pNtk ) return 1; } +/**Function************************************************************* + + Synopsis [Unmaps the network.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +int Abc_NtkMapToSop( Abc_Ntk_t * pNtk ) +{ + extern void * Abc_FrameReadLibGen(); + return Abc_NtkMapToSopUsingLibrary(pNtk, Abc_FrameReadLibGen()); +} + /**Function************************************************************* Synopsis [Converts SOP functions into BLIF-MV functions.]