ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
giaSupMin.c
Go to the documentation of this file.
1
20
21#include "gia.h"
22#include "bool/kit/kit.h"
23
25
26
30
31// decomposition manager
34{
35 int nVarsMax; // the max number of variables
36 int nWordsMax; // the max number of words
37 Vec_Ptr_t * vTruthVars; // elementary truth tables
38 Vec_Ptr_t * vTruthNodes; // internal truth tables
39 // current problem
41 int iData;
42 int iCare;
45 unsigned * pTruthIn;
46 unsigned * pTruthOut;
47};
48
52
65{
67 assert( nVarsMax <= 20 );
69 p->nVarsMax = nVarsMax;
70 p->nWordsMax = Kit_TruthWordNum( p->nVarsMax );
71 p->vTruthVars = Vec_PtrAllocTruthTables( p->nVarsMax );
72 p->vTruthNodes = Vec_PtrAllocSimInfo( 512, p->nWordsMax );
73 p->vConeCare = Vec_IntAlloc( 512 );
74 p->vConeData = Vec_IntAlloc( 512 );
75 p->pTruthIn = ABC_ALLOC( unsigned, p->nWordsMax );
76 p->pTruthOut = ABC_ALLOC( unsigned, p->nWordsMax );
77 return p;
78}
79
92{
93 ABC_FREE( p->pTruthIn );
94 ABC_FREE( p->pTruthOut );
95 Vec_IntFreeP( &p->vConeCare );
96 Vec_IntFreeP( &p->vConeData );
97 Vec_PtrFreeP( &p->vTruthVars );
98 Vec_PtrFreeP( &p->vTruthNodes );
99 ABC_FREE( p );
100}
101
114{
115 int iData = Gia_ObjId( p->pGia, Gia_Regular(pData) );
116 int iCare = Gia_ObjId( p->pGia, Gia_Regular(pCare) );
117 if ( !Gia_ObjIsAnd(Gia_Regular(pCare)) )
118 {
119 Abc_Print( 1, "Enable is not an AND.\n" );
120 return;
121 }
122 Abc_Print( 1, "DataSupp = %6d. DataCone = %6d. CareSupp = %6d. CareCone = %6d.",
123 Gia_ManSuppSize( p->pGia, &iData, 1 ),
124 Gia_ManConeSize( p->pGia, &iData, 1 ),
125 Gia_ManSuppSize( p->pGia, &iCare, 1 ),
126 Gia_ManConeSize( p->pGia, &iCare, 1 ) );
127 Abc_Print( 1, "\n" );
128}
129
142{
143 Gia_ManSup_t * p;
144 Gia_Obj_t * pData, * pCare;
145 int i;
146 p = Gia_ManSupStart( 16 );
147 p->pGia = pGia;
148 assert( Vec_IntSize(vPairs) % 2 == 0 );
149 for ( i = 0; i < Vec_IntSize(vPairs)/2; i++ )
150 {
151 Abc_Print( 1, "%6d : ", i );
152 pData = Gia_ManPo( pGia, Vec_IntEntry(vPairs, 2*i+0) );
153 pCare = Gia_ManPo( pGia, Vec_IntEntry(vPairs, 2*i+1) );
154 Gia_ManSupExperimentOne( p, Gia_ObjChild0(pData), Gia_ObjChild0(pCare) );
155 }
156 Gia_ManSupStop( p );
157}
158
162
163
165
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
#define ABC_FREE(obj)
Definition abc_global.h:267
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Cube * p
Definition exorList.c:222
void Gia_ManSupExperiment(Gia_Man_t *pGia, Vec_Int_t *vPairs)
Definition giaSupMin.c:141
Gia_ManSup_t * Gia_ManSupStart(int nVarsMax)
FUNCTION DEFINITIONS ///.
Definition giaSupMin.c:64
void Gia_ManSupStop(Gia_ManSup_t *p)
Definition giaSupMin.c:91
typedefABC_NAMESPACE_IMPL_START struct Gia_ManSup_t_ Gia_ManSup_t
DECLARATIONS ///.
Definition giaSupMin.c:32
void Gia_ManSupExperimentOne(Gia_ManSup_t *p, Gia_Obj_t *pData, Gia_Obj_t *pCare)
Definition giaSupMin.c:113
int Gia_ManSuppSize(Gia_Man_t *p, int *pNodes, int nNodes)
Definition giaDfs.c:324
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
int Gia_ManConeSize(Gia_Man_t *p, int *pNodes, int nNodes)
Definition giaDfs.c:375
unsigned * pTruthIn
Definition giaSupMin.c:45
Vec_Ptr_t * vTruthVars
Definition giaSupMin.c:37
Vec_Int_t * vConeData
Definition giaSupMin.c:44
Gia_Man_t * pGia
Definition giaSupMin.c:40
Vec_Ptr_t * vTruthNodes
Definition giaSupMin.c:38
Vec_Int_t * vConeCare
Definition giaSupMin.c:43
unsigned * pTruthOut
Definition giaSupMin.c:46
#define assert(ex)
Definition util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42