abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
resInt.h
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [resInt.h]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Resynthesis package.]
8 
9  Synopsis [Internal declarations.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - January 15, 2007.]
16 
17  Revision [$Id: resInt.h,v 1.00 2007/01/15 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #ifndef ABC__opt__res__resInt_h
22 #define ABC__opt__res__resInt_h
23 
24 
25 ////////////////////////////////////////////////////////////////////////
26 /// INCLUDES ///
27 ////////////////////////////////////////////////////////////////////////
28 
29 #include "res.h"
30 
31 ////////////////////////////////////////////////////////////////////////
32 /// PARAMETERS ///
33 ////////////////////////////////////////////////////////////////////////
34 
35 
36 
38 
39 
40 ////////////////////////////////////////////////////////////////////////
41 /// BASIC TYPES ///
42 ////////////////////////////////////////////////////////////////////////
43 
44 typedef struct Res_Win_t_ Res_Win_t;
45 struct Res_Win_t_
46 {
47  // windowing parameters
48  Abc_Obj_t * pNode; // the node in the center
49  int nWinTfiMax; // the fanin levels
50  int nWinTfoMax; // the fanout levels
51  int nLevDivMax; // the maximum divisor level
52  // internal windowing parameters
53  int nFanoutLimit; // the limit on the fanout count of a TFO node (if more, the node is treated as a root)
54  int nLevTfiMinus; // the number of additional levels to search from TFO below the level of leaves
55  // derived windowing parameters
56  int nLevLeafMin; // the minimum level of a leaf
57  int nLevTravMin; // the minimum level to search from TFO
58  int nDivsPlus; // the number of additional divisors
59  // the window data
60  Vec_Ptr_t * vRoots; // outputs of the window
61  Vec_Ptr_t * vLeaves; // inputs of the window
62  Vec_Ptr_t * vBranches; // side nodes of the window
63  Vec_Ptr_t * vNodes; // internal nodes of the window
64  Vec_Ptr_t * vDivs; // candidate divisors of the node
65  // temporary data
66  Vec_Vec_t * vMatrix; // TFI nodes below the given node
67 };
68 
69 typedef struct Res_Sim_t_ Res_Sim_t;
70 struct Res_Sim_t_
71 {
72  Abc_Ntk_t * pAig; // AIG for simulation
73  int nTruePis; // the number of true PIs of the window
74  int fConst0; // the node can be replaced by constant 0
75  int fConst1; // the node can be replaced by constant 0
76  // simulation parameters
77  int nWords; // the number of simulation words
78  int nPats; // the number of patterns
79  int nWordsIn; // the number of simulation words in the input patterns
80  int nPatsIn; // the number of patterns in the input patterns
81  int nBytesIn; // the number of bytes in the input patterns
82  int nWordsOut; // the number of simulation words in the output patterns
83  int nPatsOut; // the number of patterns in the output patterns
84  // simulation info
85  Vec_Ptr_t * vPats; // input simulation patterns
86  Vec_Ptr_t * vPats0; // input simulation patterns
87  Vec_Ptr_t * vPats1; // input simulation patterns
88  Vec_Ptr_t * vOuts; // output simulation info
89  int nPats0; // the number of 0-patterns accumulated
90  int nPats1; // the number of 1-patterns accumulated
91  // resub candidates
92  Vec_Vec_t * vCands; // resubstitution candidates
93  // statistics
95 };
96 
97 ////////////////////////////////////////////////////////////////////////
98 /// MACRO DEFINITIONS ///
99 ////////////////////////////////////////////////////////////////////////
100 
101 ////////////////////////////////////////////////////////////////////////
102 /// FUNCTION DECLARATIONS ///
103 ////////////////////////////////////////////////////////////////////////
104 
105 /*=== resDivs.c ==========================================================*/
106 extern void Res_WinDivisors( Res_Win_t * p, int nLevDivMax );
107 extern void Res_WinSweepLeafTfo_rec( Abc_Obj_t * pObj, int nLevelLimit );
108 extern int Res_WinVisitMffc( Abc_Obj_t * pNode );
109 /*=== resFilter.c ==========================================================*/
110 extern int Res_FilterCandidates( Res_Win_t * pWin, Abc_Ntk_t * pAig, Res_Sim_t * pSim, Vec_Vec_t * vResubs, Vec_Vec_t * vResubsW, int nFaninsMax, int fArea );
111 extern int Res_FilterCandidatesArea( Res_Win_t * pWin, Abc_Ntk_t * pAig, Res_Sim_t * pSim, Vec_Vec_t * vResubs, Vec_Vec_t * vResubsW, int nFaninsMax );
112 /*=== resSat.c ==========================================================*/
113 extern void * Res_SatProveUnsat( Abc_Ntk_t * pAig, Vec_Ptr_t * vFanins );
114 extern int Res_SatSimulate( Res_Sim_t * p, int nPats, int fOnSet );
115 /*=== resSim.c ==========================================================*/
116 extern Res_Sim_t * Res_SimAlloc( int nWords );
117 extern void Res_SimFree( Res_Sim_t * p );
118 extern int Res_SimPrepare( Res_Sim_t * p, Abc_Ntk_t * pAig, int nTruePis, int fVerbose );
119 /*=== resStrash.c ==========================================================*/
120 extern Abc_Ntk_t * Res_WndStrash( Res_Win_t * p );
121 /*=== resWnd.c ==========================================================*/
122 extern void Res_UpdateNetwork( Abc_Obj_t * pObj, Vec_Ptr_t * vFanins, Hop_Obj_t * pFunc, Vec_Vec_t * vLevels );
123 /*=== resWnd.c ==========================================================*/
124 extern Res_Win_t * Res_WinAlloc();
125 extern void Res_WinFree( Res_Win_t * p );
126 extern int Res_WinIsTrivial( Res_Win_t * p );
127 extern int Res_WinCompute( Abc_Obj_t * pNode, int nWinTfiMax, int nWinTfoMax, Res_Win_t * p );
128 
129 
130 
131 
133 
134 
135 
136 #endif
137 
138 ////////////////////////////////////////////////////////////////////////
139 /// END OF FILE ///
140 ////////////////////////////////////////////////////////////////////////
141 
Vec_Ptr_t * vLeaves
Definition: resInt.h:61
Res_Sim_t * Res_SimAlloc(int nWords)
DECLARATIONS ///.
Definition: resSim.c:46
int nWordsOut
Definition: resInt.h:82
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
int Res_FilterCandidates(Res_Win_t *pWin, Abc_Ntk_t *pAig, Res_Sim_t *pSim, Vec_Vec_t *vResubs, Vec_Vec_t *vResubsW, int nFaninsMax, int fArea)
FUNCTION DEFINITIONS ///.
Definition: resFilter.c:49
int nLevDivMax
Definition: resInt.h:51
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition: vecVec.h:42
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int Res_WinIsTrivial(Res_Win_t *p)
Definition: resWin.c:435
Vec_Ptr_t * vPats0
Definition: resInt.h:86
int nTruePis
Definition: resInt.h:73
Abc_Ntk_t * Res_WndStrash(Res_Win_t *p)
FUNCTION DEFINITIONS ///.
Definition: resStrash.c:49
int Res_FilterCandidatesArea(Res_Win_t *pWin, Abc_Ntk_t *pAig, Res_Sim_t *pSim, Vec_Vec_t *vResubs, Vec_Vec_t *vResubsW, int nFaninsMax)
Definition: resFilter.c:241
Vec_Ptr_t * vRoots
Definition: resInt.h:60
void Res_WinSweepLeafTfo_rec(Abc_Obj_t *pObj, int nLevelLimit)
Definition: resDivs.c:196
int Res_WinCompute(Abc_Obj_t *pNode, int nWinTfiMax, int nWinTfoMax, Res_Win_t *p)
Definition: resWin.c:451
typedefABC_NAMESPACE_HEADER_START struct Res_Win_t_ Res_Win_t
INCLUDES ///.
Definition: resInt.h:44
int Res_SimPrepare(Res_Sim_t *p, Abc_Ntk_t *pAig, int nTruePis, int fVerbose)
Definition: resSim.c:731
void Res_UpdateNetwork(Abc_Obj_t *pObj, Vec_Ptr_t *vFanins, Hop_Obj_t *pFunc, Vec_Vec_t *vLevels)
Definition: resCore.c:185
int nWords
Definition: abcNpn.c:127
Definition: hop.h:65
Vec_Vec_t * vCands
Definition: resInt.h:92
Vec_Ptr_t * vDivs
Definition: resInt.h:64
Abc_Ntk_t * pAig
Definition: resInt.h:72
int nLevTravMin
Definition: resInt.h:57
int nLevLeafMin
Definition: resInt.h:56
int Res_SatSimulate(Res_Sim_t *p, int nPats, int fOnSet)
Definition: resSat.c:212
int nFanoutLimit
Definition: resInt.h:53
void Res_SimFree(Res_Sim_t *p)
Definition: resSim.c:127
int nLevTfiMinus
Definition: resInt.h:54
Vec_Ptr_t * vPats1
Definition: resInt.h:87
int nWinTfiMax
Definition: resInt.h:49
int nPats1
Definition: resInt.h:90
int nWords
Definition: resInt.h:77
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Definition: abc_global.h:105
Vec_Ptr_t * vNodes
Definition: resInt.h:63
int fConst1
Definition: resInt.h:75
abctime timeSat
Definition: resInt.h:94
int fConst0
Definition: resInt.h:74
#define ABC_NAMESPACE_HEADER_END
Definition: abc_global.h:106
int nWinTfoMax
Definition: resInt.h:50
Vec_Ptr_t * vPats
Definition: resInt.h:85
Vec_Ptr_t * vBranches
Definition: resInt.h:62
int nPatsIn
Definition: resInt.h:80
int nWordsIn
Definition: resInt.h:79
void Res_WinFree(Res_Win_t *p)
Definition: resWin.c:76
Vec_Vec_t * vMatrix
Definition: resInt.h:66
int nDivsPlus
Definition: resInt.h:58
Res_Win_t * Res_WinAlloc()
DECLARATIONS ///.
Definition: resWin.c:46
void * Res_SatProveUnsat(Abc_Ntk_t *pAig, Vec_Ptr_t *vFanins)
FUNCTION DEFINITIONS ///.
Definition: resSat.c:52
int nBytesIn
Definition: resInt.h:81
Vec_Ptr_t * vOuts
Definition: resInt.h:88
int nPats0
Definition: resInt.h:89
int nPats
Definition: resInt.h:78
ABC_INT64_T abctime
Definition: abc_global.h:278
int Res_WinVisitMffc(Abc_Obj_t *pNode)
Definition: resDivs.c:272
int nPatsOut
Definition: resInt.h:83
Abc_Obj_t * pNode
Definition: resInt.h:48
void Res_WinDivisors(Res_Win_t *p, int nLevDivMax)
MACRO DEFINITIONS ///.
Definition: resDivs.c:48