1 /**CFile****************************************************************
2 
3   FileName    [amapCore.c]
4 
5   SystemName  [ABC: Logic synthesis and verification system.]
6 
7   PackageName [Technology mapper for standard cells.]
8 
9   Synopsis    [Core mapping procedures.]
10 
11   Author      [Alan Mishchenko]
12 
13   Affiliation [UC Berkeley]
14 
15   Date        [Ver. 1.0. Started - June 20, 2005.]
16 
17   Revision    [$Id: amapCore.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "amapInt.h"
22 #include "base/main/main.h"
23 
24 ABC_NAMESPACE_IMPL_START
25 
26 
27 ////////////////////////////////////////////////////////////////////////
28 ///                        DECLARATIONS                              ///
29 ////////////////////////////////////////////////////////////////////////
30 
31 ////////////////////////////////////////////////////////////////////////
32 ///                     FUNCTION DEFINITIONS                         ///
33 ////////////////////////////////////////////////////////////////////////
34 
35 /**Function*************************************************************
36 
37   Synopsis    [This procedure sets default parameters.]
38 
39   Description []
40 
41   SideEffects []
42 
43   SeeAlso     []
44 
45 ***********************************************************************/
Amap_ManSetDefaultParams(Amap_Par_t * p)46 void Amap_ManSetDefaultParams( Amap_Par_t * p )
47 {
48     memset( p, 0, sizeof(Amap_Par_t) );
49     p->nIterFlow = 1;            // iterations of area flow
50     p->nIterArea = 4;            // iteratoins of exact area
51     p->nCutsMax  = 500;          // the maximum number of cuts at a node
52     p->fUseMuxes = 0;            // enables the use of MUXes
53     p->fUseXors  = 1;            // enables the use of XORs
54     p->fFreeInvs = 0;            // assume inverters are free (area = 0)
55     p->fEpsilon  = (float)0.001; // used to compare floating point numbers
56     p->fVerbose  = 0;            // verbosity flag
57 }
58 
59 /**Function*************************************************************
60 
61   Synopsis    []
62 
63   Description []
64 
65   SideEffects []
66 
67   SeeAlso     []
68 
69 ***********************************************************************/
Amap_ManTest(Aig_Man_t * pAig,Amap_Par_t * pPars)70 Vec_Ptr_t * Amap_ManTest( Aig_Man_t * pAig, Amap_Par_t * pPars )
71 {
72 //    extern void * Abc_FrameReadLibGen2();
73     Vec_Ptr_t * vRes;
74     Amap_Man_t * p;
75     Amap_Lib_t * pLib;
76     abctime clkTotal = Abc_Clock();
77     pLib = (Amap_Lib_t *)Abc_FrameReadLibGen2();
78     if ( pLib == NULL )
79     {
80         printf( "Library is not available.\n" );
81         return NULL;
82     }
83     p = Amap_ManStart( Aig_ManNodeNum(pAig) );
84     p->pPars = pPars;
85     p->pLib  = pLib;
86     p->fAreaInv = pPars->fFreeInvs? 0.0 : pLib->pGateInv->dArea;
87     p->fUseMux = pPars->fUseMuxes && pLib->fHasMux;
88     p->fUseXor = pPars->fUseXors && pLib->fHasXor;
89     p->ppCutsTemp = ABC_CALLOC( Amap_Cut_t *, 2 * pLib->nNodes );
90     p->pMatsTemp = ABC_CALLOC( int, 2 * pLib->nNodes );
91     Amap_ManCreate( p, pAig );
92     Amap_ManMap( p );
93     vRes = NULL;
94     vRes = Amap_ManProduceMapped( p );
95     Amap_ManStop( p );
96 if ( pPars->fVerbose )
97 {
98 ABC_PRT( "Total runtime", Abc_Clock() - clkTotal );
99 }
100     return vRes;
101 }
102 
103 
104 ////////////////////////////////////////////////////////////////////////
105 ///                       END OF FILE                                ///
106 ////////////////////////////////////////////////////////////////////////
107 
108 
109 ABC_NAMESPACE_IMPL_END
110 
111