Updating procedures to dump cut info.

This commit is contained in:
Alan Mishchenko 2025-08-18 22:00:43 -07:00
parent 0e4a080779
commit 279217b73d
2 changed files with 9 additions and 9 deletions

View File

@ -332,7 +332,7 @@ void If_ManStop( If_Man_t * p )
char pFileName[1000] = {0};
// "I15_O20_L32_N256_C16_K6__name.bin"
char * pName = Extra_FileNameGeneric(Extra_FileNameWithoutPath(p->pName));
sprintf( pFileName, "I%d_O%d_L%d_N%d_C%d_K%d__%s.bin", If_ManCiNum(p), If_ManCoNum(p), p->nLevelMax, If_ManAndNum(p), p->pPars->nCutsMax, p->pPars->nLutSize, pName );
sprintf( pFileName, "%s__I%d_O%d_L%d_N%d_C%d_K%d.bin", pName, If_ManCiNum(p), If_ManCoNum(p), p->nLevelMax, If_ManAndNum(p), p->pPars->nCutsMax, p->pPars->nLutSize );
ABC_FREE( pName );
FILE * pFile = fopen( pFileName, "wb" );
if ( pFile == NULL )
@ -350,6 +350,9 @@ void If_ManStop( If_Man_t * p )
{
char pFileName[1000] = {0}, pBuffer[100];
int nUnique = 0, nChunks = 0, nChunkSize = 1 << 10, nBytes = 0;
char * pName = Extra_FileNameGeneric(Extra_FileNameWithoutPath(p->pName));
sprintf( pFileName, "%s__", pName );
ABC_FREE( pName );
for ( int i = 7; i <= p->pPars->nLutSize; i++ ) {
nUnique = Vec_MemEntryNum(p->vTtMem[i]);
nChunks = (nUnique + nChunkSize - 1) / nChunkSize;
@ -357,10 +360,7 @@ void If_ManStop( If_Man_t * p )
sprintf( pBuffer, "%s%02d_%02d", i == 7 ? "":"__", i, nChunks );
strcat( pFileName, pBuffer );
}
char * pName = Extra_FileNameGeneric(Extra_FileNameWithoutPath(p->pName));
sprintf( pBuffer, "__%s.bin", pName );
ABC_FREE( pName );
strcat( pFileName, pBuffer );
strcat( pFileName, ".bin" );
FILE * pFile = fopen( pFileName, "wb" );
if ( pFile == NULL )
printf( "Cannot open file \"%s\" for writing.\n", pFileName );

View File

@ -483,6 +483,10 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
if ( p->pPars->fUserRecLib || p->pPars->fUserSesLib )
assert(If_ObjCutBest(pObj)->Cost < IF_COST_MAX && If_ObjCutBest(pObj)->Delay < ABC_INFINITY);
}
if ( p->vCuts ) {
extern void If_ManDumpCutsAndCost( If_Man_t * p, If_Obj_t * pObj, Vec_Int_t * vCuts, Vec_Int_t * vCutCosts );
If_ManDumpCutsAndCost( p, pObj, p->vCuts, p->vCutCosts );
}
// add the trivial cut to the set
if ( !pObj->fSkipCut && If_ObjCutBest(pObj)->nLeaves > 1 )
{
@ -503,10 +507,6 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
if ( p->pPars->pFuncUser )
If_ObjForEachCut( pObj, pCut, i )
p->pPars->pFuncUser( p, pObj, pCut );
if ( p->vCuts ) {
extern void If_ManDumpCutsAndCost( If_Man_t * p, If_Obj_t * pObj, Vec_Int_t * vCuts, Vec_Int_t * vCutCosts );
If_ManDumpCutsAndCost( p, pObj, p->vCuts, p->vCutCosts );
}
// free the cuts
If_ManDerefNodeCutSet( p, pObj );
}