ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
cnfCore.c File Reference
#include "cnf.h"
Include dependency graph for cnfCore.c:

Go to the source code of this file.

Functions

void Cnf_ManPrepare ()
 FUNCTION DEFINITIONS ///.
 
Cnf_Man_tCnf_ManRead ()
 
void Cnf_ManFree ()
 
Vec_Int_tCnf_DeriveMappingArray (Aig_Man_t *pAig)
 FUNCTION DECLARATIONS ///.
 
Cnf_Dat_tCnf_DeriveWithMan (Cnf_Man_t *p, Aig_Man_t *pAig, int nOutputs)
 
Cnf_Dat_tCnf_Derive (Aig_Man_t *pAig, int nOutputs)
 
Cnf_Dat_tCnf_DeriveOtherWithMan (Cnf_Man_t *p, Aig_Man_t *pAig, int fSkipTtMin)
 
Cnf_Dat_tCnf_DeriveOther (Aig_Man_t *pAig, int fSkipTtMin)
 

Function Documentation

◆ Cnf_Derive()

Cnf_Dat_t * Cnf_Derive ( Aig_Man_t * pAig,
int nOutputs )

Definition at line 165 of file cnfCore.c.

166{
168 return Cnf_DeriveWithMan( s_pManCnf, pAig, nOutputs );
169}
void Cnf_ManPrepare()
FUNCTION DEFINITIONS ///.
Definition cnfCore.c:46
Cnf_Dat_t * Cnf_DeriveWithMan(Cnf_Man_t *p, Aig_Man_t *pAig, int nOutputs)
Definition cnfCore.c:129
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cnf_DeriveMappingArray()

Vec_Int_t * Cnf_DeriveMappingArray ( Aig_Man_t * pAig)

FUNCTION DECLARATIONS ///.

Function*************************************************************

Synopsis [Converts AIG into the SAT solver.]

Description []

SideEffects []

SeeAlso []

Definition at line 78 of file cnfCore.c.

79{
80 Vec_Int_t * vResult;
81 Cnf_Man_t * p;
82 Vec_Ptr_t * vMapped;
83 Aig_MmFixed_t * pMemCuts;
84 abctime clk;
85 // allocate the CNF manager
86 p = Cnf_ManStart();
87 p->pManAig = pAig;
88
89 // generate cuts for all nodes, assign cost, and find best cuts
90clk = Abc_Clock();
91 pMemCuts = Dar_ManComputeCuts( pAig, 10, 0, 0 );
92p->timeCuts = Abc_Clock() - clk;
93
94 // find the mapping
95clk = Abc_Clock();
97p->timeMap = Abc_Clock() - clk;
98// Aig_ManScanMapping( p, 1 );
99
100 // convert it into CNF
101clk = Abc_Clock();
103 vMapped = Cnf_ManScanMapping( p, 1, 0 );
104 vResult = Cnf_ManWriteCnfMapping( p, vMapped );
105 Vec_PtrFree( vMapped );
106 Aig_MmFixedStop( pMemCuts, 0 );
107p->timeSave = Abc_Clock() - clk;
108
109 // reset reference counters
110 Aig_ManResetRefs( pAig );
111//ABC_PRT( "Cuts ", p->timeCuts );
112//ABC_PRT( "Map ", p->timeMap );
113//ABC_PRT( "Saving ", p->timeSave );
114 Cnf_ManStop( p );
115 return vResult;
116}
ABC_INT64_T abctime
Definition abc_global.h:332
void Aig_ManResetRefs(Aig_Man_t *p)
Definition aigUtil.c:122
struct Aig_MmFixed_t_ Aig_MmFixed_t
Definition aig.h:52
void Aig_MmFixedStop(Aig_MmFixed_t *p, int fVerbose)
Definition aigMem.c:132
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
void Cnf_ManTransferCuts(Cnf_Man_t *p)
Definition cnfPost.c:117
typedefABC_NAMESPACE_HEADER_START struct Cnf_Man_t_ Cnf_Man_t
INCLUDES ///.
Definition cnf.h:51
Cnf_Man_t * Cnf_ManStart()
FUNCTION DEFINITIONS ///.
Definition cnfMan.c:51
void Cnf_DeriveMapping(Cnf_Man_t *p)
Definition cnfMap.c:100
Vec_Ptr_t * Cnf_ManScanMapping(Cnf_Man_t *p, int fCollect, int fPreorder)
Definition cnfUtil.c:377
void Cnf_ManStop(Cnf_Man_t *p)
Definition cnfMan.c:82
Vec_Int_t * Cnf_ManWriteCnfMapping(Cnf_Man_t *p, Vec_Ptr_t *vMapped)
DECLARATIONS ///.
Definition cnfWrite.c:45
Aig_MmFixed_t * Dar_ManComputeCuts(Aig_Man_t *pAig, int nCutsMax, int fSkipTtMin, int fVerbose)
Definition darCore.c:291
Cube * p
Definition exorList.c:222
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cnf_DeriveOther()

Cnf_Dat_t * Cnf_DeriveOther ( Aig_Man_t * pAig,
int fSkipTtMin )

Definition at line 219 of file cnfCore.c.

220{
222 return Cnf_DeriveOtherWithMan( s_pManCnf, pAig, fSkipTtMin );
223}
Cnf_Dat_t * Cnf_DeriveOtherWithMan(Cnf_Man_t *p, Aig_Man_t *pAig, int fSkipTtMin)
Definition cnfCore.c:182
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cnf_DeriveOtherWithMan()

Cnf_Dat_t * Cnf_DeriveOtherWithMan ( Cnf_Man_t * p,
Aig_Man_t * pAig,
int fSkipTtMin )

Function*************************************************************

Synopsis [Converts AIG into the SAT solver.]

Description []

SideEffects []

SeeAlso []

Definition at line 182 of file cnfCore.c.

183{
184 Cnf_Dat_t * pCnf;
185 Vec_Ptr_t * vMapped;
186 Aig_MmFixed_t * pMemCuts;
187 abctime clk;
188 // connect the managers
189 p->pManAig = pAig;
190
191 // generate cuts for all nodes, assign cost, and find best cuts
192clk = Abc_Clock();
193 pMemCuts = Dar_ManComputeCuts( pAig, 10, fSkipTtMin, 0 );
194p->timeCuts = Abc_Clock() - clk;
195
196 // find the mapping
197clk = Abc_Clock();
199p->timeMap = Abc_Clock() - clk;
200// Aig_ManScanMapping( p, 1 );
201
202 // convert it into CNF
203clk = Abc_Clock();
205 vMapped = Cnf_ManScanMapping( p, 1, 1 );
206 pCnf = Cnf_ManWriteCnfOther( p, vMapped );
207 pCnf->vMapping = Cnf_ManWriteCnfMapping( p, vMapped );
208 Vec_PtrFree( vMapped );
209 Aig_MmFixedStop( pMemCuts, 0 );
210p->timeSave = Abc_Clock() - clk;
211
212 // reset reference counters
213 Aig_ManResetRefs( pAig );
214//ABC_PRT( "Cuts ", p->timeCuts );
215//ABC_PRT( "Map ", p->timeMap );
216//ABC_PRT( "Saving ", p->timeSave );
217 return pCnf;
218}
Cnf_Dat_t * Cnf_ManWriteCnfOther(Cnf_Man_t *p, Vec_Ptr_t *vMapped)
Definition cnfWrite.c:419
struct Cnf_Dat_t_ Cnf_Dat_t
Definition cnf.h:52
Vec_Int_t * vMapping
Definition cnf.h:67
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cnf_DeriveWithMan()

Cnf_Dat_t * Cnf_DeriveWithMan ( Cnf_Man_t * p,
Aig_Man_t * pAig,
int nOutputs )

Function*************************************************************

Synopsis [Converts AIG into the SAT solver.]

Description []

SideEffects []

SeeAlso []

Definition at line 129 of file cnfCore.c.

130{
131 Cnf_Dat_t * pCnf;
132 Vec_Ptr_t * vMapped;
133 Aig_MmFixed_t * pMemCuts;
134 abctime clk;
135 // connect the managers
136 p->pManAig = pAig;
137
138 // generate cuts for all nodes, assign cost, and find best cuts
139clk = Abc_Clock();
140 pMemCuts = Dar_ManComputeCuts( pAig, 10, 0, 0 );
141p->timeCuts = Abc_Clock() - clk;
142
143 // find the mapping
144clk = Abc_Clock();
146p->timeMap = Abc_Clock() - clk;
147// Aig_ManScanMapping( p, 1 );
148
149 // convert it into CNF
150clk = Abc_Clock();
152 vMapped = Cnf_ManScanMapping( p, 1, 1 );
153 pCnf = Cnf_ManWriteCnf( p, vMapped, nOutputs );
154 Vec_PtrFree( vMapped );
155 Aig_MmFixedStop( pMemCuts, 0 );
156p->timeSave = Abc_Clock() - clk;
157
158 // reset reference counters
159 Aig_ManResetRefs( pAig );
160//ABC_PRT( "Cuts ", p->timeCuts );
161//ABC_PRT( "Map ", p->timeMap );
162//ABC_PRT( "Saving ", p->timeSave );
163 return pCnf;
164}
Cnf_Dat_t * Cnf_ManWriteCnf(Cnf_Man_t *p, Vec_Ptr_t *vMapped, int nOutputs)
Definition cnfWrite.c:199
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cnf_ManFree()

void Cnf_ManFree ( )

Definition at line 58 of file cnfCore.c.

59{
60 if ( s_pManCnf == NULL )
61 return;
62 Cnf_ManStop( s_pManCnf );
63 s_pManCnf = NULL;
64}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cnf_ManPrepare()

void Cnf_ManPrepare ( )

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 46 of file cnfCore.c.

47{
48 if ( s_pManCnf == NULL )
49 {
50// printf( "\n\nCreating CNF manager!!!!!\n\n" );
51 s_pManCnf = Cnf_ManStart();
52 }
53}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cnf_ManRead()

Cnf_Man_t * Cnf_ManRead ( )

Definition at line 54 of file cnfCore.c.

55{
56 return s_pManCnf;
57}