ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
nwkMerge.h
Go to the documentation of this file.
1
20
21#ifndef __NWK_MERGE_H__
22#define __NWK_MERGE_H__
23
24
28
32
33
34
36
37
38#define NWK_MAX_LIST 16
39
43
44// the LUT merging parameters
47{
48 int nMaxLutSize; // the max LUT size for merging (N=5)
49 int nMaxSuppSize; // the max total support size after merging (S=5)
50 int nMaxDistance; // the max number of nodes separating LUTs
51 int nMaxLevelDiff; // the max difference in levels
52 int nMaxFanout; // the max number of fanouts to traverse
53 int fUseDiffSupp; // enables the use of nodes with different support
54 int fUseTfiTfo; // enables the use of TFO/TFO nodes as candidates
55 int fVeryVerbose; // enables additional verbose output
56 int fVerbose; // enables verbose output
57};
58
59// edge of the graph
60typedef struct Nwk_Edg_t_ Nwk_Edg_t;
62{
63 int iNode1; // the first node
64 int iNode2; // the second node
65 Nwk_Edg_t * pNext; // the next edge
66};
67
68// vertex of the graph
69typedef struct Nwk_Vrt_t_ Nwk_Vrt_t;
71{
72 int Id; // the vertex number
73 int iPrev; // the previous vertex in the list
74 int iNext; // the next vertex in the list
75 int nEdges; // the number of edges
76 int pEdges[0]; // the array of edges
77};
78
79// the connectivity graph
80typedef struct Nwk_Grf_t_ Nwk_Grf_t;
82{
83 // preliminary graph representation
84 int nObjs; // the number of objects
85 int nVertsMax; // the upper bound on the number of vertices
86 int nEdgeHash; // an approximate number of edges
87 Nwk_Edg_t ** pEdgeHash; // hash table for edges
88 Aig_MmFixed_t * pMemEdges; // memory for edges
89 // graph representation
90 int nEdges; // the number of edges
91 int nVerts; // the number of vertices
92 Nwk_Vrt_t ** pVerts; // the array of vertices
93 Aig_MmFlex_t * pMemVerts; // memory for vertices
94 // intermediate data
95 int pLists1[NWK_MAX_LIST+1]; // lists of nodes with one edge
96 int pLists2[NWK_MAX_LIST+1]; // lists of nodes with more than one edge
97 // the results of matching
98 Vec_Int_t * vPairs; // pairs matched in the graph
99 // object mappings
100 int * pMapLut2Id; // LUT numbers into vertex IDs
101 int * pMapId2Lut; // vertex IDs into LUT numbers
102 // other things
103 int nMemBytes1; // memory usage in bytes
104 int nMemBytes2; // memory usage in bytes
105};
106
110
111#define Nwk_GraphForEachEdge( p, pEdge, k ) \
112 for ( k = 0; k < p->nEdgeHash; k++ ) \
113 for ( pEdge = p->pEdgeHash[k]; pEdge; pEdge = pEdge->pNext )
114
115#define Nwk_ListForEachVertex( p, List, pVrt ) \
116 for ( pVrt = List? p->pVerts[List] : NULL; pVrt; \
117 pVrt = pVrt->iNext? p->pVerts[pVrt->iNext] : NULL )
118
119#define Nwk_VertexForEachAdjacent( p, pVrt, pNext, k ) \
120 for ( k = 0; (k < pVrt->nEdges) && (((pNext) = p->pVerts[pVrt->pEdges[k]]), 1); k++ )
121
125
129
133
134/*=== nwkMerge.c ==========================================================*/
135extern ABC_DLL Nwk_Grf_t * Nwk_ManGraphAlloc( int nVertsMax );
136extern ABC_DLL void Nwk_ManGraphFree( Nwk_Grf_t * p );
138extern ABC_DLL void Nwk_ManGraphHashEdge( Nwk_Grf_t * p, int iLut1, int iLut2 );
139extern ABC_DLL void Nwk_ManGraphSolve( Nwk_Grf_t * p );
140extern ABC_DLL int Nwk_ManLutMergeGraphTest( char * pFileName );
141
142
143
145
146
147
148#endif
149
153
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
#define ABC_DLL
Definition abcapis.h:57
struct Aig_MmFlex_t_ Aig_MmFlex_t
Definition aig.h:53
struct Aig_MmFixed_t_ Aig_MmFixed_t
Definition aig.h:52
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Cube * p
Definition exorList.c:222
ABC_DLL Nwk_Grf_t * Nwk_ManGraphAlloc(int nVertsMax)
INLINED FUNCTIONS ///.
Definition nwkMerge.c:46
ABC_DLL void Nwk_ManGraphHashEdge(Nwk_Grf_t *p, int iLut1, int iLut2)
Definition nwkMerge.c:119
ABC_DLL void Nwk_ManGraphReportMemoryUsage(Nwk_Grf_t *p)
Definition nwkMerge.c:93
struct Nwk_Edg_t_ Nwk_Edg_t
Definition nwkMerge.h:60
ABC_DLL void Nwk_ManGraphFree(Nwk_Grf_t *p)
Definition nwkMerge.c:70
struct Nwk_Vrt_t_ Nwk_Vrt_t
Definition nwkMerge.h:69
ABC_DLL int Nwk_ManLutMergeGraphTest(char *pFileName)
Definition nwkMerge.c:703
struct Nwk_Grf_t_ Nwk_Grf_t
Definition nwkMerge.h:80
ABC_DLL void Nwk_ManGraphSolve(Nwk_Grf_t *p)
Definition nwkMerge.c:621
#define NWK_MAX_LIST
INCLUDES ///.
Definition nwkMerge.h:38
struct Nwk_LMPars_t_ Nwk_LMPars_t
BASIC TYPES ///.
Definition nwkMerge.h:45
int iNode1
Definition nwkMerge.h:63
Nwk_Edg_t * pNext
Definition nwkMerge.h:65
int iNode2
Definition nwkMerge.h:64
int nMemBytes1
Definition nwkMerge.h:103
int nVerts
Definition nwkMerge.h:91
Vec_Int_t * vPairs
Definition nwkMerge.h:98
int pLists1[NWK_MAX_LIST+1]
Definition nwkMerge.h:95
int nObjs
Definition nwkMerge.h:84
int pLists2[NWK_MAX_LIST+1]
Definition nwkMerge.h:96
int nEdges
Definition nwkMerge.h:90
int nVertsMax
Definition nwkMerge.h:85
Nwk_Edg_t ** pEdgeHash
Definition nwkMerge.h:87
Nwk_Vrt_t ** pVerts
Definition nwkMerge.h:92
int nMemBytes2
Definition nwkMerge.h:104
int * pMapId2Lut
Definition nwkMerge.h:101
Aig_MmFixed_t * pMemEdges
Definition nwkMerge.h:88
Aig_MmFlex_t * pMemVerts
Definition nwkMerge.h:93
int nEdgeHash
Definition nwkMerge.h:86
int * pMapLut2Id
Definition nwkMerge.h:100
int fUseDiffSupp
Definition nwkMerge.h:53
int fVeryVerbose
Definition nwkMerge.h:55
int nMaxSuppSize
Definition nwkMerge.h:49
int nMaxDistance
Definition nwkMerge.h:50
int nMaxLutSize
Definition nwkMerge.h:48
int nMaxLevelDiff
Definition nwkMerge.h:51
int iNext
Definition nwkMerge.h:74
int iPrev
Definition nwkMerge.h:73
int pEdges[0]
Definition nwkMerge.h:76
int nEdges
Definition nwkMerge.h:75