abc/src/map/if/ifCore.c

100 lines
3.1 KiB
C
Raw Normal View History

2006-02-20 17:01:00 +01:00
/**CFile****************************************************************
2006-11-22 17:01:00 +01:00
FileName [ifCore.c]
2006-02-20 17:01:00 +01:00
SystemName [ABC: Logic synthesis and verification system.]
2006-11-22 17:01:00 +01:00
PackageName [FPGA mapping based on priority cuts.]
2006-02-20 17:01:00 +01:00
2006-11-22 17:01:00 +01:00
Synopsis [The central part of the mapper.]
2006-02-20 17:01:00 +01:00
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
2006-11-22 17:01:00 +01:00
Date [Ver. 1.0. Started - November 21, 2006.]
2006-02-20 17:01:00 +01:00
2006-11-22 17:01:00 +01:00
Revision [$Id: ifCore.c,v 1.00 2006/11/21 00:00:00 alanmi Exp $]
2006-02-20 17:01:00 +01:00
***********************************************************************/
2006-11-22 17:01:00 +01:00
#include "if.h"
2006-02-20 17:01:00 +01:00
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
2006-11-28 17:01:00 +01:00
int If_ManPerformMapping( If_Man_t * p )
{
If_Obj_t * pObj;
int clkTotal = clock();
2006-12-10 17:01:00 +01:00
int RetValue, i;
// try sequential mapping
if ( p->pPars->fSeqMap )
{
RetValue = If_ManPerformMappingSeq( p );
if ( p->pPars->fVerbose )
{
PRT( "Total time", clock() - clkTotal );
}
return RetValue;
}
2006-11-28 17:01:00 +01:00
// set arrival times and trivial cuts at const 1 and PIs
If_ManConst1(p)->Cuts[0].Delay = 0.0;
2006-12-10 17:01:00 +01:00
If_ManForEachCi( p, pObj, i )
2006-11-28 17:01:00 +01:00
pObj->Cuts[0].Delay = p->pPars->pTimesArr[i];
// set the fanout estimates of the PIs
2006-12-10 17:01:00 +01:00
If_ManForEachCi( p, pObj, i )
2006-11-28 17:01:00 +01:00
pObj->EstRefs = (float)1.0;
// delay oriented mapping
2006-12-04 17:01:00 +01:00
if ( p->pPars->fPreprocess && !p->pPars->fArea && p->pPars->nCutsMax >= 4 )
If_ManPerformMappingPreprocess( p );
else
2006-12-09 17:01:00 +01:00
If_ManPerformMappingRound( p, p->pPars->nCutsMax, 0, 1, "Delay" );
2006-12-04 17:01:00 +01:00
// try to improve area by expanding and reducing the cuts
2006-12-05 17:01:00 +01:00
if ( p->pPars->fExpRed && !p->pPars->fTruth )
2006-12-04 17:01:00 +01:00
If_ManImproveMapping( p );
2006-11-28 17:01:00 +01:00
// area flow oriented mapping
2007-01-21 17:01:00 +01:00
for ( i = 0; i < p->pPars->nFlowIters; i++ )
2006-12-04 17:01:00 +01:00
{
2006-12-09 17:01:00 +01:00
If_ManPerformMappingRound( p, p->pPars->nCutsMax, 1, 1, "Flow" );
2006-12-05 17:01:00 +01:00
if ( p->pPars->fExpRed && !p->pPars->fTruth )
2006-12-04 17:01:00 +01:00
If_ManImproveMapping( p );
}
2006-11-28 17:01:00 +01:00
// area oriented mapping
2007-01-21 17:01:00 +01:00
for ( i = 0; i < p->pPars->nAreaIters; i++ )
2006-12-04 17:01:00 +01:00
{
2006-12-09 17:01:00 +01:00
If_ManPerformMappingRound( p, p->pPars->nCutsMax, 2, 1, "Area" );
2006-12-05 17:01:00 +01:00
if ( p->pPars->fExpRed && !p->pPars->fTruth )
2006-12-04 17:01:00 +01:00
If_ManImproveMapping( p );
}
2006-11-28 17:01:00 +01:00
if ( p->pPars->fVerbose )
{
PRT( "Total time", clock() - clkTotal );
}
return 1;
}
2006-02-20 17:01:00 +01:00
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////