ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
cecSimBack.c File Reference
#include "cecInt.h"
#include "aig/gia/giaAig.h"
Include dependency graph for cecSimBack.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START int Cec_ObjSatVerify (Gia_Man_t *p, Gia_Obj_t *pRoot, int Value)
 DECLARATIONS ///.
 
word Cec_ManCheckSat2_rec (Gia_Man_t *p, Gia_Obj_t *pObj, word Value, Vec_Wrd_t *vValues)
 
word Cec_ManCheckSat2 (Gia_Man_t *p, Gia_Obj_t *pObj, int Value, Vec_Wrd_t *vValues)
 
int Cec_ManCheckSat_rec (Gia_Man_t *p, Gia_Obj_t *pObj, int Value)
 
void Cec_ManSimBack (Gia_Man_t *p)
 

Function Documentation

◆ Cec_ManCheckSat2()

word Cec_ManCheckSat2 ( Gia_Man_t * p,
Gia_Obj_t * pObj,
int Value,
Vec_Wrd_t * vValues )

Definition at line 110 of file cecSimBack.c.

111{
112 return 0;
113}

◆ Cec_ManCheckSat2_rec()

word Cec_ManCheckSat2_rec ( Gia_Man_t * p,
Gia_Obj_t * pObj,
word Value,
Vec_Wrd_t * vValues )

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

Synopsis [Return 1 if pObj can have Value.]

Description []

SideEffects []

SeeAlso []

Definition at line 80 of file cecSimBack.c.

81{
82 Gia_Obj_t * pFan0, * pFan1;
83 if ( Gia_ObjIsTravIdCurrent(p, pObj) )
84 return Value == (int)pObj->fMark0;
85 Gia_ObjSetTravIdCurrent(p, pObj);
86 pObj->fMark0 = Value;
87 if ( !Gia_ObjIsAnd(pObj) )
88 return 1;
89 pFan0 = Gia_ObjFanin0(pObj);
90 pFan1 = Gia_ObjFanin1(pObj);
91 if ( Value )
92 {
93 return Cec_ManCheckSat2_rec( p, pFan0, !Gia_ObjFaninC0(pObj), vValues ) &&
94 Cec_ManCheckSat2_rec( p, pFan1, !Gia_ObjFaninC1(pObj), vValues );
95 }
96 if ( Gia_ObjIsTravIdCurrent(p, pFan0) ) // already assigned
97 {
98 if ( Gia_ObjFaninC0(pObj) == (int)pFan0->fMark0 ) // justified
99 return 1;
100 return Cec_ManCheckSat2_rec( p, pFan1, Gia_ObjFaninC1(pObj), vValues );
101 }
102 if ( Gia_ObjIsTravIdCurrent(p, pFan1) ) // already assigned
103 {
104 if ( Gia_ObjFaninC1(pObj) == (int)pFan1->fMark0 ) // justified
105 return 1;
106 return Cec_ManCheckSat2_rec( p, pFan0, Gia_ObjFaninC0(pObj), vValues );
107 }
108 return Cec_ManCheckSat2_rec( p, pFan0, Gia_ObjFaninC0(pObj), vValues );
109}
word Cec_ManCheckSat2_rec(Gia_Man_t *p, Gia_Obj_t *pObj, word Value, Vec_Wrd_t *vValues)
Definition cecSimBack.c:80
Cube * p
Definition exorList.c:222
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
unsigned fMark0
Definition gia.h:81
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManCheckSat_rec()

int Cec_ManCheckSat_rec ( Gia_Man_t * p,
Gia_Obj_t * pObj,
int Value )

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

Synopsis [Return 1 if pObj can have Value.]

Description []

SideEffects []

SeeAlso []

Definition at line 126 of file cecSimBack.c.

127{
128 Gia_Obj_t * pFan0, * pFan1;
129 if ( Gia_ObjIsTravIdCurrent(p, pObj) )
130 return Value == (int)pObj->fMark0;
131 Gia_ObjSetTravIdCurrent(p, pObj);
132 pObj->fMark0 = Value;
133 if ( !Gia_ObjIsAnd(pObj) )
134 return 1;
135 pFan0 = Gia_ObjFanin0(pObj);
136 pFan1 = Gia_ObjFanin1(pObj);
137 if ( Value )
138 {
139 return Cec_ManCheckSat_rec( p, pFan0, !Gia_ObjFaninC0(pObj) ) &&
140 Cec_ManCheckSat_rec( p, pFan1, !Gia_ObjFaninC1(pObj) );
141 }
142 if ( Gia_ObjIsTravIdCurrent(p, pFan0) ) // already assigned
143 {
144 if ( Gia_ObjFaninC0(pObj) == (int)pFan0->fMark0 ) // justified
145 return 1;
146 return Cec_ManCheckSat_rec( p, pFan1, Gia_ObjFaninC1(pObj) );
147 }
148 if ( Gia_ObjIsTravIdCurrent(p, pFan1) ) // already assigned
149 {
150 if ( Gia_ObjFaninC1(pObj) == (int)pFan1->fMark0 ) // justified
151 return 1;
152 return Cec_ManCheckSat_rec( p, pFan0, Gia_ObjFaninC0(pObj) );
153 }
154 return Cec_ManCheckSat_rec( p, pFan0, Gia_ObjFaninC0(pObj) );
155}
int Cec_ManCheckSat_rec(Gia_Man_t *p, Gia_Obj_t *pObj, int Value)
Definition cecSimBack.c:126
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cec_ManSimBack()

void Cec_ManSimBack ( Gia_Man_t * p)

Definition at line 156 of file cecSimBack.c.

157{
158 abctime clk = Abc_Clock();
159 Vec_Wrd_t * vValues = Vec_WrdStart( Gia_ManObjNum(p) );
160 Gia_Obj_t * pObj;
161 int i, Count = 0;
162 word Res;
164 //Gia_ManForEachAnd( p, pObj, i )
165 // printf( "%d", pObj->fPhase );
166 //printf( "\n" );
167 //return;
168
169 Gia_ManForEachAnd( p, pObj, i )
170 {
172 //Gia_ManCleanMark0( p );
173 Res = Cec_ManCheckSat_rec( p, pObj, !pObj->fPhase );
174 //if ( Res )
175 // Cec_ObjSatVerify( p, pObj, !pObj->fPhase );
176
177 //Res = Cec_ManCheckSat2_rec( p, pObj, !pObj->fPhase ? ~(word)0 : 0, vValues );
178 //if ( Res )
179 // Cec_ObjSatVerify2( p, pObj, !pObj->fPhase, Res );
180
181 Count += (int)(Res > 0);
182 }
183 Vec_WrdFree( vValues );
184 printf( "Obj = %6d. SAT = %6d. ", Gia_ManAndNum(p), Count );
185 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
186}
ABC_INT64_T abctime
Definition abc_global.h:332
#define Gia_ManForEachAnd(p, pObj, i)
Definition gia.h:1214
void Gia_ManIncrementTravId(Gia_Man_t *p)
Definition giaUtil.c:190
void Gia_ManSetPhase(Gia_Man_t *p)
Definition giaUtil.c:420
unsigned __int64 word
DECLARATIONS ///.
Definition kitPerm.c:36
unsigned fPhase
Definition gia.h:87
typedefABC_NAMESPACE_HEADER_START struct Vec_Wrd_t_ Vec_Wrd_t
INCLUDES ///.
Definition vecWrd.h:42
Here is the call graph for this function:

◆ Cec_ObjSatVerify()

ABC_NAMESPACE_IMPL_START int Cec_ObjSatVerify ( Gia_Man_t * p,
Gia_Obj_t * pRoot,
int Value )

DECLARATIONS ///.

CFile****************************************************************

FileName [cecSimBack.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Combinational equivalence checking.]

Synopsis [Backward simulation.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id
cecSimBack.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 46 of file cecSimBack.c.

47{
48 Gia_Obj_t * pObj;
49 int i, RetValue = 1;
50 printf( "Obj = %4d Value = %d ", Gia_ObjId(p, pRoot), Value );
51 Gia_ObjTerSimSet0( Gia_ManConst0(p) );
52 Gia_ManForEachCi( p, pObj, i )
53 if ( !Gia_ObjIsTravIdCurrent(p, pObj) )
54 Gia_ObjTerSimSetX( pObj ), printf( "x" );
55 else if ( pObj->fMark0 )
56 Gia_ObjTerSimSet1( pObj ), printf( "1" );
57 else
58 Gia_ObjTerSimSet0( pObj ), printf( "0" );
59 printf( " " );
60 Gia_ManForEachAnd( p, pObj, i )
61 Gia_ObjTerSimAnd( pObj );
62 if ( Value ? Gia_ObjTerSimGet1(pRoot) : Gia_ObjTerSimGet0(pRoot) )
63 printf( "Verification successful.\n" );
64 else
65 printf( "Verification failed.\n" ), RetValue = 0;
66 return RetValue;
67}
#define Gia_ManForEachCi(p, pObj, i)
Definition gia.h:1228