abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
dchCore.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [dchCore.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Choice computation for tech-mapping.]
8 
9  Synopsis [The core procedures.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - June 29, 2008.]
16 
17  Revision [$Id: dchCore.c,v 1.00 2008/07/29 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "dchInt.h"
22 
24 
25 
26 ////////////////////////////////////////////////////////////////////////
27 /// DECLARATIONS ///
28 ////////////////////////////////////////////////////////////////////////
29 
30 ////////////////////////////////////////////////////////////////////////
31 /// FUNCTION DEFINITIONS ///
32 ////////////////////////////////////////////////////////////////////////
33 
34 /**Function*************************************************************
35 
36  Synopsis [This procedure sets default parameters.]
37 
38  Description []
39 
40  SideEffects []
41 
42  SeeAlso []
43 
44 ***********************************************************************/
46 {
47  memset( p, 0, sizeof(Dch_Pars_t) );
48  p->nWords = 8; // the number of simulation words
49  p->nBTLimit = 1000; // conflict limit at a node
50  p->nSatVarMax = 5000; // the max number of SAT variables
51  p->fSynthesis = 1; // derives three snapshots
52  p->fPolarFlip = 1; // uses polarity adjustment
53  p->fSimulateTfo = 1; // simulate TFO
54  p->fPower = 0; // power-aware rewriting
55  p->fLightSynth = 0; // uses lighter version of synthesis
56  p->fSkipRedSupp = 0; // skips choices with redundant structural support
57  p->fVerbose = 0; // verbose stats
58  p->nNodesAhead = 1000; // the lookahead in terms of nodes
59  p->nCallsRecycle = 100; // calls to perform before recycling SAT solver
60 }
61 
62 /**Function*************************************************************
63 
64  Synopsis [Returns verbose parameter.]
65 
66  Description []
67 
68  SideEffects []
69 
70  SeeAlso []
71 
72 ***********************************************************************/
74 {
75  return p->fVerbose;
76 }
77 
78 /**Function*************************************************************
79 
80  Synopsis [Performs computation of AIGs with choices.]
81 
82  Description [Takes several AIGs and performs choicing.]
83 
84  SideEffects []
85 
86  SeeAlso []
87 
88 ***********************************************************************/
90 {
91  Dch_Man_t * p;
92  Aig_Man_t * pResult;
93  abctime clk, clkTotal = Abc_Clock();
94  // reset random numbers
95  Aig_ManRandom(1);
96  // start the choicing manager
97  p = Dch_ManCreate( pAig, pPars );
98  // compute candidate equivalence classes
99 clk = Abc_Clock();
100  p->ppClasses = Dch_CreateCandEquivClasses( pAig, pPars->nWords, pPars->fVerbose );
101 p->timeSimInit = Abc_Clock() - clk;
102 // Dch_ClassesPrint( p->ppClasses, 0 );
103  p->nLits = Dch_ClassesLitNum( p->ppClasses );
104  // perform SAT sweeping
105  Dch_ManSweep( p );
106  // free memory ahead of time
107 p->timeTotal = Abc_Clock() - clkTotal;
108  Dch_ManStop( p );
109  // create choices
110  ABC_FREE( pAig->pTable );
111  pResult = Dch_DeriveChoiceAig( pAig, pPars->fSkipRedSupp );
112  // count the number of representatives
113  if ( pPars->fVerbose )
114  Abc_Print( 1, "STATS: Ands:%8d ->%8d. Reprs:%7d ->%7d. Choices =%7d.\n",
115  Aig_ManNodeNum(pAig),
116  Aig_ManNodeNum(pResult),
118  Dch_DeriveChoiceCountEquivs( pResult ),
119  Aig_ManChoiceNum( pResult ) );
120  return pResult;
121 }
122 
123 /**Function*************************************************************
124 
125  Synopsis [Performs computation of AIGs with choices.]
126 
127  Description [Takes several AIGs and performs choicing.]
128 
129  SideEffects []
130 
131  SeeAlso []
132 
133 ***********************************************************************/
135 {
136  Dch_Man_t * p;
137  abctime clk, clkTotal = Abc_Clock();
138  // reset random numbers
139  Aig_ManRandom(1);
140  // start the choicing manager
141  p = Dch_ManCreate( pAig, pPars );
142  // compute candidate equivalence classes
143 clk = Abc_Clock();
144  p->ppClasses = Dch_CreateCandEquivClasses( pAig, pPars->nWords, pPars->fVerbose );
145 p->timeSimInit = Abc_Clock() - clk;
146 // Dch_ClassesPrint( p->ppClasses, 0 );
147  p->nLits = Dch_ClassesLitNum( p->ppClasses );
148  // perform SAT sweeping
149  Dch_ManSweep( p );
150  // free memory ahead of time
151 p->timeTotal = Abc_Clock() - clkTotal;
152  Dch_ManStop( p );
153 }
154 
155 ////////////////////////////////////////////////////////////////////////
156 /// END OF FILE ///
157 ////////////////////////////////////////////////////////////////////////
158 
159 
161 
char * memset()
int Dch_ClassesLitNum(Dch_Cla_t *p)
Definition: dchClass.c:206
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Dch_ComputeEquivalences(Aig_Man_t *pAig, Dch_Pars_t *pPars)
Definition: dchCore.c:134
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Aig_Man_t * Dch_ComputeChoices(Aig_Man_t *pAig, Dch_Pars_t *pPars)
Definition: dchCore.c:89
void Dch_ManStop(Dch_Man_t *p)
Definition: dchMan.c:122
Aig_Man_t * Dch_DeriveChoiceAig(Aig_Man_t *pAig, int fSkipRedSupps)
Definition: dchChoice.c:517
void Dch_ManSweep(Dch_Man_t *p)
Definition: dchSweep.c:106
unsigned Aig_ManRandom(int fReset)
Definition: aigUtil.c:1157
typedefABC_NAMESPACE_HEADER_START struct Dch_Pars_t_ Dch_Pars_t
INCLUDES ///.
Definition: dch.h:43
static abctime Abc_Clock()
Definition: abc_global.h:279
static int Aig_ManNodeNum(Aig_Man_t *p)
Definition: aig.h:256
Dch_Cla_t * Dch_CreateCandEquivClasses(Aig_Man_t *pAig, int nWords, int fVerbose)
Definition: dchSim.c:264
int nLits
Definition: dchInt.h:82
Dch_Man_t * Dch_ManCreate(Aig_Man_t *pAig, Dch_Pars_t *pPars)
DECLARATIONS ///.
Definition: dchMan.c:45
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
Dch_Cla_t * ppClasses
Definition: dchInt.h:60
int Dch_ManReadVerbose(Dch_Pars_t *p)
Definition: dchCore.c:73
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Dch_DeriveChoiceCountEquivs(Aig_Man_t *pAig)
Definition: dchChoice.c:89
abctime timeTotal
Definition: dchInt.h:95
int Aig_ManChoiceNum(Aig_Man_t *p)
Definition: aigUtil.c:1007
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
#define ABC_FREE(obj)
Definition: abc_global.h:232
abctime timeSimInit
Definition: dchInt.h:87
int Dch_DeriveChoiceCountReprs(Aig_Man_t *pAig)
FUNCTION DECLARATIONS ///.
Definition: dchChoice.c:75
ABC_NAMESPACE_IMPL_START void Dch_ManSetDefaultParams(Dch_Pars_t *p)
DECLARATIONS ///.
Definition: dchCore.c:45
ABC_INT64_T abctime
Definition: abc_global.h:278