abc/src/map/if/ifCore.c

90 lines
2.8 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;
2006-12-04 17:01:00 +01:00
int nItersFlow = 1;
2006-12-09 17:01:00 +01:00
int nItersArea = 2;
2006-11-28 17:01:00 +01:00
int clkTotal = clock();
int i;
// set arrival times and trivial cuts at const 1 and PIs
If_ManConst1(p)->Cuts[0].Delay = 0.0;
If_ManForEachPi( p, pObj, i )
pObj->Cuts[0].Delay = p->pPars->pTimesArr[i];
// set the fanout estimates of the PIs
If_ManForEachPi( p, pObj, i )
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
for ( i = 0; i < nItersFlow; 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
for ( i = 0; i < nItersArea; 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 ///
////////////////////////////////////////////////////////////////////////