abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cutInt.h
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [cutInt.h]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [K-feasible cut computation package.]
8 
9  Synopsis [External declarations.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - June 20, 2005.]
16 
17  Revision [$Id: cutInt.h,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #ifndef ABC__opt__cut__cutInt_h
22 #define ABC__opt__cut__cutInt_h
23 
24 
25 ////////////////////////////////////////////////////////////////////////
26 /// INCLUDES ///
27 ////////////////////////////////////////////////////////////////////////
28 
29 #include <stdio.h>
30 #include "misc/extra/extra.h"
31 #include "misc/vec/vec.h"
32 #include "cut.h"
33 #include "cutList.h"
34 
36 
37 
38 ////////////////////////////////////////////////////////////////////////
39 /// PARAMETERS ///
40 ////////////////////////////////////////////////////////////////////////
41 
42 ////////////////////////////////////////////////////////////////////////
43 /// BASIC TYPES ///
44 ////////////////////////////////////////////////////////////////////////
45 
46 typedef struct Cut_HashTableStruct_t_ Cut_HashTable_t;
47 
49 {
50  // user preferences
51  Cut_Params_t * pParams; // computation parameters
52  Vec_Int_t * vFanCounts; // the array of fanout counters
53  Vec_Int_t * vNodeAttrs; // node attributes (1 = global; 0 = local)
54  // storage for cuts
55  Vec_Ptr_t * vCutsNew; // new cuts by node ID
56  Vec_Ptr_t * vCutsOld; // old cuts by node ID
57  Vec_Ptr_t * vCutsTemp; // temp cuts for cutset nodes by cutset node number
58  // memory management
60  int EntrySize;
62  // temporary variables
65  int fCompl0;
66  int fCompl1;
67  int fSimul;
68  int nNodeCuts;
73  unsigned * puTemp[4];
74  // record of the cut computation
75  Vec_Int_t * vNodeCuts; // the number of cuts for each node
76  Vec_Int_t * vNodeStarts; // the number of the starting cut of each node
77  Vec_Int_t * vCutPairs; // the pairs of parent cuts for each cut
78  // minimum delay mapping with the given cuts
82  int nDelayMin;
83  // statistics
84  int nCutsCur;
87  int nCutsPeak;
88  int nCutsTriv;
91  int nNodes;
92  int nNodesDag;
94  // runtime
101 };
102 
103 // iterator through all the cuts of the list
104 #define Cut_ListForEachCut( pList, pCut ) \
105  for ( pCut = pList; \
106  pCut; \
107  pCut = pCut->pNext )
108 #define Cut_ListForEachCutStop( pList, pCut, pStop ) \
109  for ( pCut = pList; \
110  pCut != pStop; \
111  pCut = pCut->pNext )
112 #define Cut_ListForEachCutSafe( pList, pCut, pCut2 ) \
113  for ( pCut = pList, \
114  pCut2 = pCut? pCut->pNext: NULL; \
115  pCut; \
116  pCut = pCut2, \
117  pCut2 = pCut? pCut->pNext: NULL )
118 
119 ////////////////////////////////////////////////////////////////////////
120 /// MACRO DEFINITIONS ///
121 ////////////////////////////////////////////////////////////////////////
122 
123 // computes signature of the node
124 static inline unsigned Cut_NodeSign( int Node ) { return (1 << (Node % 31)); }
125 static inline int Cut_TruthWords( int nVarsMax ) { return nVarsMax <= 5 ? 1 : (1 << (nVarsMax - 5)); }
126 
127 ////////////////////////////////////////////////////////////////////////
128 /// FUNCTION DECLARATIONS ///
129 ////////////////////////////////////////////////////////////////////////
130 
131 /*=== cutCut.c ==========================================================*/
132 extern Cut_Cut_t * Cut_CutAlloc( Cut_Man_t * p );
133 extern void Cut_CutRecycle( Cut_Man_t * p, Cut_Cut_t * pCut );
134 extern int Cut_CutCompare( Cut_Cut_t * pCut1, Cut_Cut_t * pCut2 );
135 extern Cut_Cut_t * Cut_CutDupList( Cut_Man_t * p, Cut_Cut_t * pList );
136 extern void Cut_CutRecycleList( Cut_Man_t * p, Cut_Cut_t * pList );
137 extern Cut_Cut_t * Cut_CutMergeLists( Cut_Cut_t * pList1, Cut_Cut_t * pList2 );
138 extern void Cut_CutNumberList( Cut_Cut_t * pList );
139 extern Cut_Cut_t * Cut_CutCreateTriv( Cut_Man_t * p, int Node );
140 extern void Cut_CutPrintMerge( Cut_Cut_t * pCut, Cut_Cut_t * pCut0, Cut_Cut_t * pCut1 );
141 /*=== cutMerge.c ==========================================================*/
142 extern Cut_Cut_t * Cut_CutMergeTwo( Cut_Man_t * p, Cut_Cut_t * pCut0, Cut_Cut_t * pCut1 );
143 /*=== cutNode.c ==========================================================*/
144 extern void Cut_NodeDoComputeCuts( Cut_Man_t * p, Cut_List_t * pSuper, int Node, int fCompl0, int fCompl1, Cut_Cut_t * pList0, Cut_Cut_t * pList1, int fTriv, int TreeCode );
145 extern int Cut_CutListVerify( Cut_Cut_t * pList );
146 /*=== cutTable.c ==========================================================*/
147 extern Cut_HashTable_t * Cut_TableStart( int Size );
148 extern void Cut_TableStop( Cut_HashTable_t * pTable );
149 extern int Cut_TableLookup( Cut_HashTable_t * pTable, Cut_Cut_t * pCut, int fStore );
150 extern void Cut_TableClear( Cut_HashTable_t * pTable );
151 extern int Cut_TableReadTime( Cut_HashTable_t * pTable );
152 /*=== cutTruth.c ==========================================================*/
153 extern void Cut_TruthComputeOld( Cut_Cut_t * pCut, Cut_Cut_t * pCut0, Cut_Cut_t * pCut1, int fCompl0, int fCompl1 );
154 extern void Cut_TruthCompute( Cut_Man_t * p, Cut_Cut_t * pCut, Cut_Cut_t * pCut0, Cut_Cut_t * pCut1, int fCompl0, int fCompl1 );
155 
156 
157 
159 
160 #endif
161 
162 ////////////////////////////////////////////////////////////////////////
163 /// END OF FILE ///
164 ////////////////////////////////////////////////////////////////////////
165 
Cut_Cut_t * Cut_CutMergeLists(Cut_Cut_t *pList1, Cut_Cut_t *pList2)
Definition: cutCut.c:185
abctime timeTruth
Definition: cutInt.h:97
Vec_Int_t * vFanCounts
Definition: cutInt.h:52
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
void Cut_TruthComputeOld(Cut_Cut_t *pCut, Cut_Cut_t *pCut0, Cut_Cut_t *pCut1, int fCompl0, int fCompl1)
Definition: cutTruth.c:126
Vec_Ptr_t * vCutsMax
Definition: cutInt.h:79
Vec_Ptr_t * vTemp
Definition: cutInt.h:64
typedefABC_NAMESPACE_HEADER_START struct Cut_ListStruct_t_ Cut_List_t
INCLUDES ///.
Definition: cutList.h:40
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Cut_TruthWords(int nVarsMax)
Definition: cutInt.h:125
int nTruthWords
Definition: cutInt.h:61
void Cut_TableStop(Cut_HashTable_t *pTable)
Cut_HashTable_t * Cut_TableStart(int Size)
Cut_Cut_t * Cut_CutCreateTriv(Cut_Man_t *p, int Node)
Definition: cutCut.c:238
void Cut_CutRecycle(Cut_Man_t *p, Cut_Cut_t *pCut)
Definition: cutCut.c:72
int nCutsDealloc
Definition: cutInt.h:86
int Cut_CutCompare(Cut_Cut_t *pCut1, Cut_Cut_t *pCut2)
Definition: cutCut.c:92
static unsigned Cut_NodeSign(int Node)
MACRO DEFINITIONS ///.
Definition: cutInt.h:124
void Cut_TableClear(Cut_HashTable_t *pTable)
int Cut_TableReadTime(Cut_HashTable_t *pTable)
typedefABC_NAMESPACE_HEADER_START struct Cut_HashTableStruct_t_ Cut_HashTable_t
INCLUDES ///.
Definition: cutInt.h:46
Vec_Int_t * vNodeStarts
Definition: cutInt.h:76
Cut_Cut_t * Cut_CutDupList(Cut_Man_t *p, Cut_Cut_t *pList)
Definition: cutCut.c:120
void Cut_CutRecycleList(Cut_Man_t *p, Cut_Cut_t *pList)
Definition: cutCut.c:148
Vec_Int_t * vNodeAttrs
Definition: cutInt.h:53
int nNodesNoCuts
Definition: cutInt.h:93
void Cut_TruthCompute(Cut_Man_t *p, Cut_Cut_t *pCut, Cut_Cut_t *pCut0, Cut_Cut_t *pCut1, int fCompl0, int fCompl1)
Definition: cutTruth.c:177
Cut_Cut_t * Cut_CutAlloc(Cut_Man_t *p)
FUNCTION DECLARATIONS ///.
Definition: cutCut.c:45
abctime timeHash
Definition: cutInt.h:99
abctime timeMerge
Definition: cutInt.h:95
Cut_Cut_t * pReady
Definition: cutInt.h:63
Extra_MmFixed_t * pMmCuts
Definition: cutInt.h:59
Vec_Int_t * vCutPairs
Definition: cutInt.h:77
Vec_Int_t * vDelays
Definition: cutInt.h:80
Cut_Cut_t * pStore1[2]
Definition: cutInt.h:70
int nCutsAlloc
Definition: cutInt.h:85
int Cut_TableLookup(Cut_HashTable_t *pTable, Cut_Cut_t *pCut, int fStore)
abctime timeFilter
Definition: cutInt.h:98
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Definition: abc_global.h:105
Cut_Cut_t * pCompareNew
Definition: cutInt.h:72
Cut_Cut_t * pStore0[2]
Definition: cutInt.h:69
Vec_Ptr_t * vCutsTemp
Definition: cutInt.h:57
Vec_Ptr_t * vCutsOld
Definition: cutInt.h:56
#define ABC_NAMESPACE_HEADER_END
Definition: abc_global.h:106
Cut_Cut_t * pCompareOld
Definition: cutInt.h:71
Vec_Int_t * vDelays2
Definition: cutInt.h:81
int Cut_CutListVerify(Cut_Cut_t *pList)
Definition: cutNode.c:979
Cut_Cut_t * Cut_CutMergeTwo(Cut_Man_t *p, Cut_Cut_t *pCut0, Cut_Cut_t *pCut1)
Definition: cutMerge.c:170
void Cut_CutNumberList(Cut_Cut_t *pList)
Definition: cutCut.c:219
abctime timeUnion
Definition: cutInt.h:96
Vec_Int_t * vNodeCuts
Definition: cutInt.h:75
Cut_Params_t * pParams
Definition: cutInt.h:51
unsigned * puTemp[4]
Definition: cutInt.h:73
void Cut_NodeDoComputeCuts(Cut_Man_t *p, Cut_List_t *pSuper, int Node, int fCompl0, int fCompl1, Cut_Cut_t *pList0, Cut_Cut_t *pList1, int fTriv, int TreeCode)
Definition: cutNode.c:572
ABC_INT64_T abctime
Definition: abc_global.h:278
void Cut_CutPrintMerge(Cut_Cut_t *pCut, Cut_Cut_t *pCut0, Cut_Cut_t *pCut1)
Definition: cutCut.c:326
int nCutsFilter
Definition: cutInt.h:89
Vec_Ptr_t * vCutsNew
Definition: cutInt.h:55
abctime timeMap
Definition: cutInt.h:100
int nCutsLimit
Definition: cutInt.h:90