From 990abc4349bec5ff91b27af824856165982917a5 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Tue, 8 Jul 2025 19:26:10 -0700 Subject: [PATCH] Extending external AIG APIs. --- src/aig/gia/gia.h | 1 + src/aig/gia/giaMini.c | 1 + src/aig/gia/giaTim.c | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h index cb3dc52f1..ee79ccd7a 100644 --- a/src/aig/gia/gia.h +++ b/src/aig/gia/gia.h @@ -1726,6 +1726,7 @@ extern Gia_Man_t * Gia_ManUpdateExtraAig( void * pTime, Gia_Man_t * pAig extern Gia_Man_t * Gia_ManUpdateExtraAig2( void * pTime, Gia_Man_t * pAig, Vec_Int_t * vBoxesLeft ); extern Gia_Man_t * Gia_ManDupCollapse( Gia_Man_t * p, Gia_Man_t * pBoxes, Vec_Int_t * vBoxPres, int fSeq ); extern int Gia_ManVerifyWithBoxes( Gia_Man_t * pGia, int nBTLimit, int nTimeLim, int fSeq, int fDumpFiles, int fVerbose, char * pFileSpec ); +extern Vec_Int_t * Gia_ManDeriveBoxMapping( Gia_Man_t * pGia ); /*=== giaTruth.c ===========================================================*/ extern word Gia_LutComputeTruth6( Gia_Man_t * p, int iObj, Vec_Wrd_t * vTruths ); extern word Gia_ObjComputeTruthTable6Lut( Gia_Man_t * p, int iObj, Vec_Wrd_t * vTemp ); diff --git a/src/aig/gia/giaMini.c b/src/aig/gia/giaMini.c index 5ebedfb78..e20f700e8 100644 --- a/src/aig/gia/giaMini.c +++ b/src/aig/gia/giaMini.c @@ -560,6 +560,7 @@ int * Abc_FrameGiaOutputMiniLutObj( Abc_Frame_t * pAbc ) int * pRes = NULL; if ( pAbc == NULL ) printf( "ABC framework is not initialized by calling Abc_Start()\n" ); + pAbc->vMiniLutObjs = Gia_ManDeriveBoxMapping( Abc_FrameReadGia( pAbc ) ); if ( pAbc->vMiniLutObjs == NULL ) printf( "MiniLut objects are not defined.\n" ); pRes = Vec_IntReleaseArray( pAbc->vMiniLutObjs ); diff --git a/src/aig/gia/giaTim.c b/src/aig/gia/giaTim.c index fc40835cb..17f03aa4a 100644 --- a/src/aig/gia/giaTim.c +++ b/src/aig/gia/giaTim.c @@ -1067,6 +1067,27 @@ int Gia_ManVerifyWithBoxes( Gia_Man_t * pGia, int nBTLimit, int nTimeLim, int fS return Status; } +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +Vec_Int_t * Gia_ManDeriveBoxMapping( Gia_Man_t * pGia ) +{ + Tim_Man_t * pTim = (Tim_Man_t *)pGia->pManTime; + Vec_Int_t * vRes = Vec_IntAlloc( 100 ); + int i, nBoxes = Tim_ManBoxNum( pTim ); + for ( i = 0; i < nBoxes; i++ ) + Vec_IntPush( vRes, Tim_ManBoxCopy(pTim, i) ); + return vRes; +} + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// ////////////////////////////////////////////////////////////////////////