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 37 ABC_NAMESPACE_HEADER_START 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 94 abctime timeSat; 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 132 ABC_NAMESPACE_HEADER_END 133 134 135 136 #endif 137 138 //////////////////////////////////////////////////////////////////////// 139 /// END OF FILE /// 140 //////////////////////////////////////////////////////////////////////// 141 142