abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
mpmCore.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [mpmCore.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Configurable technology mapper.]
8 
9  Synopsis [Core procedures.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - June 1, 2013.]
16 
17  Revision [$Id: mpmCore.c,v 1.00 2013/06/01 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "aig/gia/gia.h"
22 #include "mpmInt.h"
23 
25 
26 
27 ////////////////////////////////////////////////////////////////////////
28 /// DECLARATIONS ///
29 ////////////////////////////////////////////////////////////////////////
30 
31 ////////////////////////////////////////////////////////////////////////
32 /// FUNCTION DEFINITIONS ///
33 ////////////////////////////////////////////////////////////////////////
34 
35 /**Function*************************************************************
36 
37  Synopsis []
38 
39  Description []
40 
41  SideEffects []
42 
43  SeeAlso []
44 
45 ***********************************************************************/
47 {
48  memset( p, 0, sizeof(Mpm_Par_t) );
49  p->pLib = NULL; // LUT library
50  p->nNumCuts = 8; // cut number
51  p->fUseTruth = 0; // uses truth tables
52  p->fUseDsd = 0; // uses DSDs
53  p->fCutMin = 0; // enables cut minimization
54  p->fOneRound = 0; // enabled one round
55  p->DelayTarget = -1; // delay target
56  p->fDeriveLuts = 0; // use truth tables to derive AIG structure
57  p->fMap4Cnf = 0; // mapping for CNF
58  p->fMap4Aig = 0; // mapping for AIG
59  p->fMap4Gates = 0; // mapping for gates
60  p->fVerbose = 0; // verbose output
61  p->fVeryVerbose = 0; // verbose output
62 }
63 
64 /**Function*************************************************************
65 
66  Synopsis []
67 
68  Description []
69 
70  SideEffects []
71 
72  SeeAlso []
73 
74 ***********************************************************************/
76 {
77  Gia_Man_t * pNew;
78  Mpm_Man_t * p;
79  p = Mpm_ManStart( pMig, pPars );
80  if ( p->pPars->fVerbose )
82  Mpm_ManPrepare( p );
83  Mpm_ManPerform( p );
84  if ( p->pPars->fVerbose )
85  Mpm_ManPrintStats( p );
86  pNew = (Gia_Man_t *)Mpm_ManFromIfLogic( p );
87  Mpm_ManStop( p );
88  return pNew;
89 }
91 {
92  Mig_Man_t * p;
93  Gia_Man_t * pNew;
94  assert( pPars->pLib->LutMax <= MPM_VAR_MAX );
95  assert( pPars->nNumCuts <= MPM_CUT_MAX );
96  if ( pPars->fUseGates )
97  {
98  pGia = Gia_ManDupMuxes( pGia, 2 );
99  p = Mig_ManCreate( pGia );
100  Gia_ManStop( pGia );
101  }
102  else
103  p = Mig_ManCreate( pGia );
104  pNew = Mpm_ManPerformLutMapping( p, pPars );
105  Mig_ManStop( p );
106  return pNew;
107 }
108 
109 ////////////////////////////////////////////////////////////////////////
110 /// END OF FILE ///
111 ////////////////////////////////////////////////////////////////////////
112 
113 
115 
char * memset()
Mpm_Par_t * pPars
Definition: mpmInt.h:98
int DelayTarget
Definition: mpm.h:62
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
int fCutMin
Definition: mpm.h:66
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Gia_Man_t * Mpm_ManPerformLutMapping(Mig_Man_t *pMig, Mpm_Par_t *pPars)
Definition: mpmCore.c:75
int fOneRound
Definition: mpm.h:67
void Mpm_ManPrepare(Mpm_Man_t *p)
Definition: mpmMap.c:794
Gia_Man_t * Mpm_ManLutMapping(Gia_Man_t *pGia, Mpm_Par_t *pPars)
Definition: mpmCore.c:90
int nNumCuts
Definition: mpm.h:61
int fVerbose
Definition: mpm.h:72
void Mig_ManStop(Mig_Man_t *p)
Definition: mpmMig.c:56
int fUseGates
Definition: mpm.h:63
int fMap4Cnf
Definition: mpm.h:69
ABC_NAMESPACE_IMPL_START void Mpm_ManSetParsDefault(Mpm_Par_t *p)
DECLARATIONS ///.
Definition: mpmCore.c:46
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
void * Mpm_ManFromIfLogic(Mpm_Man_t *pMan)
Definition: mpmAbc.c:213
Gia_Man_t * Gia_ManDupMuxes(Gia_Man_t *p, int Limit)
Definition: giaMuxes.c:96
int fMap4Gates
Definition: mpm.h:71
int fMap4Aig
Definition: mpm.h:70
void Mpm_ManStop(Mpm_Man_t *p)
Definition: mpmMan.c:111
void Mpm_ManPrintStats(Mpm_Man_t *p)
Definition: mpmMan.c:173
Definition: mpm.h:57
int fDeriveLuts
Definition: mpm.h:68
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
Mpm_Man_t * Mpm_ManStart(Mig_Man_t *pMig, Mpm_Par_t *pPars)
DECLARATIONS ///.
Definition: mpmMan.c:45
#define MPM_CUT_MAX
INCLUDES ///.
Definition: mpmInt.h:50
void Mpm_ManPerform(Mpm_Man_t *p)
Definition: mpmMap.c:833
Definition: gia.h:95
#define MPM_VAR_MAX
INCLUDES ///.
Definition: mpm.h:40
Mpm_LibLut_t * pLib
Definition: mpm.h:59
#define assert(ex)
Definition: util_old.h:213
int LutMax
Definition: mpm.h:50
Mig_Man_t * Mig_ManCreate(void *pGia)
FUNCTION DECLARATIONS ///.
Definition: mpmAbc.c:83
void Mpm_ManPrintStatsInit(Mpm_Man_t *p)
Definition: mpmMan.c:166
int fUseTruth
Definition: mpm.h:64
int fVeryVerbose
Definition: mpm.h:73
int fUseDsd
Definition: mpm.h:65